2011-02-15 Gavin Barraclough Reviewed by Geoff Garen. Bug 54524 - Allow JSObject to fully utilize cell's capacity for inline storage. Currently JSObject is both directly instantiated for regular JS objects, and derived to implement subtypes. A consequence of this is that we need to ensure that sufficient space from the cell is left unused and available for any data members that will be introduced by subclasses of JSObject. By restructuring the internal storage array out of JSObject we can increase the size in the internal storage for regular objects. Add classes JSFinalObject and JSNonFinalObject. JSNonFinalObject retains as much additional capacity as is currently available to allow for data members in subclasses. JSFinalObject utilizes all available space for internal storage, and only allows construction through JSFinalObject::create(). * bindings/js/JSDOMWindowShell.h: Update JSObject -> JSNonFinalObject. 2011-02-16 Carol Szabo Reviewed by David Hyatt. REGRESSION: Use after free in WebCore::RenderCounter::destroyCounterNode https://bugs.webkit.org/show_bug.cgi?id=54478 Test: fast/css/counters/render-tree-reorg-crash.html * rendering/RenderCounter.cpp: (WebCore::findPlaceForCounter): Fixed typo. The code was still walking sometimes the renderer tree instead of the element tree as intended. 2011-02-16 Hans Wennborg Reviewed by Jeremy Orlow. IndexedDB: Inject auto increment keys via key path on insertion https://bugs.webkit.org/show_bug.cgi?id=54457 Inject auto increment keys via key path for object stores using key path and auto increment. * bindings/v8/IDBBindingUtilities.cpp: (WebCore::LocalContext::getNthValueOnKeyPath): (WebCore::createIDBKeyFromSerializedValueAndKeyPath): (WebCore::injectIDBKeyIntoSerializedValue): * bindings/v8/IDBBindingUtilities.h: * platform/chromium/PlatformBridge.h: * storage/IDBKeyPathBackendImpl.cpp: (IDBKeyPathBackendImpl::injectIDBKeyIntoSerializedValue): * storage/IDBKeyPathBackendImpl.h: * storage/IDBObjectStoreBackendImpl.cpp: (WebCore::injectKeyIntoKeyPath): (WebCore::IDBObjectStoreBackendImpl::selectKeyForPut): (WebCore::IDBObjectStoreBackendImpl::putInternal): * storage/IDBObjectStoreBackendImpl.h: * storage/chromium/IDBKeyPathBackendImpl.cpp: (WebCore::IDBKeyPathBackendImpl::injectIDBKeyIntoSerializedValue): 2011-02-16 Sergio Villar Senin Reviewed by Martin Robinson. [Gtk] Add support for layoutTestController.setWillSendRequestClearHeader https://bugs.webkit.org/show_bug.cgi?id=54537 Headers removed from the SoupMessage should be also removed from the ResourceRequest when updating the latter from the former. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateFromSoupMessage): 2011-02-16 Ilya Tikhonovsky Reviewed by Yury Semikhatsky. Web Inspector: split all the functions of Inspector backend API by domain. https://bugs.webkit.org/show_bug.cgi?id=54558 We have a number of functions from different domains in single instance of InspectorBackend. It'd be better to split the functions by their domains. As example 'evaluate' will be moved from InspectorBackend to RuntimeAgent container. * inspector/CodeGeneratorInspector.pm: * inspector/front-end/AuditRules.js: (WebInspector.AuditRules.evaluateInTargetWindow): (WebInspector.AuditRules.UnusedCssRule.prototype.doRun): * inspector/front-end/AuditsPanel.js: (WebInspector.AuditsPanel.prototype._reloadResources): * inspector/front-end/BreakpointManager.js: (WebInspector.BreakpointManager.prototype._projectChanged): (WebInspector.BreakpointManager.prototype.restoreDOMBreakpoints): (WebInspector.BreakpointManager.prototype._saveBreakpoints): (WebInspector.DOMBreakpoint.prototype._enable): (WebInspector.DOMBreakpoint.prototype._disable): (WebInspector.EventListenerBreakpoint.prototype._enable): (WebInspector.EventListenerBreakpoint.prototype._disable): (WebInspector.XHRBreakpoint.prototype._enable): (WebInspector.XHRBreakpoint.prototype._disable): * inspector/front-end/CSSStyleModel.js: (WebInspector.CSSStyleModel.prototype.getStylesAsync): (WebInspector.CSSStyleModel.prototype.getComputedStyleAsync): (WebInspector.CSSStyleModel.prototype.getInlineStyleAsync): (WebInspector.CSSStyleModel.prototype.setRuleSelector.callback): (WebInspector.CSSStyleModel.prototype.setRuleSelector): (WebInspector.CSSStyleModel.prototype.addRule.callback): (WebInspector.CSSStyleModel.prototype.addRule): (WebInspector.CSSStyleModel.prototype._styleSheetChanged): (WebInspector.CSSStyleModel.prototype._onRevert): (WebInspector.CSSStyleDeclaration.prototype.insertPropertyAt): (WebInspector.CSSProperty.prototype.setText): (WebInspector.CSSProperty.prototype.setDisabled): (WebInspector.CSSStyleSheet.createForId): (WebInspector.CSSStyleSheet.prototype.setText): * inspector/front-end/ConsoleView.js: (WebInspector.ConsoleView.prototype.requestClearMessages): (WebInspector.ConsoleView.prototype.completions): (WebInspector.ConsoleView.prototype._handleContextMenuEvent.itemAction): (WebInspector.ConsoleView.prototype._handleContextMenuEvent): (WebInspector.ConsoleView.prototype.evalInInspectedWindow): * inspector/front-end/CookieItemsView.js: (WebInspector.CookieItemsView.prototype._deleteCookie): * inspector/front-end/DOMAgent.js: (WebInspector.DOMAgent.prototype.getChildNodesAsync): (WebInspector.DOMAgent.prototype.setAttributeAsync): (WebInspector.DOMAgent.prototype.removeAttributeAsync): (WebInspector.DOMAgent.prototype.setTextNodeValueAsync): (WebInspector.ApplicationCacheDispatcher.getApplicationCachesAsync): (WebInspector.Cookies.getCookiesAsync): (WebInspector.EventListeners.getEventListenersForNodeAsync): * inspector/front-end/DOMStorage.js: (WebInspector.DOMStorage.prototype.getEntries): (WebInspector.DOMStorage.prototype.setItem): (WebInspector.DOMStorage.prototype.removeItem): * inspector/front-end/Database.js: (WebInspector.Database.prototype.getTableNames): (WebInspector.Database.prototype.executeSql): * inspector/front-end/DebuggerModel.js: (WebInspector.DebuggerModel.prototype.enableDebugger): (WebInspector.DebuggerModel.prototype.disableDebugger): (WebInspector.DebuggerModel.prototype.continueToLocation): (WebInspector.DebuggerModel.prototype.setBreakpoint): (WebInspector.DebuggerModel.prototype.setBreakpointBySourceId): (WebInspector.DebuggerModel.prototype.removeBreakpoint): (WebInspector.DebuggerModel.prototype.editScriptSource): * inspector/front-end/ElementsPanel.js: (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged): (WebInspector.ElementsPanel): (WebInspector.ElementsPanel.prototype.setDocument): (WebInspector.ElementsPanel.prototype.searchCanceled): (WebInspector.ElementsPanel.prototype.performSearch): (WebInspector.ElementsPanel.prototype.handleCopyEvent): (WebInspector.ElementsPanel.prototype.setSearchingForNode): * inspector/front-end/ElementsTreeOutline.js: (WebInspector.ElementsTreeElement.prototype._createTooltipForNode): (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted): (): * inspector/front-end/ExtensionPanel.js: (WebInspector.ExtensionWatchSidebarPane.prototype.setExpression): * inspector/front-end/ExtensionServer.js: (WebInspector.ExtensionServer.prototype._onAddRequestHeaders): (WebInspector.ExtensionServer.prototype._onReload): (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage): * inspector/front-end/HeapSnapshotView.js: (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked): * inspector/front-end/NetworkManager.js: (WebInspector.NetworkManager): (WebInspector.NetworkManager.prototype.reset): (WebInspector.NetworkManager.prototype.requestContent): * inspector/front-end/NetworkPanel.js: (WebInspector.NetworkDataGridNode.prototype._openInNewTab): * inspector/front-end/ProfileView.js: (WebInspector.CPUProfileView): (WebInspector.CPUProfileType.prototype.buttonClicked): * inspector/front-end/ProfilesPanel.js: (WebInspector.ProfilesPanel.prototype._clearProfiles): (WebInspector.ProfilesPanel.prototype._removeProfileHeader): (WebInspector.ProfilesPanel.prototype.loadHeapSnapshot): (WebInspector.ProfilesPanel.prototype._toggleProfiling): (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot): * inspector/front-end/PropertiesSidebarPane.js: (WebInspector.PropertiesSidebarPane.prototype.update): * inspector/front-end/RemoteObject.js: (WebInspector.RemoteObject.resolveNode): (WebInspector.RemoteObject.prototype.getProperties): (WebInspector.RemoteObject.prototype.setPropertyValue): (WebInspector.RemoteObject.prototype.pushNodeToFrontend): * inspector/front-end/ResourcesPanel.js: (WebInspector.FrameTreeElement.prototype.onselect): (WebInspector.FrameTreeElement.prototype.set hovered): (WebInspector.FrameResourceTreeElement.prototype.ondblclick): * inspector/front-end/Script.js: (WebInspector.Script.prototype.requestSource): * inspector/front-end/ScriptsPanel.js: (WebInspector.ScriptsPanel.prototype.evaluateInSelectedCallFrame): (WebInspector.ScriptsPanel.prototype._setPauseOnExceptions): (WebInspector.ScriptsPanel.prototype._togglePause): (WebInspector.ScriptsPanel.prototype._stepOverClicked): (WebInspector.ScriptsPanel.prototype._stepIntoClicked): (WebInspector.ScriptsPanel.prototype._stepOutClicked): (WebInspector.ScriptsPanel.prototype.toggleBreakpointsClicked): * inspector/front-end/SourceFrame.js: (WebInspector.SourceFrame.prototype._hidePopup): * inspector/front-end/TestController.js: (WebInspector.TestController.prototype.notifyDone): * inspector/front-end/TimelinePanel.js: (WebInspector.TimelinePanel.prototype._toggleTimelineButtonClicked): * inspector/front-end/WatchExpressionsSidebarPane.js: (WebInspector.WatchExpressionsSection.prototype.update): * inspector/front-end/WorkersSidebarPane.js: (WebInspector.WorkersSidebarPane.prototype.setInstrumentation): * inspector/front-end/inspector.js: (WebInspector.highlightDOMNode): (WebInspector.doLoadedDone): (WebInspector.openResource): (WebInspector.documentKeyDown): 2011-02-16 Mario Sanchez Prada Reviewed by Martin Robinson. [GTK] events missing when a document is (re)loaded https://bugs.webkit.org/show_bug.cgi?id=25831 Make sure webArea returns a proper name and that a signal 'state-change::defunct' is emitted when detaching the wrapper. Test: platform/gtk/accessibility/document-reload-events.html * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (webkit_accessible_get_name): Returns the current document's title as fallback mechanism for webArea objects. (webkit_accessible_detach): Emit 'state-change::defunct' function as soon as the wrapper is detached from the related core object. 2011-02-15 Nikolas Zimmermann Reviewed by Dirk Schulze. Pixel tests differences on 10.6.6 32bit vs. 64bit https://bugs.webkit.org/show_bug.cgi?id=54474 When generating a SVG pixel test baseline with a vanilla 10.6.6 installation on a 32bit machine (Core Duo MBP) and comparing the run with a software-identical 64bit machine (Core 2 Duo MBP), there are about 250 differences. These fall in two categories: a) 1px differences in text AA, or when drawing circles (all _below_ a tolerance of 0.01). Only visible in the subtracted difference image. The reason is probably CGFloat being typedefed to double on 64bit machines, and float on 32bit machines. AffineTransform stores doubles, so on 32bit machines we loose precision from AffineTransform -> CGAffineTransform. b) Failures >0.1% (text origin/scale is slightly different, user-visible). Caused by several sources of numerical instabilities within the SVG rendering code. -> SVGPreserveAspectRatio::getCTM() computes an AffineTransform using doubles as input parameters, but floats are passed (like everywhere else in SVG). This method is used to compute the viewBox AffineTransform, that affects the rendering of every content in the document. RenderSVGRoot concats this transformation matrix to the GraphicsContext CTM, resulting in a source of numerical imprecision. -> SVGInlineTextBox::paintTextWithShadows() calculates a scaling factor for text, to scale up the specified font size, to the actual on-screen size. SVGInlineTextBox uses the scaled Font object, to draw in an unscaled context, that gets scaled up again afterwards. context->scale(1 / scalingFactor); scaledFont.drawText(); context->scale(scalingFactor); To remove the scale from the current GraphicsContext CTM, "context->scale(FloatSize(1 / scalingFactor, ...)" is used. As AffineTransform stores doubles internally, it's likely that "context->scale(FloatSize(1 / ctm.a(), .." doesn't give you a matrix with a=1, but something close to 1. Using "context->concatCTM(AffineTransform().scale(1 / ctm.a(), ..." could be used as workaround, to preserve double precision. Fixing that brings us down to just a few pixel tests that differ between 32 & 64bit. There is still numerical imprecision, as floating-point number representations aren't always precise. Unfortunately CoreGraphics doesn't provide a public way to just set a CTM, it only allows to concat them. Fortunately CGContextSetCTM() is available, as private method, that allows me to switch the context CTM to any arbitary CGAffineTransform. -> Add GraphicsContext::setCTM(const AffineTransform&) and implement it for all platforms (each explicitely exposes a 'setCTM' concept, except CG) Use CGContextSetCTM() for CG, which appears to be present since at least 10.4, Cairo is using it for the same purpose since some years! -> Instead of scaling the GraphicsContext before drawing text, grab the current CTM using context->getCTM(), scale it by '1 / scalingFactor' normalize the transform (look for values close to 0/1 using float precision, and round!), and assign it using context->setCTM(normalizedTransform). After drawing, just switch back to the preserved original CTM, both operations need GraphicsContext::setCTM. This fixes all pixel test differences between 32/64 bit machines that fall into category b). The use of GraphicsContext::setCTM() allows to switch between arbitary context transformations _without_ inducing accumulated rounding imprecision. These combined patches fix the pixel test baseline changes. Updated existing Snow Leopard pixel test baseline with a 32bit machine, passes here with tolerance 0. The 64bit machine passes the baseline with tolerance 0.01. * platform/graphics/GraphicsContext.h: Add setCTM(const AffineTransform&) method. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::setCTM): Implement setCTM. * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: (WebCore::GraphicsContextPlatformPrivate::setCTM): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::setCTM): Ditto. * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h: (WebCore::GraphicsContextPlatformPrivate::setCTM): Ditto. * platform/graphics/chromium/GLES2Canvas.cpp: (WebCore::GLES2Canvas::setCTM): Ditto. * platform/graphics/chromium/GLES2Canvas.h: * platform/graphics/haiku/GraphicsContextHaiku.cpp: (WebCore::GraphicsContext::setCTM): Ditto. * platform/graphics/openvg/GraphicsContextOpenVG.cpp: (WebCore::GraphicsContext::setCTM): Ditto. * platform/graphics/qt/GraphicsContextQt.cpp: (WebCore::GraphicsContext::setCTM): Ditto. * platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::GraphicsContext::setCTM): Ditto. * platform/graphics/win/GraphicsContextWin.cpp: (WebCore::GraphicsContextPlatformPrivate::setCTM): Ditto. * platform/graphics/wince/GraphicsContextWinCE.cpp: (WebCore::GraphicsContextPlatformPrivate::concatCTM): (WebCore::GraphicsContextPlatformPrivate::setCTM): Ditto. (WebCore::GraphicsContext::setCTM): * platform/graphics/wx/GraphicsContextWx.cpp: (WebCore::GraphicsContext::setCTM): Ditto. * rendering/svg/SVGInlineTextBox.cpp: Use setCTM() to switch to a scale-free AffineTransform, and also to switch back to the original CTM after rendering text. (WebCore::normalizeTransform): (WebCore::SVGInlineTextBox::paintDecorationWithStyle): (WebCore::SVGInlineTextBox::paintTextWithShadows): * svg/SVGPreserveAspectRatio.cpp: s/double/float/. (WebCore::SVGPreserveAspectRatio::getCTM): * svg/SVGPreserveAspectRatio.h: * svg/SVGSVGElement.cpp: Simplify viewport() code, avoid using doubles. (WebCore::SVGSVGElement::viewport): 2011-02-16 Andreas Kling Reviewed by Dirk Schulze. SVGAnimateElement incorrectly uses Color::nameForRenderTreeAsText() https://bugs.webkit.org/show_bug.cgi?id=54547 * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::applyResultsToTarget): 2011-02-14 Mikhail Naganov Reviewed by Pavel Feldman. Web Inspector: [Chromium] Landing detailed heap snapshots, part 3. https://bugs.webkit.org/show_bug.cgi?id=54385 Provide node classes for data grid views: - summary -- list of objects by constuctor; - diff -- summaries btw two snapshots; - explorer -- explore heap graph; - dominators tree; * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * inspector/front-end/DetailedHeapshotGridNodes.js: Added. * inspector/front-end/HeapSnapshot.js: (WebInspector.HeapSnapshotFilteredOrderedIterator): (WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.incInstancesCount): (WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.get instancesCount): (WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.next): (WebInspector.HeapSnapshotFilteredOrderedIterator.prototype.resetInstancesCount): (WebInspector.HeapSnapshotEdgesProvider): (WebInspector.HeapSnapshotNodesProvider): * inspector/front-end/PleaseWaitMessage.js: (WebInspector.PleaseWaitMessage.prototype.get instance): * inspector/front-end/WebKit.qrc: * inspector/front-end/inspector.html: 2011-02-16 Sheriff Bot Unreviewed, rolling out r78655. http://trac.webkit.org/changeset/78655 https://bugs.webkit.org/show_bug.cgi?id=54543 Causes too many test failures in chromium (Requested by mnaganov on #webkit). * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/JSEventTarget.cpp: (WebCore::toJS): * bindings/v8/V8AbstractEventListener.cpp: (WebCore::V8AbstractEventListener::invokeEventHandler): * dom/EventTarget.cpp: * dom/EventTarget.h: * storage/IDBRequest.cpp: * storage/IDBRequest.h: 2011-02-16 Ilya Tikhonovsky Reviewed by Yury Semikhatsky. Web Inspector: move Database and DOMStorage related things from InspectorAgent to the corresponding agents. https://bugs.webkit.org/show_bug.cgi?id=54455 Some set of instrumentation calls should work even if we have no InspectorFrontend instance and corresponding agents. At the moment we are using InspectorAgent instance for such calls. * inspector/InspectorAgent.cpp: (WebCore::InspectorAgent::InspectorAgent): (WebCore::InspectorAgent::createFrontendLifetimeAgents): (WebCore::InspectorAgent::pushDataCollectedOffline): (WebCore::InspectorAgent::didCommitLoad): * inspector/InspectorAgent.h: (WebCore::InspectorOfflineResourcesBase::~InspectorOfflineResourcesBase): (WebCore::InspectorOfflineResourcesBase::InspectorOfflineResourcesBase): (WebCore::InspectorAgent::databaseAgentResources): (WebCore::InspectorAgent::domStorageAgentResources): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::Resources::clear): (WebCore::InspectorDOMStorageAgent::Resources::pushDataCollectedOffline): (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent): (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent): (WebCore::InspectorDOMStorageAgent::createOfflineStorage): (WebCore::InspectorDOMStorageAgent::selectDOMStorage): (WebCore::InspectorDOMStorageAgent::getDOMStorageResourceForId): (WebCore::InspectorDOMStorageAgent::didUseDOMStorage): * inspector/InspectorDOMStorageAgent.h: (WebCore::InspectorDOMStorageAgent::create): * inspector/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::Resources::clear): (WebCore::InspectorDatabaseAgent::Resources::pushDataCollectedOffline): (WebCore::InspectorDatabaseAgent::didOpenDatabase): (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent): (WebCore::InspectorDatabaseAgent::createOfflineStorage): (WebCore::InspectorDatabaseAgent::databaseForId): (WebCore::InspectorDatabaseAgent::selectDatabase): * inspector/InspectorDatabaseAgent.h: (WebCore::InspectorDatabaseAgent::create): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didOpenDatabaseImpl): (WebCore::InspectorInstrumentation::didUseDOMStorageImpl): 2011-02-15 John Sullivan Reviewed by Antti Koivisto. Dan Bernstein came up with this fix while we debugged it. I just typed. https://bugs.webkit.org/show_bug.cgi?id=54532 On platforms without platformWidgets, going Back to a scrolled page draws at the top-left before drawing at the restored scroll position * page/FrameView.cpp: (WebCore::FrameView::performPostLayoutTasks): Don't send the didFirstLayout and didFirstVisuallyNonEmptyLayout callbacks for nested layouts. Doing so was causing ScrollView::setScrollPosition() to short-circuit. 2011-02-15 Csaba Osztrogonác Unreviewed. [Qt][V8] Buildfix. Add missing USE(JSC) guard. * plugins/qt/PluginViewQt.cpp: 2011-02-15 Ami Fischman Reviewed by David Levin. Remove the artificial -32px shift for media controls in mediaDocuments so that they overlap the canvas as they do in non-mediaDocuments. This also fixes test_shell failing to update the media slider (see linked crbug below). https://bugs.webkit.org/show_bug.cgi?id=27798 http://crbug.com/72623 Test: media/video-controls-in-media-document.html Added a render test that asserts that the controls show up in the expected spot (0,208) instead of below the canvas (0,240). * css/mediaControlsChromium.css: 2011-02-15 Ryosuke Niwa Reviewed by Darin Adler. Extract a function to process ancestor and their sibling nodes from processContents https://bugs.webkit.org/show_bug.cgi?id=54425 Extracted processAncestorsAndTheirSiblings. * dom/Range.cpp: (WebCore::Range::processContents): Calls processContents. (WebCore::Range::processAncestorsAndTheirSiblings): Extracted from processContents. * dom/Range.h: 2011-02-15 Kent Tamura Reviewed by Darin Fisher. [Chromium] Rendering error of spin buttons on layers https://bugs.webkit.org/show_bug.cgi?id=54427 Test: fast/forms/input-appearance-spinbutton-layer.html * rendering/RenderThemeChromiumWin.cpp: Add checks for multiple ThemePainter instances. (WebCore::RenderThemeChromiumWin::paintInnerSpinButton): Avoid to create multiple ThemePainter instances. 2011-02-15 Chris Rogers Reviewed by Kenneth Russell. Fix race condition in JavaScriptAudioNode https://bugs.webkit.org/show_bug.cgi?id=54518 No new tests since audio API is not yet implemented. * webaudio/JavaScriptAudioNode.cpp: (WebCore::JavaScriptAudioNode::process): 2011-02-10 Jeremy Orlow Reviewed by Nate Chapin. Throwing in an IndexedDB error or success event should lead to the transaction aborting https://bugs.webkit.org/show_bug.cgi?id=54249 When an exception is thrown but not handled within an IDBRequests success/error event, we should abort the transaction. Test: storage/indexeddb/exception-in-event-aborts.html * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/JSEventTarget.cpp: (WebCore::toJS): * bindings/v8/V8AbstractEventListener.cpp: (WebCore::V8AbstractEventListener::invokeEventHandler): * dom/EventTarget.cpp: (WebCore::EventTarget::uncaughtExceptionInEventHandler): * dom/EventTarget.h: * storage/IDBRequest.cpp: (WebCore::IDBRequest::uncaughtExceptionInEventHandler): * storage/IDBRequest.h: 2011-02-15 Ian Henderson Reviewed by Darin Adler. To determine image properties, CG allocates memory which isn't included in CachedImage's decoded size https://bugs.webkit.org/show_bug.cgi?id=53281 When determining properties of an image (such as its size), CG ends up decoding part of the image. This patch adds accounting for this extra decoded size so a cache prune can clean up the allocations. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::BitmapImage): (WebCore::BitmapImage::destroyMetadataAndNotify): Clearing the source destroys the extra decoded data. Report this change in decoded size to the image observer. (WebCore::BitmapImage::cacheFrame): The first decoded frame subsumes the data decoded when determining image properties, so we subtract it out here. (WebCore::BitmapImage::didDecodeProperties): Reports the extra decoded size to the image's observer. (WebCore::BitmapImage::size): (WebCore::BitmapImage::currentFrameSize): (WebCore::BitmapImage::getHotSpot): (WebCore::BitmapImage::frameCount): (WebCore::BitmapImage::isSizeAvailable): (WebCore::BitmapImage::repetitionCount): * platform/graphics/BitmapImage.h: * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::bytesDecodedToDetermineProperties): The default value is 0 to match the current behavior on other platforms. * platform/graphics/ImageSource.h: * platform/graphics/cg/ImageSourceCG.cpp: (WebCore::ImageSource::bytesDecodedToDetermineProperties): Add a constant value for bytesDecodedToDetermineProperties(), measured by tracing malloc/calloc calls while asking an image source for its properties. 2011-02-15 James Robinson Reviewed by Alexey Proskuryakov. requestAnimationFrame callbacks should not fire within a modal dialog https://bugs.webkit.org/show_bug.cgi?id=53188 requestAnimationFrame callbacks shouldn't fire while a modal dialog is up (like a window.alert()). This matches Firefox and other async APIs. This patch moves the callback servicing into its own controller class which receives notifications on suspend/resume. Test: fast/animation/request-animation-frame-during-modal.html * WebCore.gypi: * bindings/js/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::setJavaScriptPaused): * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::suspendScriptedAnimationControllerCallbacks): (WebCore::Document::resumeScriptedAnimationControllerCallbacks): (WebCore::Document::webkitRequestAnimationFrame): (WebCore::Document::webkitCancelRequestAnimationFrame): (WebCore::Document::serviceScriptedAnimations): * dom/Document.h: * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::suspendScriptedAnimationControllerCallbacks): (WebCore::ScriptExecutionContext::resumeScriptedAnimationControllerCallbacks): * dom/ScriptedAnimationController.cpp: Added. (WebCore::ScriptedAnimationController::ScriptedAnimationController): (WebCore::ScriptedAnimationController::suspend): (WebCore::ScriptedAnimationController::resume): (WebCore::ScriptedAnimationController::registerCallback): (WebCore::ScriptedAnimationController::cancelCallback): (WebCore::ScriptedAnimationController::serviceScriptedAnimations): * dom/ScriptedAnimationController.h: Added. (WebCore::ScriptedAnimationController::create): * history/CachedFrame.cpp: (WebCore::CachedFrameBase::restore): (WebCore::CachedFrame::CachedFrame): * page/PageGroupLoadDeferrer.cpp: (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer): (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer): 2011-02-14 Jeremy Orlow Reviewed by Darin Fisher. Add initial support for per-origin quotas to IndexedDB https://bugs.webkit.org/show_bug.cgi?id=54421 Add support for non-persistent per-origin quotas. If one is specified, it overrides the default. No tests as this is only exposed via the Chromium webkit API. * storage/IDBFactoryBackendImpl.cpp: (WebCore::IDBFactoryBackendImpl::open): (WebCore::IDBFactoryBackendImpl::setQuota): * storage/IDBFactoryBackendImpl.h: * storage/IDBFactoryBackendInterface.h: 2011-02-15 Adam Barth Reviewed by Darin Adler. XSLT with output method HTML and images crashes in debug mode https://bugs.webkit.org/show_bug.cgi?id=54462 http://trac.webkit.org/changeset/75577 created Document::setContent but didn't notice that the code paths combined into Document::setContent were subtly different. In particular, some of the code paths called parser->finish() whereas other did not. The difference is that an explicit call to parser->finish() is required in the case where there is no frame because explicitClose doesn't call endIfNotLoadingMainResource if there is no frame. This patch moves that logic inside explicitClose, which is more natural. This patch also removes removeAllChildren, which has not effect in this situation and should never have been added in the first place. Test: fast/parser/xslt-with-html.xml * dom/Document.cpp: (WebCore::Document::setContent): (WebCore::Document::explicitClose): 2011-02-15 Oliver Hunt Fix EFL build for https://bugs.webkit.org/show_bug.cgi?id=54415 * CMakeLists.txt: 2011-02-15 David Kilzer Minor header clean up in RenderLayerBacking.cpp Reviewed by Darin Adler. * rendering/RenderLayerBacking.cpp: Remove unused WebGLRenderingContext.h header, and move GraphicsContext3D.h into a #if ENABLE(WEBGL) || ENABLE(ACCELERATED_2D_CANVAS)/#endif block. 2011-02-14 Oliver Hunt Reviewed by Gavin Barraclough and Geoff Garen. Refactor handles and weak pointers to become nicer and more automatic https://bugs.webkit.org/show_bug.cgi?id=54415 Update WebCore to use the new Global<> type rather than ProtectedJSValue and gc[Un]Protect. Also update to use new WeakGCPtr APIs, and remove now unnecessary destructors. * ForwardingHeaders/collector/handles/Global.h: Added. * WebCore.vcproj/WebCore.vcproj: * WebCore.vcproj/copyForwardingHeaders.cmd: * bindings/js/JSCallbackData.h: (WebCore::JSCallbackData::JSCallbackData): * bindings/js/JSCustomVoidCallback.h: * bindings/js/JSDOMBinding.cpp: (WebCore::forgetDOMNode): (WebCore::cacheDOMNodeWrapper): * bindings/js/JSDOMWindowBase.h: * bindings/js/JSDOMWindowShell.cpp: (WebCore::JSDOMWindowShell::setWindow): * bindings/js/JSDataGridDataSource.h: * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::JSEventListener): * bindings/js/JSEventListener.h: (WebCore::JSEventListener::setWrapper): * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::initializeJSFunction): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::ScheduledAction): (WebCore::ScheduledAction::executeFunctionInContext): * bindings/js/ScheduledAction.h: (WebCore::ScheduledAction::ScheduledAction): * bindings/js/ScriptCachedFrameData.cpp: (WebCore::ScriptCachedFrameData::ScriptCachedFrameData): (WebCore::ScriptCachedFrameData::restore): * bindings/js/ScriptCachedFrameData.h: * bindings/js/ScriptCallStackFactory.cpp: (WebCore::createScriptArguments): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::createWindowShell): (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::clearWindowShell): (WebCore::ScriptController::attachDebugger): * bindings/js/ScriptController.h: * bindings/js/ScriptFunctionCall.cpp: (WebCore::ScriptFunctionCall::call): (WebCore::ScriptCallback::call): * bindings/js/ScriptObject.cpp: (WebCore::ScriptObject::ScriptObject): * bindings/js/ScriptObject.h: * bindings/js/ScriptState.cpp: (WebCore::ScriptStateProtectedPtr::ScriptStateProtectedPtr): (WebCore::ScriptStateProtectedPtr::get): * bindings/js/ScriptState.h: * bindings/js/ScriptValue.cpp: (WebCore::ScriptValue::isFunction): (WebCore::ScriptValue::deserialize): * bindings/js/ScriptValue.h: (WebCore::ScriptValue::ScriptValue): (WebCore::ScriptValue::hasNoValue): * bindings/js/ScriptWrappable.h: (WebCore::ScriptWrappable::ScriptWrappable): (WebCore::ScriptWrappable::setWrapper): * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::WorkerScriptController): (WebCore::WorkerScriptController::~WorkerScriptController): (WebCore::WorkerScriptController::initScript): (WebCore::WorkerScriptController::evaluate): * bindings/js/WorkerScriptController.h: (WebCore::WorkerScriptController::workerContextWrapper): * bindings/scripts/CodeGeneratorJS.pm: * bridge/NP_jsobject.cpp: (_NPN_InvokeDefault): (_NPN_Invoke): (_NPN_Evaluate): (_NPN_Construct): * bridge/jsc/BridgeJSC.cpp: (JSC::Bindings::Instance::Instance): (JSC::Bindings::Instance::~Instance): (JSC::Bindings::Instance::willDestroyRuntimeObject): (JSC::Bindings::Instance::willInvalidateRuntimeObject): * bridge/jsc/BridgeJSC.h: * bridge/runtime_object.cpp: (JSC::Bindings::RuntimeObject::invalidate): * bridge/runtime_root.cpp: (JSC::Bindings::RootObject::RootObject): (JSC::Bindings::RootObject::invalidate): (JSC::Bindings::RootObject::globalObject): (JSC::Bindings::RootObject::updateGlobalObject): * bridge/runtime_root.h: * dom/EventListener.h: * dom/EventTarget.h: (WebCore::EventTarget::markJSEventListeners): * xml/XMLHttpRequest.cpp: Qt bindings courtesy of Csaba Osztrogonác * bridge/qt/qt_runtime.cpp: (JSC::Bindings::QtRuntimeConnectionMethod::call): (JSC::Bindings::QtConnectionObject::QtConnectionObject): (JSC::Bindings::QtConnectionObject::execute): (JSC::Bindings::QtConnectionObject::match): * bridge/qt/qt_runtime.h: 2011-02-15 Jia Pu Reviewed by Darin Adler. Autocorrection should respect undo. https://bugs.webkit.org/show_bug.cgi?id=52221 Manual test: manual-tests/autocorrection/undo-autocorrection.html When user undoes an autocorrection, we need to do four things: 1. Revert the change in text that has been made by correction. 2. Revert the selection to pre-correction state so that user can immediately continue typing. 3. Add appropriate markers to reverted text so that it won't be corrected again and/or shown as misspelled. 4. If applicable, notify spell checking service to record this reversion. To achieve these, this patch introduces following changes: 1. Created SpellingCorrectionCommand so that correction can be undone in similar way as any other editing command. SpellingCorrectionCommand is a composition of SetSelectionCommand, SpellingCorrectionRecordUndoCommand and ReplaceSelectionCommand. 2. Created SetSelectionCommand so that undo command can restore selection state. 3. Added member function recordAutocorrectionResponse() to editor client. To improve readability, this patch also consolidates various boolean arguments in SelectionController::setSelection() and ReplaceSelectionCommand::ReplaceSelectionCommand(). These boolean arguments have been replaced by enum variable. * WebCore.exp.in: Updated for changes in Editor and ReplaceSelectionCommand. * WebCore.xcodeproj/project.pbxproj: Updated for new source files. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): Adopted new signature of ReplaceSelectionCommand::create(). * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): Ditto. (WebCore::Editor::unappliedEditing): Cleaned up trailing whitespace. (WebCore::Editor::reappliedEditing): Ditto. (WebCore::Editor::selectComposition): Adopted new signature of SelectionController::setSelection(). (WebCore::Editor::confirmComposition): Ditto. (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Rearranged code to reduce the level of deeply nested if statement. Adopted SpellingCorrectionCommand. (WebCore::Editor::applyCorrectionPanelInfo): Adopted SpellingCorrectionCommand. (WebCore::Editor::unappliedSpellCorrection): Function for adding markers to reverted text and for notifiying editor client about undone correction. (WebCore::Editor::changeSelectionAfterCommand): Adopted new signature of SelectionController::setSelection(). (WebCore::Editor::respondToChangedSelection): Use SelectionController::SetSelectionOptions instead of boolean variables. * editing/Editor.h: Added Editor::unappliedSpellCorrection(). * editing/EditorCommand.cpp: (WebCore::executeInsertFragment): Adopted new signature of ReplaceSelectionCommand::create(). * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): Ditto. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand): Replaced all boolean arguments with an enum value. * editing/ReplaceSelectionCommand.h: (WebCore::ReplaceSelectionCommand::create): Ditto. * editing/SelectionController.cpp: Adopted new signature of SelectionController::setSelection(). (WebCore::SelectionController::moveTo): (WebCore::SelectionController::setSelection): (WebCore::SelectionController::respondToNodeModification): (WebCore::SelectionController::setBase): (WebCore::SelectionController::setExtent): (WebCore::SelectionController::setSelectedRange): * editing/SelectionController.h: (WebCore::SelectionController::setSelection): Replaced all boolean arguments with an enum value. * editing/SetSelectionCommand.cpp: Added. (WebCore::SetSelectionCommand::SetSelectionCommand): (WebCore::SetSelectionCommand::doApply): (WebCore::SetSelectionCommand::doUnapply): * editing/SetSelectionCommand.h: Added. (WebCore::SetSelectionCommand::create): * editing/mac/SpellingCorrectionCommand.cpp: Added. (WebCore::SpellingCorrectionRecordUndoCommand::create): (WebCore::SpellingCorrectionRecordUndoCommand::SpellingCorrectionRecordUndoCommand): (WebCore::SpellingCorrectionRecordUndoCommand::doApply): (WebCore::SpellingCorrectionRecordUndoCommand::doUnapply): (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand): (WebCore::SpellingCorrectionCommand::doApply): * editing/mac/SpellingCorrectionCommand.h: Added. (WebCore::SpellingCorrectionCommand::create): * loader/EmptyClients.h: Updated for the new function declared in EditorClient. (WebCore::EmptyEditorClient::recordAutocorrectionResponse): * manual-tests/autocorrection/undo-autocorrection.html: Added. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): Adopted new signature of ReplaceSelectionCommand::create(). * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): Ditto. * page/EditorClient.h: Added EditorClient::recordAutocorrectionResponse(). 2011-02-15 Beth Dakin Reviewed by Darin Adler. Speculative fix for CrashTracer: [USER] 8 crashes in WebProcess calling setOverlayScrollerState:forceImmediately: My best guess is that this is crashing because willRemoveVerticalScrollbar()/Horizontal was not being called properly from the RenderLayer destructor. Call willRemoveVerticalScrollbar()/Horizontal from destroyScrollbar() so that all current and future scrollbar-destroyers will properly call this function. And only do it for native scrollers. (WebCore::RenderLayer::destroyScrollbar): (WebCore::RenderListBox::destroyScrollbar): For consistency's sake, I also moved didAddVerticalScrollbar() /Horizontal to createScrollbar(). Again, only call for native scrollers. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::createScrollbar): (WebCore::RenderListBox::createScrollbar): These functions no longer call didAdd/willRemove. (WebCore::RenderLayer::setHasHorizontalScrollbar): (WebCore::RenderLayer::setHasVerticalScrollbar): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::setHasVerticalScrollbar): Remove unnecessary ScrollableArea::-prefix * platform/ScrollView.cpp: (WebCore::ScrollView::setHasHorizontalScrollbar): (WebCore::ScrollView::setHasVerticalScrollbar): 2011-02-15 Joseph Pecoraro Reviewed by David Kilzer. Cleanup Some Potential ENABLE(INSPECTOR) Related Building Issues https://bugs.webkit.org/show_bug.cgi?id=54048 * WebCore.exp.in: moved inspector only export into ENABLE(INSPECTOR) block. * bindings/js/ScriptHeapSnapshot.h: include no longer needed. 2011-02-15 Stephen White Reviewed by James Robinson. [chromium] clearRect() is incorrect in accelerated 2D canvas. https://bugs.webkit.org/show_bug.cgi?id=54497 When doing GPU-Canvas2D clearRect() using the fast path (glClear()), we were not correctly converting from canvas to screen coordinates. Fixed by inverting the rectangle in Y, and changing SharedGraphicsContext3D::scissor to take glScissor-like parameters. Covered by fast/canvas/canvas-strokeRect.html. * platform/graphics/chromium/GLES2Canvas.cpp: (WebCore::GLES2Canvas::clearRect): Flip the Y coord of the rectangle passed to scissor(). * platform/graphics/gpu/SharedGraphicsContext3D.cpp: (WebCore::SharedGraphicsContext3D::scissor): * platform/graphics/gpu/SharedGraphicsContext3D.h: Give scissor() the same param types as GraphicsContext3D::scissor(). 2011-02-15 Pratik Solanki Move WTF_USE_CFNETWORK to Platform.h https://bugs.webkit.org/show_bug.cgi?id=54168 Reviewed by Darin Adler. * config.h: Remove WTF_USE_CFNETWORK. 2011-02-15 Kenneth Russell Reviewed by Darin Fisher. Allow controlling minimum DOMTimer interval on a per-page basis https://bugs.webkit.org/show_bug.cgi?id=54312 Renamed DOMTimer::minTimerInterval and setMinTimerInterval to defaultMinTimerInterval and setDefaultMinTimerInterval, made them private and exposed them via Settings::defaultMinDOMTimerInterval and setDefaultMinDOMTimerInterval. Added new Settings::setMinDOMTimerInterval and minDOMTimerInterval. The storage for the minimum timer interval currently lives in the Page, though this could be moved to the Settings object if desired. The accessor methods on the Page are private and exposed to Settings by making Settings a friend, so the abstraction barrier is clear at the API level. Adjusting the interval both upward and downward may cause the fire times of the active timers on the page to be adjusted, if they would be affected by the clamping value. This is needed to reduce latency when bringing a tab to the foreground, in particular if the minimum timer interval was decreased from a very high value to a very low value. A new method, setMinimumTimerInterval, has been added to LayoutTestController, implemented in all ports of DumpRenderTree, and used in new layout tests. Ideally changing the page's minimum timer interval would affect dedicated workers, but this is too much to do in an initial patch, so a FIXME has been added. Tested with: - The new layout tests on the WebKit Mac and Chromium (Mac, Linux) DRT ports. - Hooked up the new API in Chromium and ran some simple manual tests. Tests: fast/dom/timer-increase-min-interval-and-reset-part-1.html fast/dom/timer-increase-min-interval-and-reset-part-2.html fast/dom/timer-increase-min-interval.html fast/dom/timer-increase-then-decrease-min-interval.html * WebCore.exp.in: * dom/Document.cpp: (WebCore::Document::minimumTimerInterval): * dom/Document.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval): (WebCore::ScriptExecutionContext::minimumTimerInterval): * dom/ScriptExecutionContext.h: * page/DOMTimer.cpp: (WebCore::DOMTimer::DOMTimer): (WebCore::DOMTimer::fired): (WebCore::DOMTimer::adjustMinimumTimerInterval): (WebCore::DOMTimer::intervalClampedToMinimum): * page/DOMTimer.h: (WebCore::DOMTimer::defaultMinTimerInterval): (WebCore::DOMTimer::setDefaultMinTimerInterval): * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::setMinimumTimerInterval): (WebCore::Page::minimumTimerInterval): * page/Page.h: * page/Settings.cpp: (WebCore::Settings::setDefaultMinDOMTimerInterval): (WebCore::Settings::defaultMinDOMTimerInterval): (WebCore::Settings::setMinDOMTimerInterval): (WebCore::Settings::minDOMTimerInterval): * page/Settings.h: * platform/Timer.h: (WebCore::TimerBase::augmentFireInterval): (WebCore::TimerBase::augmentRepeatInterval): 2011-02-15 Simon Fraser Reviewed by Beth Dakin. Fix scrollbar rendering crash when rendered into a layer https://bugs.webkit.org/show_bug.cgi?id=54494 Remove code added in r78394 which was intended to find out whether a scrollbar was being rendered into a compositing layer. r78612 obviated the need for this code. * page/FrameView.h: * platform/ScrollableArea.h: * rendering/RenderLayer.cpp: * rendering/RenderLayer.h: * rendering/RenderListBox.cpp: * rendering/RenderListBox.h: 2011-02-15 Simon Fraser Let Xcode have its way with the project. * WebCore.xcodeproj/project.pbxproj: 2011-02-15 Simon Fraser Fix Mac builds that don't use rubber-band scrolling by moving m_drawingIntoLayer out of the #ifdef. * platform/mac/ScrollAnimatorMac.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): 2011-02-15 Martin Robinson Reviewed by Xan Lopez. [Freetype] Better map CSS font weight to Fontconfig font weight https://bugs.webkit.org/show_bug.cgi?id=54323 * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::fontWeightToFontconfigWeight): Added this helper to map between CSS and Fontconfig font weights. (WebCore::FontCache::createFontPlatformData): Use the new helper instead of just deciding between bold and regular. 2011-02-15 Simon Fraser Reviewed by Sam Weinig. Fix scrollbar rendering crash when rendered into a layer https://bugs.webkit.org/show_bug.cgi?id=54494 The scroller delegate was failing to return a layer in a case where the scroller was still rendering into a GraphicsLayer, because even though WebCore had switched out of compositing mode, the DrawingAreaImpl was still rendering into its nonCompositedContent layer. This happens when the m_exitCompositingTimer timer hasn't fired yet. The fix is to track whether we're drawing into a layer via the GraphicsContext, rather than asking about compositing layers. * platform/graphics/GraphicsContext.h: * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::setIsCALayerContext): (WebCore::GraphicsContext::isCALayerContext): Getter and setter for the bit that says if we're rendering into a CALayer. * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h: (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): Store a bool for whether this context targets a layer. * platform/graphics/mac/WebLayer.mm: (drawLayerContents): Call setIsCALayerContext(true). * platform/mac/ScrollAnimatorMac.h: (WebCore::ScrollAnimatorMac::setIsDrawingIntoLayer): (WebCore::ScrollAnimatorMac::isDrawingIntoLayer): New methods to get and set a flag that says when we're drawing into a layer, so that the delegate can get at this state. * platform/mac/ScrollAnimatorMac.mm: (-[ScrollbarPainterDelegate layer]): Use isDrawingIntoLayer() (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Init the flag. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::unregisterScrollbar): Whitespace. (WebCore::ScrollbarThemeMac::paint): Push the "isDrawingIntoLayer" state down onto ScrollAnimatorMac, getting it from the GraphicsContext. 2011-02-15 Anders Carlsson Reviewed by Darin Adler. Add NPP_GetSitesWithData and NPP_URLRedirectNotify to the NPAPI headers https://bugs.webkit.org/show_bug.cgi?id=54481 We should really sync all headers with the NPAPI repository, but doing that lead to build errors so I just added what was needed. * bridge/npapi.h: Add new functions. * bridge/nptypes.h: Sync with the official NPAPI repository, adding 64-bit integer types and removing a duplicate license header. * plugins/npfunctions.h: Add new functions. 2011-02-15 Antti Koivisto Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=54486 Crashes under CachedResourceLoader::revalidateResource CachedResourceLoader might get deleted from under one of its methods. Try to catch a more informative crash stack. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::CachedResourceLoader): (WebCore::CachedResourceLoader::~CachedResourceLoader): (WebCore::CachedResourceLoader::requestImage): (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::setAutoLoadImages): (WebCore::CachedResourceLoader::load): (WebCore::CachedResourceLoader::loadDone): (WebCore::CachedResourceLoader::preload): (WebCore::CachedResourceLoader::requestPreload): * loader/cache/CachedResourceLoader.h: 2011-02-15 Andreas Kling Reviewed by Darin Adler. Optimize Color::serialized() https://bugs.webkit.org/show_bug.cgi?id=54452 Apply the optimizations from CSSPrimitiveValue::cssText() [CSS_RGBCOLOR] to Color::serialized() - build the serialized color strings manually instead of using String::format(). * platform/graphics/Color.cpp: (WebCore::appendHexNumber): (WebCore::Color::serialized): 2011-02-15 Jarred Nicholls Reviewed by Alexey Proskuryakov. XMLHttpRequest::abort() doesn't clear response data https://bugs.webkit.org/show_bug.cgi?id=54118 Properly clear all buffer data on abort, so no memory hangs around unnecessarily. No new tests because there is no observable effect except for less memory used. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::abort): 2011-02-15 Andreas Kling Reviewed by Darin Adler. Rename Color::name() to Color::nameForRenderTreeAsText() https://bugs.webkit.org/show_bug.cgi?id=54464 Color::name() returns the color as either #RRGGBB or #RRGGBBAA. Since the latter is not a valid CSS color, it can't be re-parsed by WebKit, and should only be used in DRT dumps. * editing/ApplyStyleCommand.cpp: (WebCore::StyleChange::extractTextStyles): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * platform/graphics/Color.cpp: (WebCore::Color::nameForRenderTreeAsText): * platform/graphics/Color.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties): * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::externalRepresentation): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::operator<<): (WebCore::writeRenderSVGTextBox): * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::applyResultsToTarget): * svg/SVGColor.cpp: (WebCore::SVGColor::cssText): 2011-02-15 Andras Becsi Rubber-stamped by Andreas Kling. [Qt] Typo fix. No new tests needed. * WebCore.pro: add missing ASCII to header name. 2011-02-15 Pavel Feldman Reviewed by Yury Semikhatsky. Web Inspector: test whether inspector gets populated with databases and storages upon opening. https://bugs.webkit.org/show_bug.cgi?id=54469 Tests: http/tests/inspector-enabled/database-open.html http/tests/inspector-enabled/dom-storage-open.html * inspector/front-end/DOMStorage.js: * inspector/front-end/Database.js: (WebInspector.DatabaseDispatcher.prototype.addDatabase): 2011-02-15 Andreas Kling Reviewed by Darin Adler. Share the helper functions used by Latin-1 and UTF-8 text codecs https://bugs.webkit.org/show_bug.cgi?id=54446 Move MachineWord, UCharByteFiller and the other helper functions into TextCodecASCIIFastPath.h where they can be used by both TextCodecUTF8 and TextCodecLatin1. * GNUmakefile.am: * WebCore.gypi: * WebCore.pro: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * platform/text/TextCodecASCIIFastPath.h: Added. (WebCore::isAllASCII): (WebCore::copyASCIIMachineWord): (WebCore::isAlignedToMachineWord): (WebCore::alignToMachineWord): * platform/text/TextCodecLatin1.cpp: (WebCore::TextCodecLatin1::decode): * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::decode): 2011-02-15 Leo Yang Reviewed by Kent Tamura. Code style issue in WebCore/dom/InputElement.cpp https://bugs.webkit.org/show_bug.cgi?id=54428 Remove 2 extra spaces in InputElement.cpp line 221. Code style fix, No new tests. * dom/InputElement.cpp: (WebCore::InputElement::handleBeforeTextInsertedEvent): 2011-02-15 Philippe Normand Reviewed by Martin Robinson. [GStreamer] Video player sets system volume to 100% https://bugs.webkit.org/show_bug.cgi?id=54140 Don't explicitely set volume at startup and use the GstStreamVolume interface with cubic volume scale when updating/retrieving the volume value. This gives a much better user-experience. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): 2011-02-15 Adam Barth Reviewed by Eric Seidel. Sketch script-src for Content Security Policy https://bugs.webkit.org/show_bug.cgi?id=54381 This patch provides a sketch of the script-src directive. We still do not parse the value of the directive, and the wiring into the rest of WebCore is incorrect, but those are things we can fix in future patches. For the momemnt, this patch lets us test what we're doing. Test: http/tests/security/contentSecurityPolicy/script-loads-with-img-src.html * page/ContentSecurityPolicy.cpp: (WebCore::CSPDirective::CSPDirective): (WebCore::CSPDirective::allows): (WebCore::ContentSecurityPolicy::didReceiveHeader): (WebCore::ContentSecurityPolicy::canLoadExternalScriptFromSrc): (WebCore::ContentSecurityPolicy::parse): (WebCore::ContentSecurityPolicy::emitDirective): * page/ContentSecurityPolicy.h: 2011-02-15 Antti Koivisto Reviewed by Andreas Kling. svg/custom/use-css-no-effect-on-shadow-tree.svg produces empty image on Chromium Linux after r58556 https://bugs.webkit.org/show_bug.cgi?id=54460 Don't use fast path for SVG. There are some additional rules for shadow trees that are not implemented on fast path. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::checkSelector): 2011-02-15 Andras Becsi Reviewed by Csaba Osztrogonác. [Qt] Redesign the build system https://bugs.webkit.org/show_bug.cgi?id=51339 Part 1. Introduce CodeGenerators.pri and add common includepaths to WebCore.pri, thus unnecessary duplications can be removed from project files. No new tests needed. * CodeGenerators.pri: Copied from Source/WebCore/WebCore.pri. Don't add non-source generated files to SOURCES. * DerivedSources.pro: Change WebCore.pri to CodeGenerators.pri. * WebCore.pri: Move code generation rules to CodeGenerators.pri. * WebCore.pro: Move common options to WebCore.pri. 2011-02-15 Charlie Reis Reviewed by Mihai Parparita. Crash in WebCore::FrameLoader::continueLoadAfterNavigationPolicy https://bugs.webkit.org/show_bug.cgi?id=54219 Ensures we do not start a new navigation while we are in the process of stopping a navigation. Also adds a manual test, since the crash can only be reproduced using the back button and not history.back(). * loader/FrameLoader.cpp: * manual-tests/navigation-during-onload-triggered-by-back.html: Added. * manual-tests/resources/navigation-during-onload-container.html: Added. 2011-02-15 Bill Budge Reviewed by David Levin. SubresourceLoader should expose finish time https://bugs.webkit.org/show_bug.cgi?id=54287 No tests needed, exposes no new functionality * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::didFinishLoading): * loader/DocumentThreadableLoader.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didFinishLoading): * loader/SubresourceLoaderClient.h: (WebCore::SubresourceLoaderClient::didFinishLoading): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::didFinishLoading): * loader/cache/CachedResourceRequest.h: * loader/icon/IconLoader.cpp: (WebCore::IconLoader::didFinishLoading): * loader/icon/IconLoader.h: 2011-02-15 Antti Koivisto Reviewed by Darin Adler. Enable fast path selector checking for child and subselector combinators https://bugs.webkit.org/show_bug.cgi?id=54360 * css/CSSStyleSelector.cpp: (WebCore::isFastCheckableSelector): (WebCore::fastCheckSingleSelector): (WebCore::checkClassValue): (WebCore::checkIdValue): (WebCore::checkTagValue): (WebCore::CSSStyleSelector::SelectorChecker::fastCheckSelector): 2011-02-15 Yury Semikhatsky Reviewed by Pavel Feldman. Web Inspector: console auto-scroll is broken when there are both scrollers. https://bugs.webkit.org/show_bug.cgi?id=54273 * inspector/front-end/utilities.js: (Element.prototype.isScrolledToBottom): use clientHeight instead of offsetHeight to determine whether the element is scrolled to the bottom. 2011-02-14 Alexander Pavlov Reviewed by Yury Semikhatsky. Web Inspector: highlighter works incorrect at build.chromium.org WebKit cells https://bugs.webkit.org/show_bug.cgi?id=53910 Use enclosingBoundingBox for the absolute margin quad as the reference box for a tooltip. * inspector/InspectorAgent.cpp: (WebCore::InspectorAgent::drawNodeHighlight): 2011-02-15 Dirk Schulze Rubber-stamped by Nikolas Zimmermann. SVG animation doesn't support attribute value 'inherit' https://bugs.webkit.org/show_bug.cgi?id=54410 Accidently replaced start value RegularPropertyValue for m_fromPropertyValueType and m_toPropertyValueType by CurrentColorValue before landing. Check for property value type 'inherit' on color validation was missing. * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::calculateFromAndToValues): (WebCore::SVGAnimateElement::calculateFromAndByValues): 2011-02-15 Adam Roben Windows build fix after r78533 * WebCore.vcproj/WebCore.vcproj: Fix bad XML syntax. 2011-02-15 Gavin Peters Reviewed by Antti Koivisto. SharedBuffer::buffer() does not do what you think. https://bugs.webkit.org/show_bug.cgi?id=54420 No new tests. * inspector/InspectorResourceAgent.cpp: (WebCore::InspectorResourceAgent::resourceContentBase64): * platform/SharedBuffer.h: * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageReader::decode): (WebCore::JPEGImageDecoder::decode): * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::decode): 2011-02-15 Dirk Schulze Reviewed by Nikolas Zimmermann. SVG animation doesn't support attribute value 'inherit' https://bugs.webkit.org/show_bug.cgi?id=54410 SVG animation does not support 'inherit' as value for CSS property animations. With the patch, SVG determines if the attribute of the target element is an animatable CSS Property and computes the style during the animation. This fixes the following tests on the W3C test suite: * animate-elem-84-t.svg * animate-elem-85-t.svg Tests: svg/animations/animate-currentColor.html svg/animations/animate-inherit-css-property.html * svg/SVGAnimateElement.cpp: (WebCore::adjustForCurrentColor): (WebCore::adjustForInheritance): (WebCore::SVGAnimateElement::calculateAnimatedValue): When a property value is 'inherit' or 'currentColor' during the animation, get the computed style of the property since the values could be animated themselves. (WebCore::inheritsFromProperty): (WebCore::attributeValueIsCurrentColor): (WebCore::SVGAnimateElement::calculateFromAndToValues): Check if 'from', 'by' or 'to' value has the string 'inherit' or 'currentColor' and if the attribute supports one of these values. (WebCore::SVGAnimateElement::calculateFromAndByValues): Ditto. * svg/SVGAnimateElement.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): Check if target element is stylable and the attribute is an animatable CSS property by using the CSS property map in SVGStyledElement. (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue): s/target/targetElement/ for consistency. * svg/SVGAnimationElement.h: * svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::isAnimatableCSSProperty): Checks if the CSS property is animatable. * svg/SVGStyledElement.h: * svg/animation/SMILTimeContainer.cpp: Use the new function isTargetAttributeCSSProperty to determine if the target element is stylable and the attribute is an animatable CSS property. (WebCore::SMILTimeContainer::baseValueFor): 2011-02-15 Antti Koivisto Reviewed by Andreas Kling. r78499 causes assertion failure in http/tests/xmlhttprequest/cache-override.html https://bugs.webkit.org/show_bug.cgi?id=54418 Check for zero buffer length. * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::decode): 2011-02-15 MORITA Hajime Unreviewed build fix. * page/EditorClient.h: Changed GrammarDetail forward declaration from class to struct. 2011-01-26 MORITA Hajime Reviewed by Ryosuke Niwa. Refactoring: Extract TextCheckerClient from EditorClient https://bugs.webkit.org/show_bug.cgi?id=53213 Created new abstract class TextCheckerClient. The class has spellcheck related API which is split. This is the first step for sharing spell-checking codebase between ports. A standalone TextCheckerClient implementation should be done in future changes. No new tests. No behavioral change. * GNUmakefile.am: * WebCore.gypi: * WebCore.pro: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * accessibility/mac/AccessibilityObjectWrapper.mm: (AXAttributeStringSetSpelling): * editing/Editor.cpp: Replacing some client() call with textChecker(). (WebCore::Editor::textChecker): Added. (WebCore::Editor::ignoreSpelling): (WebCore::Editor::learnSpelling): (WebCore::Editor::isSelectionMisspelled): (WebCore::Editor::guessesForMisspelledSelection): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): (WebCore::Editor::correctionPanelTimerFired): * editing/Editor.h: * editing/SpellChecker.cpp: (WebCore::SpellChecker::SpellChecker): * editing/TextCheckingHelper.cpp: Replacing some client() call with textChecker(). (WebCore::TextCheckingHelper::findFirstMisspelling): (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::findFirstBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange): * loader/EmptyClients.h: Added EmptyTextCheckerClient. (WebCore::EmptyTextCheckerClient::ignoreWordInSpellDocument): (WebCore::EmptyTextCheckerClient::learnWord): (WebCore::EmptyTextCheckerClient::checkSpellingOfString): (WebCore::EmptyTextCheckerClient::getAutoCorrectSuggestionForMisspelledWord): (WebCore::EmptyTextCheckerClient::checkGrammarOfString): (WebCore::EmptyTextCheckerClient::checkTextOfParagraph): (WebCore::EmptyTextCheckerClient::getGuessesForWord): (WebCore::EmptyTextCheckerClient::requestCheckingOfString): (WebCore::EmptyEditorClient::textChecker): * page/EditorClient.h: Extracted TextCheckerClient. * page/Page.h: * platform/text/TextCheckerClient.h: Added. (WebCore::TextCheckerClient::~TextCheckerClient): 2011-02-07 Ryosuke Niwa Reviewed by Adam Barth. Add EditorClient callbacks to override isDOMPasteAllowed and javaScriptCanAccessClipboard https://bugs.webkit.org/show_bug.cgi?id=52417 Added two callback functions, canCopyCut and canPaste to EditorClient. These functions returns true iff the current frame should be able to copy/cut and paste respectively. They take the default value determined by isDOMPasteAllowed and javaScriptCanAccessClipboard. These callbacks allows embedders to decide whether or not copy/cut/paste should be enabled per frame and thus per origin rather than per page. No new tests are added since this is a WebKit/WebCore interface change. * editing/EditorCommand.cpp: (WebCore::supportedCopyCut): Calls canCopyCut. (WebCore::supportedPaste): Calls canPaste. * loader/EmptyClients.h: (WebCore::EmptyEditorClient::canCopyCut): Added. (WebCore::EmptyEditorClient::canPaste): Added. * page/EditorClient.h: 2011-02-14 Jeremy Orlow efl build fix * CMakeLists.txt: 2011-02-11 Jeremy Orlow Reviewed by Nate Chapin. Finish up implementing the new event model in IndexedDB https://bugs.webkit.org/show_bug.cgi?id=54331 We shouldn't have our own event subclasses. Instead, we should just fire Event's with the proper type and bubble settings. All the attributes on the events before should just be on the request. IDBRequest should throw if they're accessed before the success event fires. * WebCore.gypi: * bindings/generic/RuntimeEnabledFeatures.h: * bindings/js/JSEventCustom.cpp: (WebCore::toJS): * bindings/v8/custom/V8EventCustom.cpp: (WebCore::toV8): * dom/Event.cpp: * dom/Event.h: * page/DOMWindow.idl: * storage/IDBAbortEvent.h: Removed. * storage/IDBCompleteEvent.cpp: Removed. * storage/IDBCompleteEvent.h: Removed. * storage/IDBDatabase.cpp: (WebCore::IDBDatabase::~IDBDatabase): * storage/IDBDatabaseException.h: * storage/IDBDatabaseException.idl: * storage/IDBErrorEvent.cpp: Removed. * storage/IDBErrorEvent.h: Removed. * storage/IDBErrorEvent.idl: Removed. * storage/IDBEvent.h: Removed. * storage/IDBEvent.idl: Removed. * storage/IDBEventDispatcher.cpp: (WebCore::IDBEventDispatcher::dispatch): * storage/IDBRequest.cpp: (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::result): (WebCore::IDBRequest::errorCode): (WebCore::IDBRequest::webkitErrorMessage): (WebCore::IDBRequest::source): (WebCore::IDBRequest::transaction): (WebCore::IDBRequest::readyState): (WebCore::IDBRequest::resetReadyState): (WebCore::IDBRequest::onError): (WebCore::createSuccessEvent): (WebCore::IDBRequest::onSuccess): (WebCore::IDBRequest::dispatchEvent): * storage/IDBRequest.h: * storage/IDBRequest.idl: * storage/IDBSuccessEvent.cpp: Removed. * storage/IDBSuccessEvent.h: Removed. * storage/IDBSuccessEvent.idl: Removed. * storage/IDBTransaction.cpp: (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::onComplete): (WebCore::IDBTransaction::dispatchEvent): 2011-02-14 Enrica Casucci Copy/paste from a WebKit window to a TextEdit window loses fonts. https://bugs.webkit.org/show_bug.cgi?id=54416 Reviewed by Dan Bernstein. We don't have the complete solution that fixes this problem for WebKit2 yet. This patch fixes the regression in WebKit. * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::writeSelection): For WebKit2 use only plain text, for WebKit use the original API to create the NSAttributedString. 2011-02-14 Levi Weintraub Reviewed by Alexey Proskuryakov. Strikethrough disappears when posting a message on odnoklassniki.ru https://bugs.webkit.org/show_bug.cgi?id=53475 Changing the behavior of the strikethrough execCommand when styleWithCSS is false. We formerly created tags, which was different than both IE and FF and caused problems with some rich text editors that would strip out unexpected tags such as . Test: editing/execCommand/strikethrough-uses-strike-tag.html * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): 2011-02-14 Pratik Solanki Remove dead code in FormDataStreamCFNet.cpp https://bugs.webkit.org/show_bug.cgi?id=54401 Reviewed by Darin Adler. The static functions in this file are no longer reachable. We added a conditional branch to use new CFNetwork functions in r30329 and later made that code path permanent in r41517 which made these functions unreachable. * platform/network/cf/FormDataStreamCFNet.cpp: 2011-02-14 Andreas Kling Reviewed by Darin Adler. GraphicsContext: Add clip(IntRect) overload for Qt https://bugs.webkit.org/show_bug.cgi?id=54365 Qt has special code paths for clipping to integer rectangles. Add a GraphicsContext::clip() overload to allow us to take advantage of the optimized code. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::clip): * platform/graphics/GraphicsContext.h: * platform/graphics/qt/GraphicsContextQt.cpp: (WebCore::GraphicsContext::clip): 2011-02-14 Darin Adler Reviewed by Alexey Proskuryakov. Add built-in decoder for UTF-8 for improved performance https://bugs.webkit.org/show_bug.cgi?id=53898 Covered by existing tests; not adding new tests at this time. This patch now handles errors in the same way the existing codecs do, and so passes our tests. The first version failed some tests because of incorrect error handling. The second version was missing one line of code that made it decode incomplete sequences at the end of the buffer twice. * platform/text/TextCodecICU.cpp: (WebCore::create): Renamed from newTextCodecICU, made a static member function, and added a call to adoptPtr. (WebCore::TextCodecICU::registerEncodingNames): Renamed from registerExtendedEncodingNames since this class is no longer used for base codecs. Removed aliases for UTF-8; now handled by TextCodecUTF8. (WebCore::TextCodecICU::registerCodecs): Renamed. (WebCore::fallbackForGBK): Renamed to conform to our current style. * platform/text/TextCodecICU.h: Updated for above changes. Changed indentation. Made most functions private, including virtual function overrides. Marked ICUConverterWrapper noncopyable. * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::registerEncodingNames): Added the UTF-8 aliases that were formerly added by TextCodecICU. (WebCore::nonASCIISequenceLength): Fixed bug where this would return 4 for bytes F5-FF instead of failing. (WebCore::decodeNonASCIISequence): Tweaked coding style. (WebCore::appendCharacter): Added. Makes it easier to share code between the partial-character handling and main loop. (WebCore::TextCodecUTF8::decode): Fixed buffer size computation for case where there is a partial sequence. Fixed partial sequence handling so that goto is no longer needed, since compilers sometimes make poor code when goto is involved. Added a loop for partial sequences since we consume only one byte when a partial sequence is invalid. Fixed logic in main decoding loop so goto is not needed. Used early-exit style in both loops so the main flow is not nested inside if statements. Added correct error handling for flush when a partial sequence remains, which involved wrapping the function in yet another loop. * platform/text/TextCodecUTF8.h: Made virtual function overrides private. * platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): Added calls to TextCodecUTF8. Removed calls to TextCodecICU. Added FIXMEs for other codecs that no longer need to be included here. (WebCore::extendTextCodecMaps): Updated for the name change of the TextCodecICU functions. 2011-02-14 Adam Barth Reviewed by Eric Seidel. Add basic parser for Content Security Policy https://bugs.webkit.org/show_bug.cgi?id=54379 The parser in this patch is very basic. It just segments the CSP header into directives. The exactly syntax will likely change a bit as we discuss the details in public-web-security, but this parser will allow us to make progress. Sadly, this patch does not contain any tests. That's because CSP policies do not have any observable effects yet. Hopefully we'll get enough sketched out in the next couple patches to begin writing tests. * page/ContentSecurityPolicy.cpp: (WebCore::CSPDirective::CSPDirective): (WebCore::CSPDirective::name): (WebCore::CSPDirective::value): (WebCore::ContentSecurityPolicy::~ContentSecurityPolicy): (WebCore::ContentSecurityPolicy::didReceiveHeader): (WebCore::ContentSecurityPolicy::parse): * page/ContentSecurityPolicy.h: 2011-02-14 Andrew Wason Reviewed by Kenneth Russell. [Qt] WebKit fails to compile for Qt when WebGL enabled https://bugs.webkit.org/show_bug.cgi?id=53431 No new tests. * WebCore.pro: Add source and header files and include directory to Qt project. * html/canvas/WebGLRenderingContext.cpp: File uses 'emit' which is a Qt keyword - #undef emit. * platform/graphics/gpu/qt: Added. * platform/graphics/gpu/qt/DrawingBufferQt.cpp: Added. Partial implementation of DrawingBuffer for Qt. (WebCore::DrawingBuffer::DrawingBuffer): (WebCore::DrawingBuffer::~DrawingBuffer): (WebCore::DrawingBuffer::didReset): (WebCore::DrawingBuffer::platformLayer): (WebCore::DrawingBuffer::platformColorBuffer): * platform/graphics/qt/Extensions3DQt.cpp: Noop implementation for pure virtual methods added to Extensions3D.h (WebCore::Extensions3DQt::blitFramebuffer): (WebCore::Extensions3DQt::renderbufferStorageMultisample): * platform/graphics/qt/Extensions3DQt.h: Declare new methods added to Extensions3D.h * platform/graphics/qt/GraphicsContext3DQt.cpp: Remove method implementations no longer in GraphicsContext3D.h. Change m_syntheticErrors to use unsigned int to match new GC3Denum type. (WebCore::GraphicsContext3D::create): Change return type to match GraphicsContext3D.h (WebCore::GraphicsContext3D::lineWidth): Change argument type to GC3Dfloat to match GraphicsContext3D.h (WebCore::GraphicsContext3D::getUniformLocation): Change return type to GC3Dfloat to match GraphicsContext3D.h (WebCore::GraphicsContext3D::getExtensions): Need to call get() on OwnPtr. (WebCore::GraphicsContext3D::getImageData): Rename enum values to match declarations in GraphicsContext3D.h 2011-02-14 Tony Chang Reviewed by Dimitri Glazkov. option elements to a shadow DOM https://bugs.webkit.org/show_bug.cgi?id=51379 Covered by existing tests e.g. fast/html/keygen.html, html5lib/runner.html, etc. * css/html.css: (form): Cleanup. (keygen, select): Border radii should match so focus ring looks good. (keygen::-webkit-keygen-select): No margin on the shadow element. (select): Hoisting border radius to keygen, select rule. * dom/SelectElement.cpp: (WebCore::toSelectElement): keygen is no longer a select element. * html/HTMLKeygenElement.cpp: Implements keygen shadow. (WebCore::KeygenSelectElement::create): (WebCore::KeygenSelectElement::shadowPseudoId): (WebCore::KeygenSelectElement::KeygenSelectElement): (WebCore::HTMLKeygenElement::HTMLKeygenElement): (WebCore::HTMLKeygenElement::parseMappedAttribute): (WebCore::HTMLKeygenElement::appendFormData): (WebCore::HTMLKeygenElement::formControlType): (WebCore::HTMLKeygenElement::reset): (WebCore::HTMLKeygenElement::selectShadow): * html/HTMLKeygenElement.h: keygen is no longer a select on C++ side. (WebCore::HTMLKeygenElement::canStartSelection): (WebCore::HTMLKeygenElement::isEnumeratable): (WebCore::HTMLKeygenElement::isResettable): * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::ownerSelectElement): Only owned by selects. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::HTMLSelectElement): Only 'select' tag name. 2011-02-06 Benjamin Poulain Reviewed by Kenneth Rohde Christiansen. [Qt] Fix coding style errors in ClipboardQt.h https://bugs.webkit.org/show_bug.cgi?id=43520 Fix coding style: order of header and indentation. * platform/qt/ClipboardQt.h: (WebCore::ClipboardQt::create): (WebCore::ClipboardQt::clipboardData): (WebCore::ClipboardQt::invalidateWritableData): 2011-02-06 Antti Koivisto Reviewed by Maciej Stachowiak. Use bloom filter for descendant selector filtering https://bugs.webkit.org/show_bug.cgi?id=53880 Bloom filter is faster than a hash set in this kind of use. Shark thinks this speeds up style matching by ~30% on sites with lots of descendant selectors. * ForwardingHeaders/wtf/BloomFilter.h: Added. * css/CSSStyleSelector.cpp: (WebCore::collectElementIdentifierHashes): (WebCore::CSSStyleSelector::pushParent): (WebCore::CSSStyleSelector::popParent): (WebCore::CSSStyleSelector::fastRejectSelector): (WebCore::RuleData::collectDescendantSelectorIdentifierHashes): * css/CSSStyleSelector.h: 2011-02-06 Maciej Stachowiak Reviewed by Antti Koivisto. media/video-document-types.html sometimes crashes the WebProcess https://bugs.webkit.org/show_bug.cgi?id=53884 No new tests. Already covered by media/video-document-types.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::userCancelledLoad): Stop the load timer when cancelling the load. 2011-02-06 Patrick Gansterer Reviewed by Adam Roben. [WIN] Use WCHAR instead of TCHAR https://bugs.webkit.org/show_bug.cgi?id=53863 We always use the UNICODE versions of windows functions, so the usage of TCHAR makes no sense and mixing them is bad style. * platform/graphics/win/IconWin.cpp: (WebCore::Icon::createIconForFiles): * platform/graphics/win/QTMovie.cpp: * platform/graphics/win/QTMovieGWorld.cpp: (QTMovieGWorld::fullscreenWndProc): (QTMovieGWorld::enterFullscreen): * platform/graphics/win/SimpleFontDataCGWin.cpp: (WebCore::SimpleFontData::platformInit): * platform/graphics/win/SimpleFontDataCairoWin.cpp: * platform/graphics/win/SimpleFontDataWin.cpp: * platform/graphics/wince/SimpleFontDataWinCE.cpp: * platform/win/BString.cpp: * platform/win/ClipboardWin.cpp: (WebCore::filesystemPathFromUrlOrTitle): (WebCore::createGlobalHDropContent): (WebCore::createGlobalImageFileDescriptor): * platform/win/ContextMenuWin.cpp: * platform/win/CursorWin.cpp: (WebCore::loadSharedCursor): * platform/win/FileChooserWin.cpp: (WebCore::FileChooser::basenameForWidth): * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::popupClassName): (WebCore::PopupMenuWin::show): * platform/win/PopupMenuWin.h: 2011-02-06 Patrick Gansterer Reviewed by Andreas Kling. Replace FLT_MAX with std::numeric_limits https://bugs.webkit.org/show_bug.cgi?id=53861 Also move EFL's userIdleTime from TemporaryLinkStubs into SystemTimeEfl. * html/NumberInputType.cpp: * html/parser/HTMLParserIdioms.cpp: (WebCore::parseToDoubleForNumberType): * platform/brew/SystemTimeBrew.cpp: (WebCore::userIdleTime): * platform/efl/SystemTimeEfl.cpp: (WebCore::userIdleTime): * platform/efl/TemporaryLinkStubs.cpp: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setupAnimation): * platform/win/SystemTimeWin.cpp: (WebCore::userIdleTime): * platform/wx/SystemTimeWx.cpp: (WebCore::userIdleTime): 2011-02-06 Patrick Gansterer Reviewed by Andreas Kling. [CMake] Add dependencies for Visual Studio projects https://bugs.webkit.org/show_bug.cgi?id=53773 Add a JavaScriptCore dependecy to WebCore, so CMake can generate the correct build order for the solution. * CMakeLists.txt: 2011-02-06 Patrick Gansterer Reviewed by Andreas Kling. [CMake] Unify ENABLE_SVG sections https://bugs.webkit.org/show_bug.cgi?id=53778 * CMakeLists.txt: 2011-02-06 Andreas Kling Reviewed by Dirk Schulze. Refactor Font::normalizeSpaces() to avoid an extra String copy. https://bugs.webkit.org/show_bug.cgi?id=53871 Have normalizeSpaces() take UChar*,length arguments instead of a String, since all call sites were creating temporaries from these components anyway. Font::normalizeSpaces() now always makes 1 String copy, instead of 1 in the best case and 2 in the worst case. * platform/graphics/Font.cpp: (WebCore::Font::normalizeSpaces): * platform/graphics/Font.h: * platform/graphics/qt/FontQt.cpp: (WebCore::drawTextCommon): (WebCore::Font::floatWidthForSimpleText): (WebCore::Font::floatWidthForComplexText): (WebCore::Font::offsetForPositionForSimpleText): (WebCore::Font::offsetForPositionForComplexText): (WebCore::Font::selectionRectForSimpleText): (WebCore::Font::selectionRectForComplexText): * svg/SVGFont.cpp: (WebCore::SVGTextRunWalker::walk): 2011-02-06 Andreas Kling Reviewed by Dirk Schulze. Fix potential buffer overrun in SVGTextRunWalker::walk() https://bugs.webkit.org/show_bug.cgi?id=53870 A new String was created from a UChar* with a 'length' argument that could be greater than the number of UChars available. * svg/SVGFont.cpp: (WebCore::SVGTextRunWalker::walk): 2011-02-05 Adam Barth Reviewed by Eric Seidel. Remove unused parameter related to XSSAuditor https://bugs.webkit.org/show_bug.cgi?id=53862 * WebCore.exp.in: * bindings/ScriptControllerBase.cpp: (WebCore::ScriptController::executeScript): (WebCore::ScriptController::executeIfJavaScriptURL): * bindings/ScriptControllerBase.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::evaluate): (WebCore::ScriptController::executeScriptInWorld): * bindings/js/ScriptController.h: * bindings/v8/ScriptController.cpp: (WebCore::ScriptController::evaluate): * bindings/v8/ScriptController.h: 2011-02-05 Adam Barth Fix Qt build. * WebCore.pro: 2011-02-05 Adam Barth Reviewed by Eric Seidel. Delete XSSAuditor https://bugs.webkit.org/show_bug.cgi?id=53859 The job of the XSSAuditor is now done by the XSSFilter. In the future, we might rename XSSFilter to XSSAuditor. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * bindings/ScriptControllerBase.cpp: (WebCore::ScriptController::executeIfJavaScriptURL): * bindings/ScriptControllerBase.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::ScriptController): (WebCore::ScriptController::evaluateInWorld): * bindings/js/ScriptController.h: * bindings/js/ScriptEventListener.cpp: (WebCore::createAttributeEventListener): * bindings/v8/ScriptController.cpp: (WebCore::ScriptController::ScriptController): (WebCore::ScriptController::evaluate): * bindings/v8/ScriptController.h: * bindings/v8/ScriptEventListener.cpp: (WebCore::createAttributeEventListener): * dom/Document.cpp: (WebCore::Document::implicitOpen): (WebCore::Document::processBaseElement): * dom/ScriptableDocumentParser.cpp: (WebCore::ScriptableDocumentParser::ScriptableDocumentParser): * dom/ScriptableDocumentParser.h: * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::shouldLoadExternalScriptFromSrc): * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::requestObject): (WebCore::SubframeLoader::loadMediaPlayerProxyPlugin): * page/XSSAuditor.cpp: Removed. * page/XSSAuditor.h: Removed. 2011-02-05 Anders Carlsson Reviewed by Darin Adler. Need a way to resize and scroll the page at the same time https://bugs.webkit.org/show_bug.cgi?id=53814 Export a function needed by WebKit2. * WebCore.exp.in: 2011-02-05 Patrick Gansterer Reviewed by Alexey Proskuryakov. Use Document::encoding() instead of DocumentWriter::encoding() https://bugs.webkit.org/show_bug.cgi?id=53398 This change makes the code more readable, when a subresource inherits the character encoding of the document. * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * dom/ScriptElement.cpp: (WebCore::ScriptElement::scriptCharset): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestPreload): * platform/network/FormDataBuilder.cpp: (WebCore::FormDataBuilder::encodingFromAcceptCharset): 2011-02-05 Adam Barth Reviewed by Eric Seidel. Introduce URLString to represent a canonicalized URL represented by a string https://bugs.webkit.org/show_bug.cgi?id=53847 Instead of using String all over the codebase to represent a URL, instead we should have a type to represent a canonicalized URL in the form of a string. This patch introduces that type. * GNUmakefile.am: * WebCore.gypi: * WebCore.xcodeproj/project.pbxproj: * platform/KURL.cpp: (WebCore::KURL::KURL): * platform/KURL.h: (WebCore::KURL::urlString): 2011-02-05 Robert Hogan Reviewed by Antonio Gomes. [Qt] Style widgets not rendering https://bugs.webkit.org/show_bug.cgi?id=53849 * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::hasValidClassId): x-qt-styled-widget is a valid class id too 2011-02-05 Jochen Eisinger Reviewed by Adam Barth. Add ContentSecurityPolicy object to Document and pass the X-WebKit-CSP header from the MainResourceLoader. https://bugs.webkit.org/show_bug.cgi?id=53685 * WebCore.xcodeproj/project.pbxproj: * dom/Document.h: (WebCore::Document::contentSecurityPolicy): * loader/MainResourceLoader.cpp: (WebCore::MainResourceLoader::didReceiveResponse): * page/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::didReceiveHeader): * page/ContentSecurityPolicy.h: 2011-02-05 Eric Seidel Reviewed by Adam Barth. Safari should lowercase schemes in cannonicalized urls to match every other browser https://bugs.webkit.org/show_bug.cgi?id=53848 We're clearly the odd man out here. See results from every browser at: https://github.com/abarth/url-spec/blob/master/tests/gurl-results/by-browser.txt * platform/KURL.cpp: (WebCore::KURL::parse): - Just lowercase the scheme when copying. 2011-02-05 Antti Koivisto Reviewed by Dave Hyatt. Optimize matching of descendant selectors https://bugs.webkit.org/show_bug.cgi?id=49876 During style recalculation, maintain a filter of tags, ids and classes seen in ancestor elements. Use the filter to quickly reject descendant and child selectors when doing style matching. This speeds up style recalculations 3-6x on many major web sites. * css/CSSStyleSelector.cpp: (WebCore::RuleData::RuleData): (WebCore::RuleData::descendantSelectorIdentifierHashes): (WebCore::collectElementIdentifiers): (WebCore::CSSStyleSelector::pushParent): (WebCore::CSSStyleSelector::popParent): (WebCore::CSSStyleSelector::fastRejectSelector): (WebCore::CSSStyleSelector::matchRulesForList): (WebCore::RuleData::collectDescendantSelectorIdentifierHashes): * css/CSSStyleSelector.h: (WebCore::CSSStyleSelector::ParentStackFrame::ParentStackFrame): * dom/Element.cpp: (WebCore::StyleSelectorParentPusher::StyleSelectorParentPusher): (WebCore::StyleSelectorParentPusher::push): (WebCore::StyleSelectorParentPusher::~StyleSelectorParentPusher): (WebCore::Element::attach): (WebCore::Element::recalcStyle): 2011-02-05 Nate Chapin Reviewed by Adam Barth. Refactor: NotificationCenter shouldn't hold its own copy of the ScriptExecutionContext* when it inherits one from ActiveDOMObject. https://bugs.webkit.org/show_bug.cgi?id=53815 * bindings/js/JSDesktopNotificationsCustom.cpp: (WebCore::JSNotificationCenter::requestPermission): * bindings/v8/custom/V8NotificationCenterCustom.cpp: (WebCore::V8NotificationCenter::requestPermissionCallback): * notifications/NotificationCenter.cpp: (WebCore::NotificationCenter::NotificationCenter): (WebCore::NotificationCenter::checkPermission): (WebCore::NotificationCenter::requestPermission): (WebCore::NotificationCenter::disconnectFrame): * notifications/NotificationCenter.h: (WebCore::NotificationCenter::createHTMLNotification): (WebCore::NotificationCenter::createNotification): 2011-02-04 Adam Barth Reviewed by Maciej Stachowiak. Crash in WebCore::TextEncoding::decode below XSSFilter::init https://bugs.webkit.org/show_bug.cgi?id=53837 Add missing null check. Test: http/tests/security/xssAuditor/non-block-javascript-url-frame.html * html/parser/XSSFilter.cpp: (WebCore::XSSFilter::init): 2011-02-04 Simon Fraser Reviewed by Dan Bernstein. Crashes in ShadowBlur via WebKit2 FindController https://bugs.webkit.org/show_bug.cgi?id=53830 Fix a crash cause by re-entering ShadowBlur, and add assertions to detect when it happens. The re-entrancy occurred when drawRectShadowWithTiling() filled the interior of the shadow with fillRect() on the context which still had the shadow state set. This would make another ShadowBlur on the stack and call into the code again, potentially blowing away the image buffer. Fix by turning off shadows in the destination context while we're drawing the tiled shadow. The non-tiled code path already did this. Not testable because CSS shadows clip out the inside of the rect being shadowed, and SVG uses fillPath, even for rects. * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::ScratchBuffer): (WebCore::ScratchBuffer::getScratchBuffer): (WebCore::ScratchBuffer::scheduleScratchBufferPurge): (WebCore::ShadowBlur::ShadowBlur): (WebCore::ShadowBlur::drawRectShadowWithTiling): 2011-02-04 Carlos Garcia Campos Reviewed by Martin Robinson. [GTK] Don't use a fixed size for search field icons https://bugs.webkit.org/show_bug.cgi?id=50624 Use the parent input content box to make sure the icon fits in the search field, scaling it down when needed. * platform/gtk/RenderThemeGtk.cpp: (WebCore::paintGdkPixbuf): (WebCore::getIconSizeForPixelSize): (WebCore::adjustSearchFieldIconStyle): (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationStyle): (WebCore::centerRectVerticallyInParentInputElement): (WebCore::RenderThemeGtk::paintSearchFieldResultsDecoration): (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle): (WebCore::RenderThemeGtk::paintSearchFieldCancelButton): (WebCore::RenderThemeGtk::paintCapsLockIndicator): (WebCore::RenderThemeGtk::paintMediaButton): 2011-02-04 Hironori Bono Reviewed by Adam Barth. [chromium] JPEG corruption https://bugs.webkit.org/show_bug.cgi?id=53250 Same as gray-scale JPEGs, we convert the colors of CMYK JPEGs with color profiles from CMYK to RGB twice and it causes color corruption. This change suppresses the color profiles for CMYK JPEGs same as gray-scale ones. Test: fast/images/cmyk-jpeg-with-color-profile.html * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageReader::decode): 2011-02-04 Xiyuan Xia Reviewed by Tony Chang. [Chromium] Option text in select popup does not align with menulist button text https://bugs.webkit.org/show_bug.cgi?id=53632 This makes clientPaddingLeft and clientPaddingRight return the additional m_innerBlock's padding so that the popup item text aligns with the menulist button text. * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::clientPaddingLeft): (WebCore::RenderMenuList::clientPaddingRight): 2011-02-04 Anders Carlsson Reviewed by Sam Weinig and Beth Dakin. REGRESSION: Horizontal scrollbar thumbs leave artifacts over page content when scrolling vertically * platform/ScrollView.cpp: (WebCore::ScrollView::scrollContents): Subtract scrollbars from the scroll view rect if overlay scrollers are enabled. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::setScrollOffsetFromAnimation): Make sure to invalidate both scrollbars if overlay scrollers are enabled. 2011-02-04 Adam Barth Reviewed by Eric Seidel. PluginDocuments don't create widgets for plugins on back/forward https://bugs.webkit.org/show_bug.cgi?id=53474 Long ago, PluginDocument always caused the HTMLEmbedElement to create its widget synchronously during a post-layout task. Recently, however, some changes to the HistroyController caused layout on back/forward to become slightly more complicated (and added an extra level of recursion to layout). This extra level of recursion triggered the "I've recursed too many times" condition in the post-layout task queue, causing the FrameView to run the remainder of the tasks asynchronously. Unfortunately, that broke PluginDocument because it needs its the HTMLEmbedElement's updateWidget task to run synchronously. This patch adds a mechanism for "kicking off" the pending post-layout tasks synchronously (instead of waiting for the timer to fire). PluginDocument then uses that facility to ensure that the HTMLEmbedElement's updateWidget task happens. Test: plugins/plugin-document-back-forward.html * html/PluginDocument.cpp: (WebCore::PluginDocumentParser::appendBytes): * page/FrameView.cpp: (WebCore::FrameView::flushAnyPendingPostLayoutTasks): * page/FrameView.h: 2011-02-04 Charlie Reis Reviewed by Mihai Parparita. Crash in WebCore::HistoryController::itemsAreClones https://bugs.webkit.org/show_bug.cgi?id=52819 Avoids deleting the current HistoryItem while it is still in use. Ensures that provisional items are committed for same document navigations. Ensures that error pages are committed on back/forward navigations. Also removes unneeded sanity checks used for diagnosing the problem. * loader/HistoryController.cpp: * loader/HistoryController.h: 2011-02-04 Carol Szabo Reviewed by David Hyatt. Code Changes. CSS 2.1 failure: content-* https://bugs.webkit.org/show_bug.cgi?id=52126 Test: fast/css/counters/content-021.html * rendering/CounterNode.cpp: (showCounterTree): Made parameter const because it is supposed to be so. * rendering/RenderCounter.cpp: (WebCore::previousInPreOrder): (WebCore::previousSiblingOrParent): (WebCore::parentElement): (WebCore::areRenderersElementsSiblings): (WebCore::nextInPreOrder): Added these local helper functions to help navigate the DOM tree enriched with :before and :after pseudo elements. (WebCore::planCounter): Fixed bug that would create a repeat counter for second and subsequent renderers associated with the same DOM element. (WebCore::findPlaceForCounter): (WebCore::makeCounterNode): Changed to use the new tree navigation functions described above instead of the Renderer Tree navigation functions. (WebCore::RenderCounter::rendererSubtreeAttached): (WebCore::RenderCounter::rendererStyleChanged): Optimized to not bother about counters until the renderers are finally attached. (showRendererTree): (showNodeTree): Debug helper functions used to debug Counter bugs. 2011-02-04 Dan Bernstein Typo fix. * html/parser/XSSFilter.cpp: (WebCore::HTMLNames::containsJavaScriptURL): 2011-02-04 Dan Bernstein Reviewed by Anders Carlsson. Make an infinite loop introduced in r77454 finite. * html/parser/XSSFilter.cpp: (WebCore::HTMLNames::containsJavaScriptURL): 2011-02-04 Jer Noble Reviewed by Eric Carlson. Frame accurate seeking isn't always accurate https://bugs.webkit.org/show_bug.cgi?id=52697 Test: media/video-frame-accurate-seek.html Make seeking slightly more accurate by rounding instead of truncating when converting from seconds-in-float to time/timeScale. * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::MediaPlayerPrivateQTKit::createQTTime): * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: (WebCore::MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue): * platform/graphics/win/QTMovie.cpp: (QTMovie::setCurrentTime): 2011-02-04 Jeremy Orlow Reviewed by Nate Chapin. Second IndexedDB events overhaul patch https://bugs.webkit.org/show_bug.cgi?id=53813 If an IDBRequest has a IDBTransaction, it should propogate events through it. In order to do this, IDBRequest needs to hold a transaction frontend object rather than a backend one. Test: storage/indexeddb/request-event-propagation.html * storage/IDBCursor.cpp: (WebCore::IDBCursor::IDBCursor): * storage/IDBCursor.h: (WebCore::IDBCursor::create): * storage/IDBDatabase.cpp: (WebCore::IDBDatabase::setSetVersionTransaction): (WebCore::IDBDatabase::createObjectStore): (WebCore::IDBDatabase::deleteObjectStore): * storage/IDBDatabase.h: * storage/IDBIndex.cpp: (WebCore::IDBIndex::IDBIndex): (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): (WebCore::IDBIndex::get): (WebCore::IDBIndex::getKey): * storage/IDBIndex.h: (WebCore::IDBIndex::create): * storage/IDBObjectStore.cpp: (WebCore::IDBObjectStore::IDBObjectStore): (WebCore::IDBObjectStore::get): (WebCore::IDBObjectStore::add): (WebCore::IDBObjectStore::put): (WebCore::IDBObjectStore::deleteFunction): (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::deleteIndex): (WebCore::IDBObjectStore::openCursor): * storage/IDBObjectStore.h: (WebCore::IDBObjectStore::create): * storage/IDBRequest.cpp: (WebCore::IDBRequest::create): (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::resetReadyState): (WebCore::IDBRequest::onSuccess): (WebCore::IDBRequest::dispatchEvent): * storage/IDBRequest.h: * storage/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::objectStore): (WebCore::IDBTransaction::contextDestroyed): (WebCore::IDBTransaction::enqueueEvent): * storage/IDBTransaction.h: * storage/IDBTransaction.idl: 2011-02-04 Jeremy Orlow Reviewed by Nate Chapin. First step towards event propogation within IndexedDB https://bugs.webkit.org/show_bug.cgi?id=53795 This is the first step towards implementing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11348 within IndexedDB. I've created a method that knows how to capture and bubble (based on Node's dispatchGenericEvent). I've then changed IDBRequest to use it. The only functional change is that preventDefault now must be called in error events to prevent the transaction from being aborted. The tests reflect this change and there's one specific test to look at this behavior. Test: storage/indexeddb/error-causes-abort-by-default.html * storage/IDBAbortEvent.cpp: (WebCore::IDBAbortEvent::create): (WebCore::IDBAbortEvent::IDBAbortEvent): * storage/IDBAbortEvent.h: * storage/IDBCompleteEvent.cpp: (WebCore::IDBCompleteEvent::create): (WebCore::IDBCompleteEvent::IDBCompleteEvent): * storage/IDBCompleteEvent.h: * storage/IDBErrorEvent.cpp: (WebCore::IDBErrorEvent::IDBErrorEvent): * storage/IDBEvent.cpp: (WebCore::IDBEvent::IDBEvent): (WebCore::IDBEvent::dispatch): * storage/IDBEvent.h: * storage/IDBRequest.cpp: (WebCore::IDBRequest::dispatchEvent): * storage/IDBRequest.h: * storage/IDBSuccessEvent.cpp: (WebCore::IDBSuccessEvent::IDBSuccessEvent): * storage/IDBTransaction.cpp: (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::onComplete): * storage/IDBTransaction.h: (WebCore::IDBTransaction::backend): * storage/IDBTransactionBackendImpl.cpp: (WebCore::IDBTransactionBackendImpl::taskTimerFired): 2011-02-04 Daniel Cheng Reviewed by Dmitry Titov. Clone WebClipboard to be frame-specific. https://bugs.webkit.org/show_bug.cgi?id=53727 For drop operations, Chrome currently snapshots the data and copies it into the renderer process. As we add more supported drag data types, the copy will become increasingly expensive. Instead, we'd like to snapshot data in the browser to reduce the amount of data copied and to support Blob in DataTransferItem. In order to allow this, we associated WebClipboard with a frame so it can correctly route its IPCs to the corresponding Chromium host. No new tests because no new functionality. * platform/chromium/ChromiumDataObject.cpp: (WebCore::ChromiumDataObject::createReadable): * platform/chromium/ChromiumDataObject.h: * platform/chromium/ClipboardChromium.cpp: (WebCore::ClipboardChromium::create): * platform/chromium/PlatformBridge.h: * platform/chromium/ReadableDataObject.cpp: (WebCore::ReadableDataObject::create): (WebCore::ReadableDataObject::ReadableDataObject): (WebCore::ReadableDataObject::getData): (WebCore::ReadableDataObject::urlTitle): (WebCore::ReadableDataObject::htmlBaseUrl): (WebCore::ReadableDataObject::filenames): (WebCore::ReadableDataObject::ensureTypeCacheInitialized): * platform/chromium/ReadableDataObject.h: 2011-02-04 Jeremy Orlow Revert https://bugs.webkit.org/show_bug.cgi?id=53795 * storage/IDBAbortEvent.cpp: (WebCore::IDBAbortEvent::create): (WebCore::IDBAbortEvent::IDBAbortEvent): * storage/IDBAbortEvent.h: * storage/IDBCompleteEvent.cpp: (WebCore::IDBCompleteEvent::create): (WebCore::IDBCompleteEvent::IDBCompleteEvent): * storage/IDBCompleteEvent.h: * storage/IDBErrorEvent.cpp: (WebCore::IDBErrorEvent::IDBErrorEvent): * storage/IDBEvent.cpp: (WebCore::IDBEvent::IDBEvent): * storage/IDBEvent.h: * storage/IDBRequest.cpp: (WebCore::IDBRequest::dispatchEvent): * storage/IDBRequest.h: * storage/IDBSuccessEvent.cpp: (WebCore::IDBSuccessEvent::IDBSuccessEvent): * storage/IDBTransaction.cpp: (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::onComplete): * storage/IDBTransaction.h: * storage/IDBTransactionBackendImpl.cpp: (WebCore::IDBTransactionBackendImpl::taskTimerFired): 2011-02-04 Martin Galpin Reviewed by David Levin. CORS origin header not set on GET when a preflight request is required. https://bugs.webkit.org/show_bug.cgi?id=50773 Test: http/tests/xmlhttprequest/cross-origin-preflight-get.html * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::preflightSuccess): Explicitly set the request origin after a preflight request succeeds. 2011-02-04 Jeremy Orlow Reviewed by Nate Chapin. First step towards event propogation within IndexedDB https://bugs.webkit.org/show_bug.cgi?id=53795 This is the first step towards implementing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11348 within IndexedDB. I've created a method that knows how to capture and bubble (based on Node's dispatchGenericEvent). I've then changed IDBRequest to use it. The only functional change is that preventDefault now must be called in error events to prevent the transaction from being aborted. The tests reflect this change and there's one specific test to look at this behavior. Test: storage/indexeddb/error-causes-abort-by-default.html * storage/IDBAbortEvent.cpp: (WebCore::IDBAbortEvent::create): (WebCore::IDBAbortEvent::IDBAbortEvent): * storage/IDBAbortEvent.h: * storage/IDBCompleteEvent.cpp: (WebCore::IDBCompleteEvent::create): (WebCore::IDBCompleteEvent::IDBCompleteEvent): * storage/IDBCompleteEvent.h: * storage/IDBErrorEvent.cpp: (WebCore::IDBErrorEvent::IDBErrorEvent): * storage/IDBEvent.cpp: (WebCore::IDBEvent::IDBEvent): (WebCore::IDBEvent::dispatch): * storage/IDBEvent.h: * storage/IDBRequest.cpp: (WebCore::IDBRequest::dispatchEvent): * storage/IDBRequest.h: * storage/IDBSuccessEvent.cpp: (WebCore::IDBSuccessEvent::IDBSuccessEvent): * storage/IDBTransaction.cpp: (WebCore::IDBTransaction::onAbort): (WebCore::IDBTransaction::onComplete): * storage/IDBTransaction.h: (WebCore::IDBTransaction::backend): * storage/IDBTransactionBackendImpl.cpp: (WebCore::IDBTransactionBackendImpl::taskTimerFired): 2011-02-04 Dimitri Glazkov Reviewed by Csaba Osztrogonác. [Qt]REGRESSION(r76951): media/controls-without-preload.html fails https://bugs.webkit.org/show_bug.cgi?id=53674 * css/mediaControlsQt.css: 2011-02-04 Dan Bernstein Reviewed by Darin Adler and Dave Hyatt. Make ruby text size 50% by default https://bugs.webkit.org/show_bug.cgi?id=53723 * css/html.css: (ruby > rt): Changed the font-size from 60% to 50%. 2011-02-04 Antti Koivisto Reviewed by Dimitri Glazkov. https://bugs.webkit.org/show_bug.cgi?id=53610 Regression: adjacent sibling selector not working as expected https://bugs.webkit.org/show_bug.cgi?id=53574 REGRESSION (r76012): :last-child:after not working as expected Test for additional conditions in parent style that prevent sharing. Tests: fast/selectors/style-sharing-adjacent-selector.html fast/selectors/style-sharing-last-child.html * css/CSSStyleSelector.cpp: (WebCore::parentStylePreventsSharing): (WebCore::CSSStyleSelector::locateSharedStyle): 2011-02-04 Mark Mentovai Reviewed by Dimitri Glazkov. Chromium GYP build fix. When various settings were moved to webcore_prerequisites in r66364, things that should have been direct_dependent_settings were not marked as such. GYP 'defines', for example, make no sense on a 'none'-type target such as webcore_prerequisites. It appears that it was intended for these settings to be pushed to direct dependents, which would make direct_dependent_settings correct. Losing the ChromiumWebCoreObjC defines on the Mac, for example, caused http://crbug.com/71537, which at best causes Mac console log spew, and at worst may result in Chromium's copy of WebCore using system definitions of certain Objective-C classes at runtime, or vice-versa. The build now includes a postbuild step to prevent http://crbug.com/71537 from regressing again. The build will fail upon regression. https://bugs.webkit.org/show_bug.cgi?id=53630 * WebCore.gyp/WebCore.gyp: Move things in webcore_prerequisites into direct_dependent_settings as needed, add the check_objc_rename postbuild step. * WebCore.gyp/mac/check_objc_rename.sh: Added. 2011-02-04 Robert Hogan Reviewed by Darin Fisher. Move chromium iframe shim code to cross-platform file https://bugs.webkit.org/show_bug.cgi?id=52594 Move Chromium code for identifying and cutting out iframe shims from plugins to cross-platform utility file IFrameShimSupport.cpp. Amend PluginViewQt to use this code to handle shims correctly. * WebCore.gypi: Add Chromium support for IFrameShimSupport.cpp * WebCore.pro: Add Qt support for IFrameShimSupport.cpp * plugins/IFrameShimSupport.cpp: Added. (WebCore::getObjectStack): (WebCore::iframeIsAbovePlugin): (WebCore::getPluginOcclusions): * plugins/IFframeShimSupport.h: Added. * plugins/qt/PluginViewQt.cpp: (WebCore::PluginView::setNPWindowIfNeeded): 2011-02-04 Xiaomei Ji Reviewed by David Levin. Implement "