2013-03-25 Timothy Hatcher Make the Web Inspector console work in strict mode with JavaScriptCore. https://webkit.org/b/65829 rdar://problem/11271238 Reviewed by Oliver Hunt. * bindings/js/JSInjectedScriptHostCustom.cpp: (WebCore::JSInjectedScriptHost::evaluate): Return the evalFunction directly. * inspector/InjectedScriptHost.h: (WebCore::InjectedScriptHost::evaluateReturnsEvalFunction): Added. Return true on JSC and false on V8. * inspector/InjectedScriptHost.idl: Added evaluateReturnsEvalFunction and change evaluate to an attribute on JSC. * inspector/InjectedScriptSource.js: (InjectedScript.prototype._evaluateOn): Change from using 'with' statements to creating a closure that evaluates the expression. The command line APIs are passed as parameters to the closure so they are in scope but not injected. This allows the code evaluated in the console to stay in strict mode (if is was already set), or to get strict mode by prefixing expressions with 'use strict';. 2013-03-25 Tony Chang Image alt text not included in plain-text version when copying https://bugs.webkit.org/show_bug.cgi?id=11200 Reviewed by Ryosuke Niwa. Add a setting to enable copying image alt text to the clipboard and drag and drop pasteboard. This setting is disabled by default, so each port can enable if they want to match IE10 and Firefox's behavior. Test: editing/pasteboard/copy-image-with-alt-text.html * editing/Editor.cpp: (WebCore::Editor::cut): Explicitly ask that the selection on the pasteboard as being for the clipboard. (WebCore::Editor::copy): Explicitly ask that the selection on the pasteboard as being for the clipboard. (WebCore::Editor::selectedText): Add a private version of selectedText() that can choose between having image alt text or not. (WebCore::Editor::selectedTextForClipboard): Ask for image alt text if the setting is enabled. * editing/Editor.h: * editing/TextIterator.cpp: (WebCore::TextIterator::TextIterator): Add a bool to keep track of whether or not to emit image alt text. (WebCore::TextIterator::handleReplacedElement): If there's alt text, point the iterator to it. * editing/TextIterator.h: (TextIterator): * editing/mac/EditorMac.mm: (WebCore::Editor::takeFindStringFromSelection): Use the same text as on the clipboard. (WebCore::Editor::writeSelectionToPasteboard): Don't include image alt text since this is used by Services. (WebCore::Editor::stringSelectionForPasteboard): Don't include image alt text since this is used by Services. * page/DragController.cpp: (WebCore::DragController::startDrag): Use image alt text (matches Firefox). * page/Settings.in: Add a setting that disables image alt text by default. * platform/Pasteboard.h: * platform/blackberry/PasteboardBlackBerry.cpp: (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. * platform/chromium/ClipboardChromium.cpp: (WebCore::ClipboardChromium::writeRange): Use clipboard text when writing ranges (used by d&d). * platform/chromium/PasteboardChromium.cpp: (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. * platform/efl/PasteboardEfl.cpp: (WebCore::Pasteboard::writeSelection): Update function param. * platform/gtk/ClipboardGtk.cpp: (WebCore::ClipboardGtk::writeRange): Use clipboard text when writing ranges (used by d&d). * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::writeRange): Use clipboard text when writing ranges (used by d&d). * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::getStringSelection): Use ShouldSerializeSelectedTextForClipboard to determine whether the selected text is for the clipboard or not. (WebCore::Pasteboard::writeSelectionForTypes): Pass ShouldSerializeSelectedTextForClipboard through. (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. * platform/qt/ClipboardQt.cpp: (WebCore::ClipboardQt::writeRange): Use clipboard text when writing ranges (used by d&d). * platform/qt/PasteboardQt.cpp: (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. * platform/win/ClipboardWin.cpp: (WebCore::ClipboardWin::writeRange): Use clipboard text when writing ranges (used by d&d). * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. * platform/wince/PasteboardWinCE.cpp: (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. * platform/wx/PasteboardWx.cpp: (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. * rendering/RenderImage.h: (WebCore::RenderImage::altText): Add a getter for the alt text. 2013-03-25 Dean Jackson Remove autostart hashing code from WebCore https://bugs.webkit.org/show_bug.cgi?id=113242 Reviewed by Tim Horton. Remove PlugInOriginHash and all the related build entries. * CMakeLists.txt: * GNUmakefile.list.am: * Target.pri: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * html/HTMLPlugInImageElement.cpp: * plugins/PlugInOriginHash.cpp: Removed. * plugins/PlugInOriginHash.h: Removed. 2013-03-25 Roger Fong Unreviewed. Wrong place to enable RuntimeEnabledFeature for Windows. * bindings/generic/RuntimeEnabledFeatures.cpp: (WebCore): 2013-03-25 James Robinson [chromium] Support GraphicsLayer::setContentsToSolidColor https://bugs.webkit.org/show_bug.cgi?id=104396 Reviewed by Adrienne Walker. This enables and implements the GraphicsLayer::setContentsToSolidColor path for Chromium. Tested by reftests in compositing/background-color/ and several other compositing/ tests. * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::supportsBackgroundColorContent): * platform/graphics/chromium/GraphicsLayerChromium.cpp: (WebCore::GraphicsLayerChromium::setContentsToSolidColor): (WebCore): * platform/graphics/chromium/GraphicsLayerChromium.h: (WebKit): (GraphicsLayerChromium): 2013-03-25 Victor Carbune TextTrack Extension for WebVTT Regions https://bugs.webkit.org/show_bug.cgi?id=109820 Reviewed by Eric Carlson. Implemented the TextTrackRegionList and extended TextTrack with methods required for proper interaction with TextTrackRegion objects. Test: media/track/regions-webvtt/text-track-region-list.html * WebCore.gypi: Added files for proper building of TextTrackRegionList. * html/track/TextTrack.cpp: (WebCore::TextTrack::TextTrack): (WebCore): (WebCore::TextTrack::ensureTextTrackRegionList): Method for creating a TextTrackRegionList associated with the current track, if it does exist already. (WebCore::TextTrack::regions): Getter for the regions object. (WebCore::TextTrack::addRegion): Method for adding a region. (WebCore::TextTrack::removeRegion): Method for removing a region. * html/track/TextTrack.h: (WebCore): (TextTrack): * html/track/TextTrack.idl: Added methods specific for region handling. * html/track/TextTrackRegion.cpp: (WebCore::TextTrackRegion::TextTrackRegion): Initialized the track member variable. (WebCore::TextTrackRegion::setTrack): Added internal setter for the track attribute. (WebCore): (WebCore::TextTrackRegion::updateParametersFromRegion): Method to copy the parameters from a different region object. * html/track/TextTrackRegion.h: Added track member variable and copy method. (WebCore::TextTrackRegion::track): Getter retrieves now the member variable. (TextTrackRegion): * html/track/TextTrackRegionList.cpp: Implemented methods required by the IDL. (WebCore): (WebCore::TextTrackRegionList::TextTrackRegionList): (WebCore::TextTrackRegionList::length): (WebCore::TextTrackRegionList::item): (WebCore::TextTrackRegionList::getRegionById): (WebCore::TextTrackRegionList::add): (WebCore::TextTrackRegionList::remove): (WebCore::TextTrackRegionList::clear): * html/track/TextTrackRegionList.h: (WebCore): (TextTrackRegionList): (WebCore::TextTrackRegionList::create): (WebCore::TextTrackRegionList::~TextTrackRegionList): * html/track/TextTrackRegionList.idl: IDL defined by the specification. 2013-03-25 Dean Jackson Cleanup plugin snapshotting autostart decision making https://bugs.webkit.org/show_bug.cgi?id=113231 Reviewed by Tim Horton. Move the code that creates a hash of plugin origin info out of WebCore. All WebCore needs to do now is simply ask its host layer whether or not a tuple of (pluginOrigin, pageOrigin, mimeType) should autostart or not. As a drive-by, the code in subframeLoaderWillCreatePlugIn was not quite restarting properly when the displayState was Restarting or RestartingWithPendingMouseClick. It still worked most of the time, but usually because the code ran soon after a mouse click. Now it should be explicit and also allowed us to be more clear about snapshotting at the end of the method. * html/HTMLPlugInElement.h: No more pluginOriginHash(). * html/HTMLPlugInImageElement.cpp: (WebCore::addPlugInsFromNodeListMatchingPlugInOrigin): Change signature to accept the tuple described above, and compare strings rather than hashes. (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Tell host layer the origin info rather than hash info. (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Remember the url that the plugin was loaded from. Make some of the logging messages more clear. Test for plugin and page origin rather than hash. * html/HTMLPlugInImageElement.h: (WebCore::HTMLPlugInImageElement::loadedUrl): New loadedURL member function. * page/PlugInClient.h: (PlugInClient): Change signature of virtual class to accept origin and mimeType info rather than hash. 2013-03-25 Sheriff Bot Unreviewed, rolling out r146793. http://trac.webkit.org/changeset/146793 https://bugs.webkit.org/show_bug.cgi?id=113248 Fix did not work (Requested by rfong on #webkit). * bindings/scripts/preprocessor.pm: (applyPreprocessor): 2013-03-25 Brandon Jones WEBGL_compressed_texture_pvrtc needs implementation https://bugs.webkit.org/show_bug.cgi?id=110497 Reviewed by Kenneth Russell. Test: webgl/conformance/extensions/webgl-compressed-texture-pvrtc.html Exposes the WEBGL_compressed_texture_pvrtc extension, but is unverified since no desktop hardware supports the format that I am aware of. Should enable mobile ports to expose the format, however. * CMakeLists.txt: * DerivedSources.make: * DerivedSources.pri: * GNUmakefile.list.am: * Target.pri: * WebCore.gypi: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSWebGLRenderingContextCustom.cpp: (WebCore::toJS): * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: (WebCore::toV8Object): * html/canvas/WebGLCompressedTexturePVRTC.cpp: Copied from Source/WebCore/html/canvas/WebGLExtension.h. (WebCore): (WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC): (WebCore::WebGLCompressedTexturePVRTC::~WebGLCompressedTexturePVRTC): (WebCore::WebGLCompressedTexturePVRTC::getName): (WebCore::WebGLCompressedTexturePVRTC::create): (WebCore::WebGLCompressedTexturePVRTC::supported): * html/canvas/WebGLCompressedTexturePVRTC.h: Copied from Source/WebCore/html/canvas/WebGLExtension.h. (WebCore): (WebGLCompressedTexturePVRTC): * html/canvas/WebGLCompressedTexturePVRTC.idl: Copied from Source/WebCore/html/canvas/WebGLExtension.h. * html/canvas/WebGLExtension.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore): (WebCore::WebGLRenderingContext::paintRenderingResultsToCanvas): (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): (WebCore::WebGLRenderingContext::validateCompressedTexFuncData): * html/canvas/WebGLRenderingContext.h: (WebCore): (WebGLRenderingContext): 2013-03-25 Roger Fong Enable CSS_REGIONS and CSS_EXCLUSIONS. https://bugs.webkit.org/show_bug.cgi?id=87519 Reviewed by Timothy Horton. * bindings/generic/RuntimeEnabledFeatures.cpp: (WebCore): 2013-03-25 Mikhail Pozdnyakov Remove unused code from Frame class destructor https://bugs.webkit.org/show_bug.cgi?id=113181 Reviewed by Alexey Proskuryakov. No new tests. No new functionality. * page/Frame.cpp: (WebCore::Frame::~Frame): Removed the code which could never have been executed as m_view had been set to '0'. 2013-03-25 Eric Seidel Incorrect parsing due to hash collision https://bugs.webkit.org/show_bug.cgi?id=113235 Reviewed by Adam Barth. Test: fast/parser/tag-hash-collision.html * html/parser/HTMLIdentifier.cpp: (WebCore::HTMLIdentifier::findIndex): 2013-03-25 Adenilson Cavalcanti Compile without SVG will fail https://bugs.webkit.org/show_bug.cgi?id=113234 Reviewed by Timothy Hatcher. Only make the cast to SVGStyleElement if we have SVG support built. * inspector/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::viaInspectorStyleSheet): 2013-03-25 Patrick Gansterer Enable STORE_FONT_CUSTOM_PLATFORM_DATA for all platforms https://bugs.webkit.org/show_bug.cgi?id=108438 Reviewed by Andreas Kling. Remove the conditional code so it is turned on for all platforms. * loader/cache/CachedFont.cpp: (WebCore::CachedFont::~CachedFont): (WebCore::CachedFont::ensureCustomFontData): (WebCore::CachedFont::platformDataFromCustomData): (WebCore::CachedFont::allClientsRemoved): (WebCore::CachedFont::reportMemoryUsage): 2013-03-25 Eric Carlson REGRESSION(r146380): media/track/track-user-preferences.html https://bugs.webkit.org/show_bug.cgi?id=113083 Reviewed by Jer Noble. Ignore track change notifications triggered by automatic track selection so the configuration is not changed. No new tests, this fixes an existing test. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::configureTextTrackGroup): Clear m_processingPreferenceChange after all track configuration is finished. (WebCore::HTMLMediaElement::configureTextTrackDisplay): Do nothing if m_processingPreferenceChange is true. 2013-03-25 Martin Robinson [GTK] [gyp] Build the final piece of WebCore https://bugs.webkit.org/show_bug.cgi?id=113216 Reviewed by Nico Weber. * WebCore.gyp/WebCoreGTK.gyp: Add the rest of the WebCore source files to the WebCore build target. 2013-03-25 Martin Robinson [GTK] [gyp] Adding support for building WebCore rendering https://bugs.webkit.org/show_bug.cgi?id=113213 Reviewed by Gustavo Noronha Silva. * WebCore.gyp/WebCoreGTK.gyp: Build the rendering directory into a shared library. 2013-03-25 Tony Chang Remove TextIterator argumentless constructor https://bugs.webkit.org/show_bug.cgi?id=113226 Reviewed by Ryosuke Niwa. The TextIterator argumentless constructors are never used and wouldn't be useful since you can't specify a range. No new tests, removing dead code. There should be no behavior change. * editing/TextIterator.cpp: Remove constructors. * editing/TextIterator.h: (TextIterator): (SimplifiedBackwardsTextIterator): (CharacterIterator): (BackwardsCharacterIterator): (WordAwareIterator): 2013-03-25 Brandon Jones Enabled canvas.getContext("webgl") on Desktop Chrome https://bugs.webkit.org/show_bug.cgi?id=113079 Reviewed by Dean Jackson. Test: fast/canvas/webgl/webgl-unprefixed-context-id.html * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp: (WebCore::V8HTMLCanvasElement::getContextMethodCustom): * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): 2013-03-25 Roger Fong Unreviewed. Remove some suspicious looking code in an attempt to fix EWS bots. * bindings/scripts/preprocessor.pm: (applyPreprocessor): 2013-03-25 Martin Robinson [GTK] [gyp] Add support for building the platform directory https://bugs.webkit.org/show_bug.cgi?id=113212 Reviewed by Nico Weber. * WebCore.gyp/WebCoreGTK.gyp: Add support for building the platform directory including two libraries, one for platform and one for geometry files. This follows the approach of Chromium. 2013-03-25 Jochen Eisinger Swap both the error and change event queue before processing fullscreen events https://bugs.webkit.org/show_bug.cgi?id=113194 Reviewed by Jer Noble. While processing the change events, not only new change events but also new error events might get generated. However, for the timer, we should only process preexisting events. This is covered by fullscreen/full-screen-restrictions.html which times out depending on the delay between requesting fullscreen and granting fullscreen. * dom/Document.cpp: (WebCore::Document::fullScreenChangeDelayTimerFired): 2013-03-25 Marja Hölttä [V8] Generate specialized callbacks for the main world https://bugs.webkit.org/show_bug.cgi?id=112430 Reviewed by Kentaro Hara. The new specialized bindings will be faster, because they don't need to do the "main world, isolated world or a worker" check, but can right away assume that we're in the main world. This patch generates main world bindings for getters and setters for a small amount of frequently used functions / functions used by Dromaeo. Added tests to TestObj.idl and updated bindings tests. * bindings/scripts/CodeGeneratorV8.pm: (GenerateOverloadedFunction): (GenerateFunctionCallback): (GenerateFunction): (GenerateParametersCheck): (GenerateSingleConstructorCallback): (GenerateNonStandardFunction): (GenerateImplementation): (GenerateFunctionCallString): * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::perWorldReadOnlyAttributeAttrGetter): (TestObjV8Internal): (WebCore::TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterCallback): (WebCore::TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterForMainWorld): (WebCore::TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterCallbackForMainWorld): (WebCore::TestObjV8Internal::perWorldAttributeAttrGetter): (WebCore::TestObjV8Internal::perWorldAttributeAttrGetterCallback): (WebCore::TestObjV8Internal::perWorldAttributeAttrGetterForMainWorld): (WebCore::TestObjV8Internal::perWorldAttributeAttrGetterCallbackForMainWorld): (WebCore::TestObjV8Internal::perWorldAttributeAttrSetter): (WebCore::TestObjV8Internal::perWorldAttributeAttrSetterCallback): (WebCore::TestObjV8Internal::perWorldAttributeAttrSetterForMainWorld): (WebCore::TestObjV8Internal::perWorldAttributeAttrSetterCallbackForMainWorld): (WebCore::TestObjV8Internal::perWorldMethodMethod): (WebCore::TestObjV8Internal::perWorldMethodMethodForMainWorld): (WebCore::TestObjV8Internal::perWorldMethodMethodCallback): (WebCore::TestObjV8Internal::perWorldMethodMethodCallbackForMainWorld): (WebCore::TestObjV8Internal::overloadedPerWorldMethod1Method): (WebCore::TestObjV8Internal::overloadedPerWorldMethod1MethodForMainWorld): (WebCore::TestObjV8Internal::overloadedPerWorldMethod2Method): (WebCore::TestObjV8Internal::overloadedPerWorldMethod2MethodForMainWorld): (WebCore::TestObjV8Internal::overloadedPerWorldMethodMethod): (WebCore::TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld): (WebCore::TestObjV8Internal::overloadedPerWorldMethodMethodCallback): (WebCore::TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorld): (WebCore): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore): * bindings/scripts/test/V8/V8TestTypedefs.cpp: (WebCore): * bindings/v8/V8DOMConfiguration.cpp: (WebCore::V8DOMConfiguration::batchConfigureCallbacks): (WebCore::V8DOMConfiguration::configureTemplate): * bindings/v8/V8DOMConfiguration.h: (BatchedMethod): (V8DOMConfiguration): * dom/Document.idl: * dom/Element.idl: * dom/Node.idl: * page/DOMWindow.idl: 2013-03-25 Daniel Cheng Don't allow drags to start after a mouse press that creates a context menu https://bugs.webkit.org/show_bug.cgi?id=112079 Reviewed by Tony Chang. This appears to be the intent of the original code anyway (the comments in the corresponding context menu handlers indicate that they set m_mousePressed to false in order to suppress drags from starting). Since exact platform behavior differs quite a bit in this area, this will also make the behavior more consistent across different WebKit implementations. Manually testable using context-menu-during-drag-selection.html. * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseDraggedEvent): 2013-03-25 Vsevolod Vlasov Web Inspector: [Regression] Provisional breakpoints are not shown on reload. https://bugs.webkit.org/show_bug.cgi?id=113210 Reviewed by Pavel Feldman. * inspector/front-end/BreakpointManager.js: (WebInspector.BreakpointManager.prototype._restoreBreakpoints): (WebInspector.BreakpointManager.prototype._projectWillReset.get for): (WebInspector.BreakpointManager.prototype._projectWillReset): (WebInspector.BreakpointManager.prototype._breakpointResolved): * inspector/front-end/utilities.js: 2013-03-25 Sergey Ryazanov Web Inspector: Remove console warnings for *_ prefixed CSS styles https://bugs.webkit.org/show_bug.cgi?id=113175 Reviewed by Pavel Feldman. Added separate error message for syntax CSS error in declaration list when no property detected. Added filter for messages starting with '*'. * css/CSSGrammar.y.in: 2013-03-25 Alexis Hetu Integration of the Skia displacement mapping into WebKit https://bugs.webkit.org/show_bug.cgi?id=112927 Reviewed by Stephen White. Added displacement mapping to effect-reference.html and effect-reference-hw.html * WebCore.gypi: * platform/graphics/filters/FEDisplacementMap.h: (FEDisplacementMap): Adding Skia specific declarations * platform/graphics/filters/skia/FEDisplacementMapSkia.cpp: Added. (WebCore): (WebCore::toSkiaMode): Provides conversion between the WebKit displacement mapping mode and the Skia displacement mapping mode (WebCore::FEDisplacementMap::platformApplySkia): Displacement through the Skia API. (Accelerated only for now) (WebCore::FEDisplacementMap::createImageFilter): Displacement image filter creation through the Skia API. 2013-03-25 Vladislav Kaznacheev Web Inspector: Graduate some new Inspector APIs to public https://bugs.webkit.org/show_bug.cgi?id=113176 Reviewed by Pavel Feldman. Summary of changes: DOM.highlightNode.nodeId: required parameter is now optional Input: domain has been added Runtime.enable: command has been added Runtime.executionContextCreated: event has been added Page.clearGeolocationOverride: command has been added Page.setGeolocationOverride: command has been added Page.captureScreenshot: command has been added Debugger.setBreakpointByUrl.locations: optional response parameter is now required * inspector/Inspector.json: 2013-03-25 Andrey Kosyakov Web Inspector: [Timeline] set glue records mode off by default https://bugs.webkit.org/show_bug.cgi?id=113189 Reviewed by Pavel Feldman. * inspector/front-end/TimelinePanel.js: /glueRecordsSetting/s/true/false/ 2013-03-25 Gyuyoung Kim [EFL] Fix build break when media source is enabled https://bugs.webkit.org/show_bug.cgi?id=113143 Unreviewed. Build error needs to be fixed in order to start to implement media source functionality. * CMakeLists.txt: * platform/efl/MIMETypeRegistryEfl.cpp: (WebCore): (WebCore::MIMETypeRegistry::isSupportedMediaSourceMIMEType): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore): (WebCore::MediaPlayerPrivateGStreamer::load): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: (MediaPlayerPrivateGStreamer): 2013-03-25 Vsevolod Vlasov Web Inspector: Toggling breakpoint with shortcut should be freezed as well while editing. https://bugs.webkit.org/show_bug.cgi?id=113188 Reviewed by Pavel Feldman. * inspector/front-end/JavaScriptSourceFrame.js: (WebInspector.JavaScriptSourceFrame.prototype.toggleBreakpointOnCurrentLine): 2013-03-25 Vsevolod Vlasov Web Inspector: Remove unneeded code from JavaScriptSourceFrame. https://bugs.webkit.org/show_bug.cgi?id=113182 Reviewed by Pavel Feldman. * inspector/front-end/JavaScriptSourceFrame.js: (WebInspector.JavaScriptSourceFrame): 2013-03-25 Alexei Filippov Web Inspector: Fonts refactoring https://bugs.webkit.org/show_bug.cgi?id=113047 Reviewed by Pavel Feldman. Unify fonts usage across inspector. Make inspector default font depend on platform. * inspector/front-end/dataGrid.css: (.data-grid table): (.data-grid td): * inspector/front-end/inspector.css: (.toolbar-label): (body.show-toolbar-icons .toolbar-label): (.console-message .bubble): (li .status .bubble): (.source-frame-breakpoint-message): (.soft-context-menu): * inspector/front-end/inspectorCommon.css: (body): * inspector/front-end/networkLogView.css: (.network-log-grid.data-grid td): (.network-log-grid.data-grid.small td): * inspector/front-end/tabbedPane.css: (.tabbed-pane-header-tab): (select.tabbed-pane-header-tabs-drop-down-select): * inspector/front-end/timelinePanel.css: (.memory-counter-value): 2013-03-25 Vladislav Kaznacheev Web Inspector: Use generate-inspector-protocol-version to list valid public API changes https://bugs.webkit.org/show_bug.cgi?id=113148 Added --show-changes command line option. Used existing compare_schemas method to do a reverse compare. Fixed a number of small problems (missing domain name in the message, incorrect error messages for command parameters). Reviewed by Pavel Feldman. * inspector/generate-inspector-protocol-version: (named_list_to_map): (removed): (required): (compare_schemas): (compare_domains): (compare_commands): (compare_events): (compare_params_list): (compare_types): (self_test): (self_test.create_test_schema_1): (self_test.create_test_schema_2): (self_test.is_subset): (self_test.errors_match): (main): 2013-03-25 Alec Flett Support Quota API in Workers https://bugs.webkit.org/show_bug.cgi?id=112972 Reviewed by Adam Barth. Tests: fast/workers/shared-worker-storagequota-query-usage.html fast/workers/worker-storagequota-query-usage.html * Modules/quota/WorkerNavigatorStorageQuota.cpp: Added. * Modules/quota/WorkerNavigatorStorageQuota.h: Added. * Modules/quota/WorkerNavigatorStorageQuota.idl: Added. * WebCore.gypi: Add entries for WorkerNavigatorStorageQuota. * page/WorkerNavigator.h: Add a Navigator supplement that extends the worker navigator. 2013-03-25 Mike West CSP 1.1: Rename SecurityPolicyViolationEvent::sourceURL to ::sourceFile. https://bugs.webkit.org/show_bug.cgi?id=113033 Reviewed by Jochen Eisinger. Bringing our experimental implementation into line with the spec, which has landed on the de facto standard name Gecko has been sending out for years and years. Spec: https://dvcs.w3.org/hg/content-security-policy/rev/e44f4003e158 Thread: http://lists.w3.org/Archives/Public/public-webappsec/2013Mar/0087.html * dom/SecurityPolicyViolationEvent.h: (SecurityPolicyViolationEventInit): (WebCore::SecurityPolicyViolationEvent::sourceFile): (WebCore::SecurityPolicyViolationEvent::SecurityPolicyViolationEvent): (SecurityPolicyViolationEvent): * dom/SecurityPolicyViolationEvent.idl: * page/ContentSecurityPolicy.cpp: (WebCore::gatherSecurityPolicyViolationEventData): s/sourceURL/sourceFile/ 2013-03-25 Michelangelo De Simone [CSS Filters] Using negative drop-shadow radius values has slow performance https://bugs.webkit.org/show_bug.cgi?id=107848 Setting negative blur radius values in drop-shadow() and box-shadow() led to significant rendering performance loss. The invalid value overflowed and the embedder became unresponsive for few seconds. This impacted SVG too (SVGFEDropShadow and SVGFEGaussianBlur). Reviewed by Dirk Schulze. Tests: css3/filters/effect-drop-shadow-negative-radius.html fast/box-shadow/box-shadow-parsing-invalid.html svg/filters/feDropShadow-negative-deviation-expected.svg svg/filters/feDropShadow-negative-deviation.svg svg/filters/feDropShadow-zero-deviation.svg svg/filters/feGaussianBlur-negative-deviation-expected.svg svg/filters/feGaussianBlur-negative-deviation.svg svg/filters/feGaussianBlur-zero-deviation.svg * css/CSSParser.cpp: (WebCore::CSSParser::parseShadow): Negative values are skipped during parsing: as per CSS Background and Borders specs, negative values shall not be allowed. * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::calculateUnscaledKernelSize): Added "non-negative" assertion for negative deviations. * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::build): If a negative standard deviation is encountered, don't build the filter and returns earlier, this avoids unnecessary calls: FEGaussianBlur is not being created with wrong and potentially overflowing values. * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::build): Ditto. 2013-03-25 Allan Sandfeld Jensen [Qt] REGRESSION(r146630): 8 text related test asserts on debug builds https://bugs.webkit.org/show_bug.cgi?id=113179 Reviewed by Jocelyn Turcotte. Test if range.start is within the valid range before testing the value at that point. * platform/graphics/qt/FontQt.cpp: (WebCore::Font::initFormatForTextLayout): 2013-03-25 Alexander Pavlov Web Inspector: Properly handle the rule addition to an XML or SVG document. https://bugs.webkit.org/show_bug.cgi?id=113185 Reviewed by Pavel Feldman. * inspector/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::viaInspectorStyleSheet): 2013-03-25 Peter Rybin Web Inspector: support changing local variables in frontend https://bugs.webkit.org/show_bug.cgi?id=112470 Reviewed by Yury Semikhatsky. ScopeRef type is added to RemoteObject and setPropertyValue is patched accordingly. Test: inspector/debugger/debugger-change-variable.html * inspector/front-end/DebuggerModel.js: (WebInspector.DebuggerModel.CallFrame.prototype.get id): * inspector/front-end/ObjectPropertiesSection.js: (WebInspector.FunctionScopeMainTreeElement.prototype.onpopulate.didGetDetails): (WebInspector.FunctionScopeMainTreeElement.prototype.onpopulate): * inspector/front-end/RemoteObject.js: (WebInspector.RemoteObject): (WebInspector.RemoteObject.fromScopePayload): (WebInspector.RemoteObject.prototype.): (WebInspector.RemoteObject.prototype.setPropertyValue): (WebInspector.RemoteObject.prototype.setVariableValueCallback): (WebInspector.RemoteObject.prototype._setDeclarativeVariableValue): (WebInspector.ScopeRef): * inspector/front-end/ScopeChainSidebarPane.js: (WebInspector.ScopeChainSidebarPane.prototype.update): 2013-03-25 Mike West CSP 1.1: Strip URLs in SecurityPolicyViolationEvents, just as we do for POSTed violation reports. https://bugs.webkit.org/show_bug.cgi?id=113039 Reviewed by Jochen Eisinger. I'd originally assumed that we didn't need to be quite so careful when handing URLs to JavaScript via SecurityPolicyViolationEvents. This was a mistake. Cross-origin URLs aren't accessible to JavaScript currently and there's no reason that we should begin exposing them via an event. This patch extracts the stripping logic from the existing reports into stripURLForUseInReport(), and uses that new method when populating the event and report objects. Relatedly, we were doing the wrong thing with 'file:' URLs, which this patch made clear. Now they're treated the same as 'data:' et al. Spec: https://dvcs.w3.org/hg/content-security-policy/rev/45f6ccaba0ef Tests: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-cross-origin-image-from-script.html http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-cross-origin-image.html http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-image-from-script.html http/tests/security/contentSecurityPolicy/report-blocked-file-uri.html * page/ContentSecurityPolicy.cpp: (WebCore::stripURLForUseInReport): Extract the logic from blockedURI out into a reusable method: cross-origin URLs are stripped down to the ASCII serialization of their origin, and non-heirarchical (and 'file:') URLs are stripped down to the ASCII serialization of their protocol. (WebCore::gatherSecurityPolicyViolationEventData): (WebCore::ContentSecurityPolicy::reportViolation): Use ::stripURLForUseInReport for blockedURL and sourceFile attributes in these two methods. 2013-03-25 Eugene Klyuchnikov Web Inspector: Fix JSDocs. https://bugs.webkit.org/show_bug.cgi?id=113025 Reviewed by Pavel Feldman. Next version of JS compiler finds more inconsistencies and ambiguous declarations. Some of them are resolved in this patch. * inspector/InjectedScriptSource.js: Fix JSDocs. * inspector/front-end/ConsoleModel.js: Ditto. * inspector/front-end/CookieParser.js: Ditto. * inspector/front-end/FileContentView.js: Ditto. * inspector/front-end/HeapSnapshotView.js: Ditto. * inspector/front-end/IndexedDBModel.js: Ditto. * inspector/front-end/ProfilesPanelDescriptor.js: Ditto. * inspector/front-end/utilities.js: Ditto. 2013-03-25 Mike West Cleanup: Tiny nits in ContentSecurityPolicy::reportViolation. https://bugs.webkit.org/show_bug.cgi?id=112784 Reviewed by Jochen Eisinger. Just cleanup of three tiny nits I ran across in ContentSecurityPolicy::reportViolation while doing other work. - 'directiveText' and 'effectiveDirective' can't be empty; we pass in values at every callsite. We can safely remove the 'isEmpty()' checks. Moreover, even if they could possibly somehow be empty, we should still include those empty strings in the report, rather than dropping the values entirely. - We don't need to hold 'document->referrer()' in a temp variable. * page/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::reportViolation): 2013-03-25 Eugene Klyuchnikov Web Inspector: [Overview] Make "drag-to-move" feature more discoverable. https://bugs.webkit.org/show_bug.cgi?id=113032 Reviewed by Pavel Feldman. To move overview window user could drag-n-drop over time "ribbon" on OverviewGrid. This feature is hard to discover. Setting "move" cursor will make this feature more discoverable. * inspector/front-end/inspectorCommon.css: Set "move" cursor to draggable area. * inspector/front-end/OverviewGrid.js: Ditto. 2013-03-25 Eugene Klyuchnikov Web Inspector: [Profiles] Remove unused private member. https://bugs.webkit.org/show_bug.cgi?id=113015 Reviewed by Pavel Feldman. _profileGroupsForLinks is not used anymore. * inspector/front-end/ProfilesPanel.js: (WebInspector.ProfilesPanel.prototype._reset): Removed unused member. 2013-03-25 PhistucK Web Inspector: Exception when turning on pretty print without any displayed source in the editor https://bugs.webkit.org/show_bug.cgi?id=113136 Reviewed by Vsevolod Vlasov. No new tests. Added a check for the existence of currently edited document. * inspector/ScriptsPanel.js: (WebInspector.ScriptsPanel.prototype._toggleFormatSource): 2013-03-25 Mihnea Ovidenie [CSSRegions] Remove RenderRegion::printRegionObjectsStyles https://bugs.webkit.org/show_bug.cgi?id=113081 Reviewed by Tony Chang. No change in functionality, remove unused function.. * rendering/RenderRegion.h: 2013-03-25 Hurnjoo Lee [Texmap] Memory leak when closing a tab https://bugs.webkit.org/show_bug.cgi?id=112127 Reviewed by Noam Rosenthal. When closing a tab, if there are any updates pending in CoordinatedGraphicsScene's render queue, the scene is not freed because reference count of m_scene is not zero. No new tests. * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp: (WebCore::CoordinatedGraphicsScene::detach): When bind updates in CoordinatedGraphicsScene, the reference count of m_scene is increasing, if m_renderQueue is not empty before closing tab, then m_scene is never freed. Hence, when closing tab, need to clear m_renderQueue explicitly in order to destroy m_scene. 2013-03-25 Keishi Hattori Clear button visibility is not updated when restoring form state https://bugs.webkit.org/show_bug.cgi?id=113172 Clear button wasn't showing up when restoring form state. Reviewed by Kent Tamura. Tests: fast/forms/date-multiple-fields/date-multiple-fields-clearbutton-visibility-after-restore.html fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-clearbutton-visibility-after-restore.html fast/forms/month-multiple-fields/month-multiple-fields-clearbutton-visibility-after-restore.html fast/forms/time-multiple-fields/time-multiple-fields-clearbutton-visibility-after-restore.html fast/forms/week-multiple-fields/week-multiple-fields-clearbutton-visibility-after-restore.html * html/BaseMultipleFieldsDateAndTimeInputType.cpp: (WebCore::BaseMultipleFieldsDateAndTimeInputType::restoreFormControlState): 2013-03-25 Eugene Klyuchnikov Web Inspector: [Settings] Use registry to track settings objects. https://bugs.webkit.org/show_bug.cgi?id=113008 Reviewed by Pavel Feldman. Currently .createSetting creates new instance any time it is invoked. When one instance saves value, the other instance do not know about it. To resolve this issue we can use registry to make .createSetting return same object for specific key. * inspector/front-end/Settings.js: (WebInspector.Settings.prototype.createSetting): Use registry. 2013-03-24 Matt Falkenhagen Refactoring: Pull Node::disabled() and Node::isInert() down to Element. https://bugs.webkit.org/show_bug.cgi?id=112085 Reviewed by Hajime Morrita. Node is too low a level for these methods. The plan is to rename Element::disabled to isDisabledFormControl and to remove Element::isEnabledFormControl. No new tests, just refactoring. * dom/Element.cpp: (WebCore::Element::disabled): (WebCore): (WebCore::Element::isInert): * dom/Element.h: (Element): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchSimulatedClick): * dom/GestureEvent.cpp: (WebCore::GestureEventDispatchMediator::dispatchEvent): * dom/MouseEvent.cpp: (WebCore::MouseEventDispatchMediator::dispatchEvent): * dom/Node.cpp: (WebCore::Node::handleLocalEvents): (WebCore::Node::willRespondToMouseMoveEvents): (WebCore::Node::willRespondToMouseClickEvents): (WebCore::Node::willRespondToTouchEvents): * dom/Node.h: (Node): 2013-03-24 Alpha Lam GIFImageReader should reports parsing error to client https://bugs.webkit.org/show_bug.cgi?id=113141 Reviewed by Stephen White. GIFImageReader nows reports parsing error to client (GIFImageDecoder) such that errors can be handled. In the case of corrupted GIF images GIFImageReader will be deleted and decoding will fail. Unit test is updated to reflect change in behavior. Tested with a local corpus which showed better handling of corrupted GIF images. * platform/image-decoders/gif/GIFImageReader.cpp: (GIFImageReader::decode): 2013-03-24 KondapallyKalyan [EFL] Add support to check for current Drawable. https://bugs.webkit.org/show_bug.cgi?id=113103 Reviewed by Kenneth Rohde Christiansen. Covered by existing WebGL tests. In MakeCurrent we do an early return if it is the current GL context but ignore Surface. This patch fixes the issue, we now check for both context and surface before doing an early return in MakeCurrent. * platform/graphics/opengl/GLPlatformContext.cpp: (WebCore::GLPlatformContext::makeCurrent): (WebCore::GLPlatformContext::releaseCurrent): (WebCore::GLPlatformContext::destroy): * platform/graphics/opengl/GLPlatformSurface.cpp: (WebCore): (WebCore::GLPlatformSurface::isCurrentDrawable): (WebCore::GLPlatformSurface::onMakeCurrent): * platform/graphics/opengl/GLPlatformSurface.h: 2013-03-24 David Kilzer BUILD FIX (r146704): Settings::setHiddenPageDOMTimerThrottlingEnabled() isn't always built * WebCore.exp.in: Export Settings::setHiddenPageDOMTimerThrottlingEnabled() conditionally based on ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING). 2013-03-24 Christophe Dumez [EFL] NetworkStateNotifier::updateState() is called too often https://bugs.webkit.org/show_bug.cgi?id=113152 Reviewed by Kenneth Rohde Christiansen. Wait until we have read all the data on the Netlink socket before reporting a possible network interface change. This way, we make sure we don't call NetworkStateNotifier::updateState() several times in a row for no reason. We also call NetworkStateNotifier::updateState() only if we get a RTM_NEWADDR event and we are currently offline, or if we get a RTM_DELADDR and we are currently online. This avoids calling NetworkStateNotifier::updateState() uselessly as there is no way the online state can change otherwise. No new tests, no behavior change for layout tests. * platform/network/efl/NetworkStateNotifierEfl.cpp: (WebCore::NetworkStateNotifier::readSocketCallback): 2013-03-24 Chris Fleizach AX: Crash in WebCore::AccessibilitySpinButton::incrementButton() https://bugs.webkit.org/show_bug.cgi?id=111582 Reviewed by Tim Horton. There are two ways to create a spin button: from a textfield counter or from ARIA. If an ARIA spin button is created, it was returning true for isSpinButton, so we were casting to the other kind of spin button, leading to a crash. We need to be more specific about our class types. Test: platform/mac/accessibility/aria-spinbutton-crash.html * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isNativeSpinButton): * accessibility/AccessibilitySpinButton.h: (WebCore::AccessibilitySpinButton::isNativeSpinButton): (WebCore::toAccessibilitySpinButton): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2013-03-24 Chris Fleizach AXObjectCache gets recreated during document tear-down. https://bugs.webkit.org/show_bug.cgi?id=112525 Reviewed by Simon Fraser. In many cases, a document's AXObjectCache was being created after the document had detached, which is wasteful and could potentially lead to crashes because the AXObjectCache has a timer and relies on its document to exist. This patch provides a way to get the existing AX object cache, instead of always creating a new one. It moves the accessibilityEnabled() checks into the axObjectCache retrieval for easier readability. It adds a number of ASSERTs to vieryf that only the correct (top) document is used for cache manipulation. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::stopCachingComputedObjectAttributes): * dom/ContainerNode.cpp: (WebCore::ContainerNode::~ContainerNode): * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::clearAXObjectCache): (WebCore::Document::existingAXObjectCache): (WebCore::Document::axObjectCache): (WebCore::Document::setFocusedNode): * dom/Document.h: (Document): * dom/Element.cpp: (WebCore::Element::attributeChanged): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::isEditableToAccessibility): (WebCore::Node::attach): (WebCore::Node::rootEditableElement): (WebCore::Node::didMoveToNewDocument): * editing/AppendNodeCommand.cpp: (WebCore::sendAXTextChangedIgnoringLineBreaks): * editing/DeleteFromTextNodeCommand.cpp: (WebCore::DeleteFromTextNodeCommand::doApply): (WebCore::DeleteFromTextNodeCommand::doUnapply): * editing/Editor.cpp: (WebCore::Editor::respondToChangedContents): (WebCore::Editor::markAndReplaceFor): * editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::doApply): (WebCore::InsertIntoTextNodeCommand::doUnapply): * editing/InsertNodeBeforeCommand.cpp: (WebCore::InsertNodeBeforeCommand::doApply): (WebCore::InsertNodeBeforeCommand::doUnapply): * editing/atk/FrameSelectionAtk.cpp: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * editing/chromium/FrameSelectionChromium.cpp: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * editing/mac/FrameSelectionMac.mm: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setChecked): * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::optionElementChildrenChanged): (WebCore::HTMLSelectElement::setRecalcListItems): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/InputType.cpp: (WebCore::InputType::applyStep): * html/RangeInputType.cpp: (WebCore::RangeInputType::handleKeydownEvent): * loader/FrameLoader.cpp: (WebCore::FrameLoader::prepareForLoadStart): (WebCore::FrameLoader::checkLoadCompleteForThisFrame): * page/FocusController.cpp: (WebCore::FocusController::setInitialFocus): * page/Frame.cpp: (WebCore::Frame::disconnectOwnerElement): * page/FrameView.cpp: (WebCore::FrameView::removeFromAXObjectCache): (WebCore::FrameView::layout): (WebCore::FrameView::scrollToAnchor): (WebCore::FrameView::axObjectCache): * platform/ScrollView.cpp: (WebCore::ScrollView::setHasHorizontalScrollbar): (WebCore::ScrollView::setHasVerticalScrollbar): * platform/Scrollbar.cpp: (WebCore::Scrollbar::~Scrollbar): (WebCore): (WebCore::Scrollbar::existingAXObjectCache): * platform/Scrollbar.h: (Scrollbar): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::deleteLineBoxTree): (WebCore::RenderBlock::createRootInlineBox): (WebCore::RenderBlock::createAndAppendRootInlineBox): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::selectionChanged): * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::addChild): (WebCore::RenderMenuList::didUpdateActiveOption): * rendering/RenderObject.cpp: (WebCore::RenderObject::styleWillChange): (WebCore::RenderObject::willBeDestroyed): * rendering/RenderObjectChildList.cpp: (WebCore::RenderObjectChildList::removeChildNode): (WebCore::RenderObjectChildList::insertChildNode): * rendering/RenderText.cpp: (WebCore::RenderText::setText): * rendering/RenderWidget.cpp: (WebCore::RenderWidget::willBeDestroyed): 2013-03-23 Mike West Drop full URLs from cross-origin access errors caused by sandboxing. https://bugs.webkit.org/show_bug.cgi?id=113029 Reviewed by Timothy Hatcher. Following up on http://wkbug.com/112042, this patch brings cross-origin access error messages into line with the newly origin-only default message, and changes the error message text to explicitly refer to the missing 'allow-same-origin' sandbox flag that's the root cause of the error. * page/DOMWindow.cpp: (WebCore::DOMWindow::crossDomainAccessErrorMessage): Note that we're using the origin of the frames' URLs rather than their actual origin in these messages. This seems like a reasonable thing to do, since we know that at least one of the two origins will be "null" in this scenario. 2013-03-23 Dominic Mazzoni Implement Web Speech Synthesis for Chromium https://bugs.webkit.org/show_bug.cgi?id=111695 Reviewed by Adam Barth. Straightforward implementation of speech synthesis for Chromium by exposing interfaces for the platform to implement. * Modules/speech/SpeechSynthesis.cpp: (WebCore::SpeechSynthesis::boundaryEventOccurred): (WebCore::SpeechSynthesis::didStartSpeaking): (WebCore::SpeechSynthesis::didPauseSpeaking): (WebCore::SpeechSynthesis::didResumeSpeaking): (WebCore::SpeechSynthesis::didFinishSpeaking): (WebCore::SpeechSynthesis::speakingErrorOccurred): (WebCore): * Modules/speech/SpeechSynthesis.h: (SpeechSynthesis): * Modules/speech/SpeechSynthesisUtterance.cpp: (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance): (WebCore): (WebCore::SpeechSynthesisUtterance::~SpeechSynthesisUtterance): (WebCore::SpeechSynthesisUtterance::setVoice): * Modules/speech/SpeechSynthesisUtterance.h: (SpeechSynthesisUtterance): (WebCore::SpeechSynthesisUtterance::text): (WebCore::SpeechSynthesisUtterance::setText): (WebCore::SpeechSynthesisUtterance::lang): (WebCore::SpeechSynthesisUtterance::setLang): (WebCore::SpeechSynthesisUtterance::volume): (WebCore::SpeechSynthesisUtterance::setVolume): (WebCore::SpeechSynthesisUtterance::rate): (WebCore::SpeechSynthesisUtterance::setRate): (WebCore::SpeechSynthesisUtterance::pitch): (WebCore::SpeechSynthesisUtterance::setPitch): (WebCore::SpeechSynthesisUtterance::startTime): (WebCore::SpeechSynthesisUtterance::setStartTime): (WebCore::SpeechSynthesisUtterance::platformUtterance): * Modules/speech/SpeechSynthesisVoice.h: (WebCore::SpeechSynthesisVoice::~SpeechSynthesisVoice): * WebCore.exp.in: * WebCore.gypi: * platform/PlatformSpeechSynthesis.h: (PlatformSpeechSynthesis): * platform/PlatformSpeechSynthesisUtterance.cpp: (WebCore): (WebCore::PlatformSpeechSynthesisUtterance::create): * platform/PlatformSpeechSynthesisUtterance.h: (PlatformSpeechSynthesisUtterance): (WebCore::PlatformSpeechSynthesisUtterance::setClient): * platform/PlatformSpeechSynthesisVoice.cpp: (WebCore): (WebCore::PlatformSpeechSynthesisVoice::create): (WebCore::PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice): * platform/PlatformSpeechSynthesisVoice.h: (PlatformSpeechSynthesisVoice): (WebCore::PlatformSpeechSynthesisVoice::setVoiceURI): (WebCore::PlatformSpeechSynthesisVoice::setName): (WebCore::PlatformSpeechSynthesisVoice::setLang): (WebCore::PlatformSpeechSynthesisVoice::setLocalService): (WebCore::PlatformSpeechSynthesisVoice::setIsDefault): * platform/PlatformSpeechSynthesizer.cpp: (WebCore::PlatformSpeechSynthesizer::create): (WebCore::PlatformSpeechSynthesizer::setVoiceList): (WebCore): * platform/PlatformSpeechSynthesizer.h: (WebKit): (PlatformSpeechSynthesizerClient): (PlatformSpeechSynthesizer): * platform/chromium/PlatformSpeechSynthesizerChromium.cpp: Added. (WebCore): (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer): (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer): (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): (WebCore::PlatformSpeechSynthesizer::speak): (WebCore::PlatformSpeechSynthesizer::pause): (WebCore::PlatformSpeechSynthesizer::resume): (WebCore::PlatformSpeechSynthesizer::cancel): * platform/chromium/support/WebSpeechSynthesisUtterance.cpp: Added. (WebKit): (WebKit::WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance): (WebKit::WebSpeechSynthesisUtterance::operator=): (WebKit::WebSpeechSynthesisUtterance::assign): (WebKit::WebSpeechSynthesisUtterance::reset): (WebKit::WebSpeechSynthesisUtterance::operator PassRefPtr): (WebKit::WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*): (WebKit::WebSpeechSynthesisUtterance::text): (WebKit::WebSpeechSynthesisUtterance::lang): (WebKit::WebSpeechSynthesisUtterance::voice): (WebKit::WebSpeechSynthesisUtterance::volume): (WebKit::WebSpeechSynthesisUtterance::rate): (WebKit::WebSpeechSynthesisUtterance::pitch): (WebKit::WebSpeechSynthesisUtterance::startTime): * platform/chromium/support/WebSpeechSynthesisVoice.cpp: Added. (WebKit): (WebKit::WebSpeechSynthesisVoice::assign): (WebKit::WebSpeechSynthesisVoice::reset): (WebKit::WebSpeechSynthesisVoice::setVoiceURI): (WebKit::WebSpeechSynthesisVoice::setName): (WebKit::WebSpeechSynthesisVoice::setLanguage): (WebKit::WebSpeechSynthesisVoice::setIsLocalService): (WebKit::WebSpeechSynthesisVoice::setIsDefault): (WebKit::WebSpeechSynthesisVoice::operator PassRefPtr): * platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp: Added. (WebCore): (WebCore::WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl): (WebCore::WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl): (WebCore::WebSpeechSynthesizerClientImpl::setVoiceList): (WebCore::WebSpeechSynthesizerClientImpl::didStartSpeaking): (WebCore::WebSpeechSynthesizerClientImpl::didFinishSpeaking): (WebCore::WebSpeechSynthesizerClientImpl::didPauseSpeaking): (WebCore::WebSpeechSynthesizerClientImpl::didResumeSpeaking): (WebCore::WebSpeechSynthesizerClientImpl::speakingErrorOccurred): (WebCore::WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred): (WebCore::WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred): * platform/chromium/support/WebSpeechSynthesizerClientImpl.h: Added. (WebCore): (WebSpeechSynthesizerClientImpl): * platform/mac/PlatformSpeechSynthesizerMac.mm: (-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]): (-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]): (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer): (WebCore): (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer): (WebCore::PlatformSpeechSynthesizer::speak): * platform/mock/PlatformSpeechSynthesizerMock.cpp: (WebCore::PlatformSpeechSynthesizerMock::PlatformSpeechSynthesizerMock): (WebCore::PlatformSpeechSynthesizerMock::speakingFinished): (WebCore::PlatformSpeechSynthesizerMock::speak): * platform/mock/PlatformSpeechSynthesizerMock.h: (PlatformSpeechSynthesizerMock): 2013-03-23 Daniel Cheng [Qt] editing/pasteboard/can-read-in-dragstart-event.html and /can-read-in-copy-and-cut-events.html are crashing https://bugs.webkit.org/show_bug.cgi?id=113126 Reviewed by Ryosuke Niwa. The ClipboardQt implementation only allows reading or writing, not both. Attempting to read when the clipboard is only writable will lead to a crash since the corresponding member will be null. To prevent crashes, change the asserts to early returns. In the long term, the correct fix is to unify the m_readableData and m_writableData members. No new tests since no functionality in Qt port should change. * platform/qt/ClipboardQt.cpp: (WebCore::ClipboardQt::getData): (WebCore::ClipboardQt::types): (WebCore::ClipboardQt::files): 2013-03-23 Carlos Garcia Campos [GTK][Regression] webkit_dom_html_table_element_insert_row returns value that doesn't pass WEBKIT_DOM_IS_HTML_TABLE_ROW_ELEMENT macro https://bugs.webkit.org/show_bug.cgi?id=111714 Reviewed by Martin Robinson. Add custom kit implementation for HTMLElements so that the HTML wrappers are used in that case instead of wrapHTMLElement. * bindings/gobject/WebKitDOMBinding.cpp: (WebKit::kit): (WebKit): * bindings/gobject/WebKitDOMBinding.h: (WebCore): (WebKit): * bindings/scripts/CodeGeneratorGObject.pm: (UsesManualKitImplementation): 2013-03-23 David Kilzer Revert "BUILD FIX (r146667): ResourceRequest constructor in SynchronousLoaderClient.cpp is ambiguous on iOS" This is platform-agnositic code, so the previous solution won't work. * platform/network/SynchronousLoaderClient.cpp: (WebCore::SynchronousLoaderClient::willSendRequest): 2013-03-23 David Kilzer BUILD FIX (r146667): ResourceRequest constructor in SynchronousLoaderClient.cpp is ambiguous on iOS Fixes the following build failure: Source/WebCore/platform/network/SynchronousLoaderClient.cpp:52:15: error: conversion from 'int' to 'const WebCore::ResourceRequest' is ambiguous request = 0; ^ In file included from Source/WebCore/platform/network/SynchronousLoaderClient.cpp:30: In file included from Source/WebCore/platform/network/ResourceHandle.h:37: In file included from Source/WebCore/platform/network/ios/QuickLook.h:13: Source/WebCore/platform/network/cf/ResourceRequest.h:79:9: note: candidate constructor ResourceRequest(NSURLRequest *); ^ Source/WebCore/platform/network/cf/ResourceRequest.h:83:9: note: candidate constructor ResourceRequest(CFURLRequestRef cfRequest) ^ 1 error generated. * platform/network/SynchronousLoaderClient.cpp: (WebCore::SynchronousLoaderClient::willSendRequest): If USE(CFNETWORK) is defined, use static_cast(0), otherwise use static_cast(0). 2013-03-23 David Kilzer BUILD FIX (r146687): setDefaultMIMEType() is unused in ResourceHandleCFNet.cpp on iOS Fixes the following build failure: Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:98:13: error: unused function 'setDefaultMIMEType' [-Werror,-Wunused-function] static void setDefaultMIMEType(CFURLResponseRef response) ^ 1 error generated. * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::setDefaultMIMEType): Add #if !PLATFORM(MAC)/#endif guard. 2013-03-21 Kiran Muppala Add runtime setting for hidden page DOM timer throttling and CSS animation suspension https://bugs.webkit.org/show_bug.cgi?id=112308 Reviewed by Gavin Barraclough. No new tests. Only adding settings to enable/disable existing features and hence existing tests suffice. * WebCore.exp.in: * page/Page.cpp: (WebCore::Page::setVisibilityState): Check if DOM timer throttling and CSS animation suspension are enabled before turning them on. (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged): Start or stop DOM timer throttling based on page visibility and the new setting state. (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged): Ditto for CSS animation suspension. * page/Page.h: * page/Settings.cpp: (WebCore::Settings::Settings): Initialize the flags for enabling hidden page DOM timer throttling and CSS animation suspension to false. (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled): Update flag and notify page that the state of the setting has changed. (WebCore::Settings::setHiddenPageCSSAnimationSuspensionEnabled): Ditto. * page/Settings.h: (WebCore::Settings::hiddenPageDOMTimerThrottlingEnabled): (WebCore::Settings::hiddenPageCSSAnimationSuspensionEnabled): 2013-03-22 Benjamin Poulain Remove 2 bad branches from StringHash::equal() and CaseFoldingHash::equal() https://bugs.webkit.org/show_bug.cgi?id=113003 Reviewed by Eric Seidel. Fix two unfortunate use of StringHash and use the correct StringImpl function. * html/parser/HTMLParserIdioms.cpp: (WebCore::threadSafeEqual): * html/parser/HTMLTreeBuilderSimulator.cpp: (WebCore::tokenExitsSVG): 2013-03-22 Andy Estes Set the cache partition property on CFURLRequests https://bugs.webkit.org/show_bug.cgi?id=113116 Patch by Jeffrey Pfau Reviewed by David Kilzer. * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::ResourceRequest::doUpdatePlatformRequest): (WebCore::ResourceRequest::doUpdateResourceRequest): 2013-03-22 Julien Chaffraix [CSS Grid Layout] content-sized row tracks with percentage logical height grid items don't resolve properly https://bugs.webkit.org/show_bug.cgi?id=113085 Reviewed by Tony Chang. The core issue is that because overrideContainingBlockLogicalHeight() is unset in logicalContentHeightForChild, RenderBox::computePercentageLogicalHeight would try to resolve percentage logical height against the grid element (wrong containing block as a grid item's containing block is the grid area). Tests: fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::logicalContentHeightForChild): Set our override logical height to -1, so that we don't try to constrain a grid item's logical height based on resolving (badly) its percentage. 2013-03-19 Zhenyao Mo Check WEBGL_draw_buffers requirements before exposing the extension https://bugs.webkit.org/show_bug.cgi?id=112359 Reviewed by Kenneth Russell. * html/canvas/EXTDrawBuffers.cpp: (WebCore::EXTDrawBuffers::supported): call satisfies*(). (WebCore::EXTDrawBuffers::drawBuffersEXT): (WebCore): (WebCore::EXTDrawBuffers::satisfiesWebGLRequirements): check WebGL requirements. * html/canvas/EXTDrawBuffers.h: (EXTDrawBuffers): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::getDrawBuffer): (WebCore): * html/canvas/WebGLFramebuffer.h: (WebGLFramebuffer): * html/canvas/WebGLRenderingContext.cpp: (WebCore): (WebCore::WebGLRenderingContext::initializeNewContext): (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getParameter): (WebCore::WebGLRenderingContext::getSupportedExtensions): (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters): (WebCore::WebGLRenderingContext::getMaxDrawBuffers): (WebCore::WebGLRenderingContext::getMaxColorAttachments): (WebCore::WebGLRenderingContext::setBackDrawBuffer): (WebCore::WebGLRenderingContext::restoreCurrentFramebuffer): (WebCore::WebGLRenderingContext::restoreCurrentTexture2D): (WebCore::WebGLRenderingContext::supportsDrawBuffers): a cached version of EXTDrawBuffers::supports() * html/canvas/WebGLRenderingContext.h: (WebGLRenderingContext): 2013-03-22 Roger Fong Unreviewed. Fix AppleWin port following https://bugs.webkit.org/show_bug.cgi?id=113100. Patch by Alexey Proskuryakov. * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::platformLoadResourceSynchronously): 2013-03-22 Tony Chang REGRESSION (r146272): layout issues for flex boxes that have -webkit-flex-wrap: wrap https://bugs.webkit.org/show_bug.cgi?id=113071 Reviewed by Ojan Vafai. The refactor in r139535 introduced this bug, where a variable name wasn't updated properly. In combination with r146272, this bug became more visible when nesting multiline flexboxen. Test: css3/flexbox/multiline-min-preferred-width.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): We want the width of the widest flexitem, the value in m_minPreferredWidth isn't relevant. Also update the comment for max preferred width. 2013-03-22 Max Vujovic [CSS Shaders] Clamp css_MixColor before the blending and compositing steps https://bugs.webkit.org/show_bug.cgi?id=113088 Reviewed by Dean Jackson. The blending and compositing operations from the spec [1] expect that they are operating on valid color inputs, in the range [0.0, 1.0]. Thus, we should clamp the css_MixColor input to this range to avoid implementation-dependent behavior for invalid color inputs. [1]: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending Tests: css3/filters/custom/custom-filter-clamp-css-mix-color-negative.html css3/filters/custom/custom-filter-clamp-css-mix-color.html * platform/graphics/filters/CustomFilterValidatedProgram.cpp: (WebCore::CustomFilterValidatedProgram::rewriteMixFragmentShader): Clamp css_MixColor as clampedMixColor before using it in the blending and compositing steps. 2013-03-19 Martin Robinson [GTK] Add WebCoreDOM to the gyp build https://bugs.webkit.org/show_bug.cgi?id=112737 Reviewed by Nico Weber. * WebCore.gyp/WebCoreGTK.gyp: Add WebCoreDOM to the gyp build. 2013-03-19 Martin Robinson [GTK] Add WebCoreHTML to the gyp build https://bugs.webkit.org/show_bug.cgi?id=112727 Reviewed by Nico Weber. * WebCore.gyp/WebCoreGTK.gyp: Add support for building all files under the HTML directory. This includes splitting off common WebCore dependencies into an aggregate target and adding a top-level WebCore target. 2013-03-22 Tim Horton Plugin Snapshotting: Auto-start dominant plugins https://bugs.webkit.org/show_bug.cgi?id=113111 Reviewed by Dean Jackson. * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::defaultEventHandler): Acknowledge the new "Restarting" DisplayState. * html/HTMLPlugInElement.h: Rename PlayingWithPendingMouseClick to RestartingWithPendingMouseClick for accuracy. Add "Restarting" DisplayState, so we can be aware that the plugin is intentionally restarting and not re-snapshot it. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Remove m_isPrimarySnapshottedPlugIn. (WebCore::classNameForShadowRoot): Remove m_isPrimarySnapshottedPlugIn. (WebCore::HTMLPlugInImageElement::setIsPrimarySnapshottedPlugIn): Restart the plugin when it becomes primary. (WebCore::HTMLPlugInImageElement::updateSnapshotInfo): Remove m_isPrimarySnapshottedPlugIn. (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn): Move the plugin to Restarting unless it's already marked as PendingMouseClick. (WebCore::HTMLPlugInImageElement::simulatedMouseClickTimerFired): Match the PlayingWithPendingMouseClick rename. (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Don't snapshot if we're restarting. * html/HTMLPlugInImageElement.h: Remove m_isPrimarySnapshottedPlugIn. * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::paint): Acknowledge the new "Restarting" DisplayState. (WebCore::RenderSnapshottedPlugIn::getCursor): Acknowledge the new "Restarting" DisplayState. (WebCore::RenderSnapshottedPlugIn::handleEvent): Match the PlayingWithPendingMouseClick rename. 2013-03-19 Martin Robinson [GTK] Add support for building the WebCore bindings to the gyp build https://bugs.webkit.org/show_bug.cgi?id=112638 Reviewed by Nico Weber. Add targets, actions, and rules for building the WebCore bindings. This is the first part of the WebCoreGTK build. * WebCore.gyp/ConvertFileToHeaderWithCharacterArray.gypi: Added. * WebCore.gyp/MakeNames.gypi: Added. * WebCore.gyp/WebCoreGTK.gyp: Added WebCore bindings build. This has been adapted from the Chromium build. * WebCore.gypi: Updated list of derived sources files and added a parameter for adjusting the location of the built files. We don't want to force the Mac build to change, but we'd still like to reuse the scripts that the Chromium build uses. 2013-03-22 Dane Wallinga Add client callbacks to notify of changes of associated from controls https://bugs.webkit.org/show_bug.cgi?id=110375 Reviewed by Ryosuke Niwa. Hook FormAssociatedElement, HTMLFormElement to notify EditorClient of form changes after a page has loaded. Will be used to add autofill support for ajax-y webpages. e.g if while filling out a form, new fields are dynamically created, autofill can know to re-query the autofill server and keep going. https://bugs.webkit.org/show_bug.cgi?id=110375 * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::didAssociateFormControl): (WebCore): (WebCore::Document::didAssociateFormControlsTimerFired): * dom/Document.h: (Document): added method didAssociateFormControl, which batches form changes and calls out to ChromeClient on a timer. * html/FormAssociatedElement.cpp: (WebCore::FormAssociatedElement::resetFormOwner): (WebCore::FormAssociatedElement::formAttributeChanged): (WebCore): * html/FormAssociatedElement.h: (FormAssociatedElement): add calls to Document::didAssociateFormControl when form changes * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::insertedInto): (WebCore): * html/HTMLFormElement.h: add call to Document::didAssociateFormControl * loader/EmptyClients.h: (EmptyChromeClient): (WebCore::EmptyChromeClient::didAssociateFormControls): (WebCore::EmptyChromeClient::shouldNotifyOnFormChanges): * page/ChromeClient.h: (ChromeClient): add new method didAssociateFormControls 2013-03-22 Alexey Proskuryakov Split ResourceHandleMac into multiple files https://bugs.webkit.org/show_bug.cgi?id=113100 Reviewed by Geoff Garen. It's grown too big to navigate, and I'm going to make WebCoreResourceHandleAsDelegate substantially more complicated yet. 1. Mechanically moved WebCoreResourceHandleAsDelegate into separate files. 2. Refactored WebCoreSynchronousLoaderClient to be cross-platform, and moved it into separate files. * WebCore.vcproj/WebCore.vcproj: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * platform/network/SynchronousLoaderClient.cpp: Added. * platform/network/SynchronousLoaderClient.h: Added. * platform/network/cf/ResourceHandleCFNet.cpp: * platform/network/mac/SynchronousLoaderClient.mm: Added. * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Added. * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Added. 2013-03-21 Geoffrey Garen Added a setting for whether JavaScript markup is enabled https://bugs.webkit.org/show_bug.cgi?id=112999 Reviewed by Maciej Stachowiak. This setting is useful for clients that want protection from script injection attacks. * page/Settings.h: (Settings): Clarified which clients should call canExecuteScripts(). * page/Settings.in: Added the new setting. 2013-03-22 Roger Fong Unreviewed build fix. * bindings/scripts/preprocessor.pm: (applyPreprocessor): 2013-03-22 Roger Fong Unreviewed. Force kill gcc-3.exe during bindings generation tests to avoid process hangs. This problem is occuring on the WinEWS bots where there are somehow multiple gcc-3 processes existing at the same time. This is a speculative fix. There should only be 1 gcc-3.exe process running at a time ever. * bindings/scripts/preprocessor.pm: (applyPreprocessor): 2013-03-22 Eric Carlson Cleanup text track selection logic https://bugs.webkit.org/show_bug.cgi?id=113062 Reviewed by Jer Noble. No new tests, covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind): Remove. (WebCore::HTMLMediaElement::configureTextTrackGroup): Don't look at track attributes directly, use captionPreferences->textTrackSelectionScore to calculate track rank. (WebCore::HTMLMediaElement::setClosedCaptionsVisible): Set m_processingPreferenceChange here instead of in captionPreferencesChanged. (WebCore::HTMLMediaElement::captionPreferencesChanged): Don't suppress calls to setClosedCaptionsVisible, existing code already makes sure we don't do unnecessary work. * html/HTMLMediaElement.h: * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Drive by cleanup, don't process inactive cues. * html/shadow/MediaControlsApple.cpp: (WebCore::MediaControlsApple::changedClosedCaptionsVisibility): Call resetTrackListMenu instead of updateDisplay so we only mark the menu as needing a recalculation and do the work when it is displayed. * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::shouldShowCaptions): When in testing mode, return true if the caption or subtitle preference has been set. (WebCore::CaptionUserPreferences::setShouldShowCaptions): In testing mode, clear the caption and subtitle preference when passed false. (WebCore::CaptionUserPreferences::textTrackSelectionScore): Calculate the track score based on track type preference and preferred language. (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Score a track according to the language presence and position in the preferred languages list. * page/CaptionUserPreferences.h: * page/CaptionUserPreferencesMac.h: * page/CaptionUserPreferencesMac.mm: (WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Calculate track language score according to user preferences. * platform/Language.cpp: (WebCore::indexOfBestMatchingLanguageInList): Repurposed the static bestMatchingLanguage function to return the location of a language in a Vector. (WebCore::preferredLanguageFromList): Removed. * platform/Language.h: 2013-03-22 ChangSeok Oh Build fix for TransformationMatrix https://bugs.webkit.org/show_bug.cgi?id=113087 Reviewed by Martin Robinson. This is a trivial build fix for clutter ac backend. Clutter AC backend doesn't use TextureMapper so there is nowhere including TransformationMatrix.h. For the reason, we include it explicitly. No new tests because of no functionality change. * platform/graphics/clutter/GraphicsContext3DPrivate.cpp: * platform/graphics/clutter/GraphicsContext3DPrivate.h: (WebCore): 2013-03-22 Steve Block Coordinates.idl lacks Conditional=GEOLOCATION https://bugs.webkit.org/show_bug.cgi?id=112949 Reviewed by Steve Block. No new tests, build optimization only. * page/Coordinates.idl: Added GEOLOCATION conditional guard. 2013-03-22 Daniel Cheng Data store should be readable in dragstart/copy/cut events https://bugs.webkit.org/show_bug.cgi?id=23695 Reviewed by Tony Chang. There were several events where data could be written but not read back due to the fact that different Clipboard method implementations checked permissions inconsistently. This patch adds helper methods to check if an operation is permitted on a Clipboard and refactors all direct comparisons against Clipboard::m_policy to use the new helpers instead. This fixes several bugs where Clipboard::types and Clipboard::getData are not usable inside the aforementioned events. Tests: editing/pasteboard/can-read-in-copy-and-cut-events.html editing/pasteboard/can-read-in-dragstart-event.html * dom/Clipboard.cpp: (WebCore::Clipboard::canReadTypes): Formerly restricted to ClipboardReadable and ClipboardTypesReadable; now allows ClipboardWritable as well. (WebCore::Clipboard::canReadData): Formerly restricted to ClipboardReadable; now allows ClipboardWritable as well. (WebCore::Clipboard::canWriteData): (WebCore::Clipboard::canSetDragImage): (WebCore::Clipboard::hasFileOfType): (WebCore::Clipboard::hasStringOfType): (WebCore::Clipboard::setDropEffect): (WebCore::Clipboard::setEffectAllowed): * dom/Clipboard.h: (Clipboard): * platform/blackberry/ClipboardBlackBerry.cpp: (WebCore::ClipboardBlackBerry::clearData): (WebCore::ClipboardBlackBerry::clearAllData): (WebCore::ClipboardBlackBerry::getData): (WebCore::ClipboardBlackBerry::setData): (WebCore::ClipboardBlackBerry::types): * platform/chromium/ClipboardChromium.cpp: (WebCore::DataTransferItemPolicyWrapper::kind): (WebCore::DataTransferItemPolicyWrapper::type): (WebCore::DataTransferItemPolicyWrapper::getAsString): (WebCore::DataTransferItemPolicyWrapper::getAsFile): (WebCore::ClipboardChromium::clearData): (WebCore::ClipboardChromium::clearAllData): (WebCore::ClipboardChromium::getData): (WebCore::ClipboardChromium::setData): (WebCore::ClipboardChromium::types): (WebCore::ClipboardChromium::files): (WebCore::ClipboardChromium::setDragImage): * platform/gtk/ClipboardGtk.cpp: (WebCore::ClipboardGtk::clearData): (WebCore::ClipboardGtk::clearAllData): (WebCore::ClipboardGtk::getData): (WebCore::ClipboardGtk::setData): (WebCore::ClipboardGtk::types): (WebCore::ClipboardGtk::files): (WebCore::ClipboardGtk::setDragImage): * platform/mac/ClipboardMac.mm: (WebCore::ClipboardMac::clearData): (WebCore::ClipboardMac::clearAllData): (WebCore::ClipboardMac::getData): (WebCore::ClipboardMac::setData): (WebCore::ClipboardMac::types): (WebCore::ClipboardMac::files): (WebCore::ClipboardMac::setDragImage): * platform/qt/ClipboardQt.cpp: (WebCore::ClipboardQt::clearData): (WebCore::ClipboardQt::clearAllData): (WebCore::ClipboardQt::getData): (WebCore::ClipboardQt::setData): (WebCore::ClipboardQt::types): (WebCore::ClipboardQt::files): (WebCore::ClipboardQt::setDragImage): (WebCore::ClipboardQt::items): * platform/qt/DataTransferItemListQt.cpp: (WebCore::DataTransferItemListQt::length): (WebCore::DataTransferItemListQt::item): (WebCore::DataTransferItemListQt::deleteItem): (WebCore::DataTransferItemListQt::clear): (WebCore::DataTransferItemListQt::add): * platform/qt/DataTransferItemQt.cpp: (WebCore::DataTransferItemQt::getAsString): * platform/win/ClipboardWin.cpp: (WebCore::ClipboardWin::clearData): (WebCore::ClipboardWin::clearAllData): (WebCore::ClipboardWin::getData): (WebCore::ClipboardWin::setData): (WebCore::ClipboardWin::types): (WebCore::ClipboardWin::files): (WebCore::ClipboardWin::setDragImage): 2013-03-22 Andrei Bucur [CSS Regions] Remove pushLayoutState(RenderFlowThread*) from RenderView https://bugs.webkit.org/show_bug.cgi?id=113084 Reviewed by Dirk Schulze. Remove void pushLayoutState(RenderFlowThread*, bool regionsChanged) from RenderView.h because it's not used. Tests: Code cleanup. No tests needed. * rendering/RenderView.h: (RenderView): 2013-03-22 Kondapally Kalyan [EFL] Fix build issues to enable CSS Filter and Shaders support. https://bugs.webkit.org/show_bug.cgi?id=111274 Reviewed by Noam Rosenthal. This is in preperation to enable CSS Filter and Shaders support. This patch fixes related build issues to enable the support. * platform/graphics/surfaces/efl/GLTransportSurface.cpp: * platform/graphics/texmap/TextureMapper.cpp: * platform/graphics/texmap/TextureMapper.h: (WebCore): * platform/graphics/texmap/TextureMapperGL.cpp: * platform/graphics/texmap/TextureMapperGL.h: (WebCore): * platform/graphics/texmap/TextureMapperShaderProgram.h: 2013-03-22 Matt Falkenhagen Implement isEnabledFormControl() for SliderThumbElement and SpinButtonElement in terms of disabled() https://bugs.webkit.org/show_bug.cgi?id=112993 Reviewed by Kent Tamura. This is an intermediate step for refactoring Node::disabled and Element::isEnabledFormControl. All classes that override isEnabledFormControl just return !disabled(), except for SliderThumbElement and SpinButtonElement. This patch changes those two classes to do so, which shows that the two functions are redundant and easy to refactor into a single function in a subsequent patch. No new tests, there should be no behavior change. * html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::disabled): (WebCore): (WebCore::SliderThumbElement::isEnabledFormControl): * html/shadow/SliderThumbElement.h: (SliderThumbElement): * html/shadow/SpinButtonElement.h: The check of shadowHost() is necessary because it can be detached by JavaScript that runs during event handling (see r76566) 2013-03-22 Allan Sandfeld Jensen [Qt] New fast/text/word-space-with-kerning-3.html fails on Qt. https://bugs.webkit.org/show_bug.cgi?id=112668 Reviewed by Jocelyn Turcotte. Qt adds word-spacing to leading spaces, but WebCore only expects us to add for trailing spaces. We only corrected for this in width calculation but do need to also do it for drawing. Instead of subtracting the extra word-spacing we now configure the FormatRange not to apply to leading spaces. This means this behavior will be applied everywhere reliably. * platform/graphics/Font.h: (Font): * platform/graphics/qt/FontQt.cpp: (WebCore::Font::drawComplexText): (WebCore::Font::floatWidthForComplexText): (WebCore::Font::offsetForPositionForComplexText): (WebCore::Font::selectionRectForComplexText): (WebCore::Font::initFormatForTextLayout): 2013-03-22 Joshua Bell REGRESSION (r146540?): Crashes in storage/indexeddb/factory-basics-workers.html, storage/indexeddb/transaction-error.html https://bugs.webkit.org/show_bug.cgi?id=113019 Reviewed by Tony Chang. Also manifesting flakily under Chromium's content_shell. It's an ASSERT being hit in the IDBTransaction destructor. The cause was r146540 which allows a stopped context to reclaim script wrappers. This allows the IDBTransaction to be deref'd at times where it previously would have just leaked. Modulate the destructor assertions to account for this case. No new tests; failures already manifest as flaky crashes in some ports. * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::~IDBTransaction): If context is stopped, expected state transitions/cleanup may not have occurred before destructor runs. 2013-03-22 David Grogan IndexedDB: Histogram available disk space on attempt to open database https://bugs.webkit.org/show_bug.cgi?id=112862 Reviewed by Tony Chang. ChromeOS suspects they might be hitting disk corruption when the disks are nearly full. This patch logs the available space to either the "success" or the "fail" histogram as appropriate so that the distributions can be compared. No new tests - I don't know of a good way to test histograms. Local printf testing didn't turn up any bugs. * platform/leveldb/LevelDBDatabase.cpp: (WebCore::HistogramFreeSpace): (WebCore): (WebCore::LevelDBDatabase::open): 2013-03-22 Nate Chapin REGRESSION (r146239): Reproducible crash in WebCore::DocumentLoader::responseReceived. https://bugs.webkit.org/show_bug.cgi?id=112811 Reviewed by Brady Eidson. Test: http/tests/cache/x-frame-options-304.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::switchClientsToRevalidatedResource): * loader/cache/CachedRawResource.h: 2013-03-22 Jer Noble REGRESSION: -webkit-box-reflect does not show on video elements https://bugs.webkit.org/show_bug.cgi?id=112397 Reviewed by Eric Carlson. Work around the ASSERTs generated when setting an AVPlayerLayer's player property during a CA flush by setting the player property during the next runloop, outside of a CA flush. * platform/graphics/ca/mac/PlatformCALayerMac.mm: (PlatformCALayer::clone): 2013-03-22 peavo@outlook.com [Curl] Performance fix, avoid loading cookie file on every request. https://bugs.webkit.org/show_bug.cgi?id=113023 Reviewed by Brent Fulgham. We currently load the cookie file on every request, and when setting cookies from JavaScript, by using the option CURLOPT_COOKIEFILE. This is very inefficient as the cookie file can get quite large, and file I/O is slow. It is sufficient to load the cookie file on startup, as we use a shared cookie database between the requests. * platform/network/curl/CookieJarCurl.cpp: (WebCore::setCookiesFromDOM): Avoid loading cookie file when setting cookies from JavaScript. * platform/network/curl/ResourceHandleManager.cpp: (WebCore::ResourceHandleManager::initializeHandle): Avoid loading cookie file on every request. (WebCore::ResourceHandleManager::initCookieSession): Load the cookie file to shared database on startup. 2013-03-22 Tiancheng Jiang [BlackBerry] Update Input field Background Color https://bugs.webkit.org/show_bug.cgi?id=113063 Reviewed by George Staikos. RIM PR 307463. Internally reviewed by Ed Baker. * platform/blackberry/RenderThemeBlackBerry.cpp: (WebCore::RenderThemeBlackBerry::paintTextFieldOrTextAreaOrSearchField): 2013-03-22 Ilya Tikhonovsky Web Inspector: FlameChart. Draw function names over flame chart bar if they fit into the bar. https://bugs.webkit.org/show_bug.cgi?id=113052 Reviewed by Vsevolod Vlasov. The draw function will draw the bar title if the text is less than bar width. Unfortunately almost all the projects which need to be profiled use long function names with dots. So if the function name has dots and doesn't fit into the space then prepareTitle will try to drop the prefix before dot. If the title has no dots then the function will strip the tail of the title. * inspector/front-end/FlameChart.js: (WebInspector.FlameChart): (WebInspector.FlameChart.prototype.draw): (WebInspector.FlameChart.prototype._prepareTitle): 2013-03-22 Vladislav Kaznacheev Web Inspector: Add "hidden" attribute to the recently added APIs in Inspector.json https://bugs.webkit.org/show_bug.cgi?id=113061 Added "hidden": true to the APIs introduced since version 1.0. Reviewed by Pavel Feldman. * inspector/Inspector.json: 2013-03-22 Vsevolod Vlasov Web Inspector: Correctly implement scrollToLine, revealLine and setSelection on CodeMirror editor. https://bugs.webkit.org/show_bug.cgi?id=113028 Reviewed by Pavel Feldman. Added focus event handler to CodeMirror editor view elememnt to support inspector's focus model. Added selection and scroll listeners to correctly save editor scroll and selection in history. Implemented revealLine, scrollToLine and setSelection. Note: CodeMirror's coordsChar method does not work correctly in "local" mode, implemented as binary search as a temporary workaround. * inspector/front-end/CodeMirrorTextEditor.js: (WebInspector.CodeMirrorTextEditor): (WebInspector.CodeMirrorTextEditor.prototype.defaultFocusedElement): (WebInspector.CodeMirrorTextEditor.prototype._handleElementFocus): (WebInspector.CodeMirrorTextEditor.prototype.revealLine): (WebInspector.CodeMirrorTextEditor.prototype._coordsChar): (WebInspector.CodeMirrorTextEditor.prototype._topScrolledLine): (WebInspector.CodeMirrorTextEditor.prototype._bottomScrolledLine): (WebInspector.CodeMirrorTextEditor.prototype._scroll): (WebInspector.CodeMirrorTextEditor.prototype._selectionChange): (WebInspector.CodeMirrorTextEditor.prototype.scrollToLine): (WebInspector.CodeMirrorTextEditor.prototype.setSelection): (WebInspector.CodeMirrorTextEditor.prototype.copyRange): * inspector/front-end/TextEditor.js: (WebInspector.TextEditor.prototype.copyRange): 2013-03-22 Vsevolod Vlasov Web Inspector: [Regression] Editor scroll is not restored after inspector reload. https://bugs.webkit.org/show_bug.cgi?id=113027 Reviewed by Pavel Feldman. * inspector/front-end/SourceFrame.js: (WebInspector.SourceFrame.prototype.wasShown): (WebInspector.SourceFrame.prototype._isEditorShowing): (WebInspector.SourceFrame.prototype._innerHighlightLineIfNeeded): (WebInspector.SourceFrame.prototype._innerRevealLineIfNeeded): (WebInspector.SourceFrame.prototype._innerScrollToLineIfNeeded): (WebInspector.SourceFrame.prototype._innerSetSelectionIfNeeded): 2013-03-22 Allan Sandfeld Jensen [Qt] Fix build with OPENCL 1.2 https://bugs.webkit.org/show_bug.cgi?id=113056 Reviewed by Kenneth Rohde Christiansen. Switch qmake checks to the modern style which means we can enable OpenCL with WEBKIT_CONFIG+=opencl. Upgrade OpenCL 1.1 clCreateImage2D to OpenCL 1.2 clCreateImage calls. * Target.pri: * WebCore.pri: * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::createOpenCLImageResult): * platform/graphics/gpu/opencl/FilterContextOpenCL.cpp: (WebCore::FilterContextOpenCL::createOpenCLImage): 2013-03-22 ChangSeok Oh [GTK][AC] Opacity animation doesn't work with clutter backend https://bugs.webkit.org/show_bug.cgi?id=110347 Reviewed by Gustavo Noronha Silva. The static casting in ternary operator doesn't change actual inputted argument type. So I replaced it with if-else statement. Covered by existing animation tests. * platform/graphics/clutter/PlatformClutterAnimation.cpp: (WebCore::PlatformClutterAnimation::addClutterTransitionForProperty): (WebCore::PlatformClutterAnimation::addClutterKeyframeTransitionForProperty): 2013-03-22 ChangSeok Oh [GTK][AC] Add removing animations procedure with clutter ac backend https://bugs.webkit.org/show_bug.cgi?id=110607 Reviewed by Gustavo Noronha Silva. This changes is based on mac port implementation. The only different thing is that updateAnimations is called explicitly in destructor of GraphicsLayerClutter to remove uncommitted animations. Because even though we call notifyFlushRequired to remove existing animations in removeAnimation(), removeClutterAnimationFromLayer has been never reached since the root layer is destroyed before. It means that we haven't lost a change to remove actual animations from clutterActor. Covered by existing animation tests. * platform/graphics/clutter/GraphicsLayerClutter.cpp: (WebCore::GraphicsLayerClutter::~GraphicsLayerClutter): (WebCore::GraphicsLayerClutter::removeAnimation): (WebCore): (WebCore::GraphicsLayerClutter::removeClutterAnimationFromLayer): * platform/graphics/clutter/GraphicsLayerClutter.h: (WebCore::GraphicsLayerClutter::animationIsRunning): (GraphicsLayerClutter): 2013-03-22 Kondapally Kalyan [EFL][WebGL] Optimize AlphaOp for HTMLVideoElement input. https://bugs.webkit.org/show_bug.cgi?id=113049 Reviewed by Kenneth Rohde Christiansen. Covered by existing tests. Changeset 137397 implemented optimisation to avoid any unnecessary Unmultiply or Premultiply operation in unpack/pack provided the Image source is from HTMLVideoElement. This patch enables the same for EFL port. * platform/graphics/efl/GraphicsContext3DEfl.cpp: (WebCore::GraphicsContext3D::ImageExtractor::extractImage): 2013-03-22 Tommy Widenflycht Clean up the speech recognintion API https://bugs.webkit.org/show_bug.cgi?id=112916 Reviewed by Adam Barth. This patch cleans away deprecated parts, fixes so that stop() can be called more than once and adds the missing emma attribute on SpeechRecognitionEvent (which is always null). Patch covered by existing tests. * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::stopFunction): (WebCore::SpeechRecognition::abort): (WebCore::SpeechRecognition::didEnd): (WebCore::SpeechRecognition::SpeechRecognition): * Modules/speech/SpeechRecognition.h: (SpeechRecognition): * Modules/speech/SpeechRecognitionEvent.cpp: (WebCore::SpeechRecognitionEvent::createResult): (WebCore::SpeechRecognitionEvent::createNoMatch): (WebCore::SpeechRecognitionEvent::SpeechRecognitionEvent): * Modules/speech/SpeechRecognitionEvent.h: (WebCore): (SpeechRecognitionEventInit): (SpeechRecognitionEvent): (WebCore::SpeechRecognitionEvent::emma): * Modules/speech/SpeechRecognitionEvent.idl: 2013-03-22 Emil A Eklund Floor cell widths in AutoTableLayout::recalcColumn https://bugs.webkit.org/show_bug.cgi?id=112922 Reviewed by Levi Weintraub. Table cells widths are floored to ensure even distribution of available space across columns. The code path that computes the width of the _table_ failed to take this into account and thus can over report the total width of the table. Test: fast/sub-pixel/table-with-subpixel-cell-size.html * rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::recalcColumn): Floor width to match column sizing logic. 2013-03-22 David Kilzer BUILD FIX (r146208): Export shouldPrintExceptions methods for iOS Fixes the following build failure: Undefined symbols for architecture i386: "__ZN7WebCore11PageConsole24setShouldPrintExceptionsEb", referenced from: +[WebCoreStatistics setShouldPrintExceptions:] in WebCoreStatistics.o "__ZN7WebCore11PageConsole21shouldPrintExceptionsEv", referenced from: +[WebCoreStatistics shouldPrintExceptions] in WebCoreStatistics.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) * WebCore.exp.in: Move symbols so they're exported for iOS as well. 2013-03-22 Yury Semikhatsky Unreviewed. Fix Chromium Win compilation after r146583. * bindings/v8/CustomElementHelpers.cpp: (WebCore::CustomElementHelpers::invokeReadyCallbackIfNeeded): 2013-03-22 Ilya Tikhonovsky Web Inspector: Flame Chart. Chart has to be zoomed around the mouse pointer. https://bugs.webkit.org/show_bug.cgi?id=113031 Reviewed by Yury Semikhatsky. Overview grid is able to zoom around the mouse pointer. So the simplest way is to translate x coordinate of the mouse pointer hovered over the chart to x coordinate in term of overview window and pass it to the zoom function. Minor unrelated fix: draw small border at bottom of the overview grid. * inspector/front-end/FlameChart.js: (WebInspector.FlameChart.prototype._onMouseWheel): * inspector/front-end/OverviewGrid.js: (WebInspector.OverviewGrid.prototype.zoom): * inspector/front-end/flameChart.css: (#flame-chart-overview-container): 2013-03-22 No'am Rosenthal [Texmap] TextureMapperImageBuffer should not use rendering code for filters. https://bugs.webkit.org/show_bug.cgi?id=113040 Reviewed by Kenneth Rohde Christiansen. Disable TextureMapperImageBuffer filters, until they can be done the right way. This should only disrupt accelerated filters in fallback mode, which is a very rare use case. No new testable functionality. * platform/graphics/texmap/TextureMapperImageBuffer.cpp: (WebCore::BitmapTextureImageBuffer::applyFilters): 2013-03-22 Sergey Ryazanov Web Inspector: Report more CSS errors https://bugs.webkit.org/show_bug.cgi?id=113022 Reviewed by Pavel Feldman. Reporting next few CSS syntax errors in declaration_list. * css/CSSGrammar.y.in: 2013-03-18 Yury Semikhatsky Web Inspector: use individual samples to construct CPU profile flame chart https://bugs.webkit.org/show_bug.cgi?id=112569 Reviewed by Pavel Feldman. Added an optional array of samples to the CPU profile returned over the protocol. Each sample is id of the profile node corresponding to the top frame of the sample's stack trace. The array of samples if present is used to draw the flame chart on the CPU profile panel, otherwise flame chart is drawn based on the aggregated profile data. * bindings/js/ScriptProfile.cpp: (WebCore::ScriptProfile::buildInspectorObjectForSamples): * bindings/js/ScriptProfile.h: (ScriptProfile): * bindings/v8/ScriptProfile.cpp: (WebCore::buildInspectorObjectFor): (WebCore): (WebCore::ScriptProfile::buildInspectorObjectForSamples): * bindings/v8/ScriptProfile.h: (ScriptProfile): * bindings/v8/ScriptProfiler.cpp: (WebCore::ScriptProfiler::start): * inspector/Inspector.json: * inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::getCPUProfile): * inspector/front-end/CPUProfileView.js: (WebInspector.CPUProfileView.prototype._getCPUProfileCallback): (WebInspector.CPUProfileView.prototype._buildIdToNodeMap): * inspector/front-end/FlameChart.js: (WebInspector.FlameChart.prototype._calculateTimelineData): 2013-03-22 Steve Block Use generated bindings for the Coordinates type used by Geolocation https://bugs.webkit.org/show_bug.cgi?id=112975 Reviewed by Kentaro Hara. No new tests, refactoring only. * CMakeLists.txt: * GNUmakefile.list.am: * Modules/geolocation/Coordinates.cpp: Renamed from Source/WebCore/bindings/js/JSCoordinatesCustom.cpp. (WebCore): (WebCore::Coordinates::altitude): (WebCore::Coordinates::altitudeAccuracy): (WebCore::Coordinates::heading): (WebCore::Coordinates::speed): * Modules/geolocation/Coordinates.h: (Coordinates): * Modules/geolocation/Coordinates.idl: * Target.pri: * UseJSC.cmake: * UseV8.cmake: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/v8/custom/V8CoordinatesCustom.cpp: Removed. 2013-03-22 Kunihiko Sakamoto INPUT_MULTIPLE_FIELDS_UI: Incomplete datetime format should fallback to default https://bugs.webkit.org/show_bug.cgi?id=113005 Reviewed by Kent Tamura. Use fallback format when datetime format from locale is not complete. Tests: fast/forms/date-multiple-fields/date-multiple-fields-fallback-format.html fast/forms/datetime-multiple-fields/datetime-multiple-fields-fallback-format.html fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-fallback-format.html fast/forms/month-multiple-fields/month-multiple-fields-fallback-format.html fast/forms/time-multiple-fields/time-multiple-fields-fallback-format.html fast/forms/week-multiple-fields/week-multiple-fields-fallback-format.html * html/BaseMultipleFieldsDateAndTimeInputType.cpp: (DateTimeFormatValidator): A helper class that parses datetime format and tests existence of fields. (WebCore::DateTimeFormatValidator::DateTimeFormatValidator): (WebCore::DateTimeFormatValidator::visitField): (WebCore::DateTimeFormatValidator::validateFormat): Parses datetime format and validates by calling BaseMultipleFieldsDateAndTimeInputType::isValidFormat. (WebCore::BaseMultipleFieldsDateAndTimeInputType::updateInnerTextValue): Checks if dateTimeFormat is valid, and uses fallback format if not. * html/BaseMultipleFieldsDateAndTimeInputType.h: (BaseMultipleFieldsDateAndTimeInputType): Declare isValidFormat. * html/DateInputType.cpp: (WebCore::DateInputType::isValidFormat): Added. * html/DateInputType.h: (DateInputType): * html/DateTimeInputType.cpp: (WebCore::DateTimeInputType::isValidFormat): Added. * html/DateTimeInputType.h: (DateTimeInputType): * html/DateTimeLocalInputType.cpp: (WebCore::DateTimeLocalInputType::isValidFormat): Added. * html/DateTimeLocalInputType.h: (DateTimeLocalInputType): * html/MonthInputType.cpp: (WebCore::MonthInputType::isValidFormat): Added. * html/MonthInputType.h: (MonthInputType): * html/TimeInputType.cpp: (WebCore::TimeInputType::isValidFormat): Added. * html/TimeInputType.h: (TimeInputType): * html/WeekInputType.cpp: (WebCore::WeekInputType::isValidFormat): Added. * html/WeekInputType.h: (WeekInputType): 2013-03-22 Hajime Morrita Custom Elements: "readyCallback" lifecycle callback should be called. https://bugs.webkit.org/show_bug.cgi?id=112538 Reviewed by Elliott Sprehn. This change allows each custom element definition to hook up its instantiation, namely "readyCallback" lifecycle callback. The change has two parts: - 1. Tracking which Element objects to be created. - 2. Invoking appropriate JavaScript functions, which are readyCallback(), before the Element object is visible from page script. For 1, CustomElementRegistry maintains list of "callback invocaions". Each list item ("invocation") tracks the element which has a lifecycle callback to be invoked. Each invocation is registered when - Any custom element C++ object is instantiated. See changes on CustomElementConstructor.cpp. This also happens when @is attribute is set by the parser or node cloning routine, which can turn a non-custom element into a type-extended custom element. See changes on Element.cpp. For 2, CustomElementRegistry basically follows what MutationObserver is doing, and introduces a method called deliverLifecycleCallbacks(). This function flushes all pending callback invocations. You can think it as a dual of MutationObserver::deliverAllMutations(). The delivery function is called places where MutationObserver's deliverAllMutations() is called. In addition, it is also called just before returning from a set of DOM APIs. For example, it is called just before createElement() returns, so that possibly created custom element becomes ready through its readyCallback(). Such APIs get "V8DeliverCustomElementCallbacks" IDL attribute. In principle, APIs which can create new custom element instnaces are marked. See CustomElementRegistry::CallbackDeliveryScope and changes on CodeGeneratorV8.pm. We need this extra work because the readyCallback() needs to give an illusion so that JavaScript programmers feel like the readyCallback() callback being called just after it is created, instead of called on arbitrary late timing like MutationObserver notifications. Tests: fast/dom/custom/lifecycle-ready-createElement-recursion.html fast/dom/custom/lifecycle-ready-createElement-reentrancy.html fast/dom/custom/lifecycle-ready-creation-api.html fast/dom/custom/lifecycle-ready-innerHTML.html fast/dom/custom/lifecycle-ready-parser-only.html fast/dom/custom/lifecycle-ready-parser-script.html fast/dom/custom/lifecycle-ready-paste.html * bindings/scripts/CodeGeneratorV8.pm: - Hooked up CallbackDeliveryScope through V8DeliverCustomElementCallbacks attriute. (GenerateCustomElementInvocationScopeIfNeeded): (GenerateNormalAttrSetter): (GenerateFunction): * bindings/scripts/IDLAttributes.txt: * bindings/v8/CustomElementHelpers.cpp: (WebCore::CustomElementHelpers::invokeReadyCallbackIfNeeded): (WebCore::CustomElementHelpers::invokeReadyCallbacksIfNeeded): * bindings/v8/CustomElementHelpers.h: (CustomElementHelpers): * bindings/v8/V8RecursionScope.cpp: Added deliverAllLifecycleCallbacks() (WebCore::V8RecursionScope::didLeaveScriptContext): * dom/CustomElementConstructor.cpp: (WebCore::CustomElementConstructor::createElement): (WebCore::CustomElementConstructor::createElementInternal): * dom/CustomElementConstructor.h: (WebCore::CustomElementConstructor::isExtended): (CustomElementConstructor): * dom/CustomElementRegistry.cpp: Adding element tracking and invocation execution. (WebCore::CustomElementInvocation::CustomElementInvocation): (WebCore::CustomElementInvocation::~CustomElementInvocation): (WebCore::activeCustomElementRegistries): (WebCore::CustomElementRegistry::~CustomElementRegistry): (WebCore::CustomElementRegistry::didGiveTypeExtension): (WebCore::CustomElementRegistry::didCreateElement): (WebCore::CustomElementRegistry::activate): (WebCore::CustomElementRegistry::deactivate): (WebCore::CustomElementRegistry::deliverLifecycleCallbacks): (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacks): * dom/CustomElementRegistry.h: (CustomElementInvocation): (WebCore::CustomElementInvocation::element): (CallbackDeliveryScope): (WebCore::CustomElementRegistry::CallbackDeliveryScope::CallbackDeliveryScope): (WebCore::CustomElementRegistry::CallbackDeliveryScope::~CallbackDeliveryScope): (CustomElementRegistry): (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacksIfNeeded): * dom/Document.cpp: (WebCore::Document::createElement): (WebCore::Document::didCreateCustomElement): * dom/Document.h: (Document): * dom/Document.idl: * dom/Element.cpp: (WebCore::Element::attributeChangedFromParserOrByCloning): Added to catch @is attribute (WebCore::Element::parserSetAttributes): (WebCore::Element::cloneAttributesFromElement): * dom/Element.h: * dom/Node.idl: * dom/ShadowRoot.idl: * html/HTMLElement.idl: * html/parser/HTMLScriptRunner.cpp: Added deliverAllLifecycleCallbacks() (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): (WebCore::HTMLScriptRunner::runScript): 2013-03-22 Tommy Widenflycht MediaStream API: Finalize the RTCPeerConnection states https://bugs.webkit.org/show_bug.cgi?id=112792 Reviewed by Adam Barth. This patch finalized the RTCPeerConnection state and events. These changes have not yet pushed out to the editors draft; but they are uncontroversial and agreed upon. readyState will be deleted; please use the replacement signalingState which is already available. onstatechange -> onsignalingstatechange onicechange -> oniceconnectionstatechange ongatheringchange will be deleted since oniceconnectionstatechange can be used for the same purpose. RTCIceConnectionState::"starting" -> RTCIceConnectionState::"new" Patch covered by modified tests. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::RTCPeerConnection): (WebCore::RTCPeerConnection::iceConnectionState): (WebCore::RTCPeerConnection::changeSignalingState): (WebCore::RTCPeerConnection::changeIceGatheringState): (WebCore::RTCPeerConnection::changeIceConnectionState): * Modules/mediastream/RTCPeerConnection.h: (RTCPeerConnection): * Modules/mediastream/RTCPeerConnection.idl: * dom/EventNames.h: (WebCore): * platform/mediastream/RTCPeerConnectionHandlerClient.h: 2013-03-22 Mike West Prefer 'KURL(ParsedURLString, String)' when dealing with known-good data. https://bugs.webkit.org/show_bug.cgi?id=112965 Reviewed by Alexey Proskuryakov. In https://bugs.webkit.org/show_bug.cgi?id=112783#c6, Adam noted that it would be possible to use 'KURL(ParsedURLString, [url])' rather than 'KURL(KURL(), [url])', since we knew that the URL in question is a value and absolute URL. This patch fixes the obvious instances of this pattern; there are several more 'KURL(KURL(), String)' calls in WebCore but these were the only places I was reasonably sure that bad data couldn't creep in. * dom/Document.cpp: (WebCore::Document::updateBaseURL): 'documentURI' is pulled from 'url()->string()'. It's safe. * page/ContentSecurityPolicy.cpp: (WebCore::gatherSecurityPolicyViolationEventData): (WebCore::ContentSecurityPolicy::reportViolation): 'CallFrame::sourceURL()' is a known valid/absolute URL. * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::createFromDatabaseIdentifier): (WebCore::SecurityOrigin::create): The strings constructed here are certainly valid. 2013-03-22 Ilya Tikhonovsky Web Inspector: Flame Chart. move overview window when user scrolls the chart. https://bugs.webkit.org/show_bug.cgi?id=113014 Reviewed by Yury Semikhatsky. I found that I could use scaling mechanics in OverviewGrid for scaling the chart. But the dragging part was not so simple due to the different approaches in OverviewGrid and FlameChart. OverviewGrid used _windowLeft and _windowRight when FlameChart used _xOffset and _xScaleFactor and width. It was not practical and I rewrote the FlameChart mechanics and now it also uses _windowLeft _windowRight. * inspector/front-end/FlameChart.js: (WebInspector.FlameChart): (WebInspector.FlameChart.Calculator.prototype._updateBoundaries): (WebInspector.FlameChart.Calculator.prototype.computePosition): (WebInspector.FlameChart.prototype._onWindowChanged): (WebInspector.FlameChart.prototype._startCanvasDragging): (WebInspector.FlameChart.prototype._canvasDragging): (WebInspector.FlameChart.prototype._onMouseMove): (WebInspector.FlameChart.prototype._onMouseWheel): (WebInspector.FlameChart.prototype._coordinatesToNodeIndex): (WebInspector.FlameChart.prototype._drawOverviewCanvas): (WebInspector.FlameChart.prototype.draw): (WebInspector.FlameChart.prototype._updateBoundaries): (WebInspector.FlameChart.prototype.update): * inspector/front-end/OverviewGrid.js: (WebInspector.OverviewGrid.prototype.setWindowPosition): (WebInspector.OverviewGrid.prototype.setWindow): (WebInspector.OverviewGrid.prototype.addEventListener): (WebInspector.OverviewGrid.prototype.zoom): (WebInspector.OverviewGrid.Window.prototype._zoom): * inspector/front-end/inspectorCommon.css: (.overview-grid-window-rulers): 2013-03-22 Steve Block Move GeolocationClient.h to Modules/geolocation/ https://bugs.webkit.org/show_bug.cgi?id=112997 Reviewed by Kentaro Hara. No new tests, no functional change. * GNUmakefile.list.am: * Modules/geolocation/GeolocationClient.h: Renamed from Source/WebCore/page/GeolocationClient.h. (WebCore): (GeolocationClient): (WebCore::GeolocationClient::~GeolocationClient): * WebCore.vcproj/WebCore.vcproj: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: 2013-03-22 Sheriff Bot Unreviewed, rolling out r146534 and r146565. http://trac.webkit.org/changeset/146534 http://trac.webkit.org/changeset/146565 https://bugs.webkit.org/show_bug.cgi?id=113017 "r146534 caused perf regression on Chromium Linux x64" (Requested by yurys on #webkit). * bindings/scripts/CodeGeneratorV8.pm: (GenerateNormalAttrSetter): (GenerateOverloadedFunction): (GenerateFunctionCallback): (GenerateFunction): (GenerateParametersCheck): (GenerateSingleConstructorCallback): (GenerateNonStandardFunction): (GenerateImplementation): (GenerateFunctionCallString): * bindings/scripts/IDLAttributes.txt: * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore): * bindings/scripts/test/V8/V8TestTypedefs.cpp: (WebCore): * bindings/v8/CustomElementHelpers.cpp: * bindings/v8/CustomElementHelpers.h: (WebCore): (CustomElementHelpers): * bindings/v8/V8DOMConfiguration.cpp: (WebCore::V8DOMConfiguration::batchConfigureCallbacks): (WebCore::V8DOMConfiguration::configureTemplate): * bindings/v8/V8DOMConfiguration.h: (BatchedMethod): (V8DOMConfiguration): * bindings/v8/V8RecursionScope.cpp: (WebCore::V8RecursionScope::didLeaveScriptContext): * dom/CustomElementConstructor.cpp: (WebCore::CustomElementConstructor::createElement): * dom/CustomElementConstructor.h: (CustomElementConstructor): * dom/CustomElementRegistry.cpp: (WebCore::CustomElementRegistry::~CustomElementRegistry): * dom/CustomElementRegistry.h: (WebCore): (CustomElementRegistry): * dom/Document.cpp: (WebCore::Document::createElement): (WebCore::Document::registerElement): * dom/Document.h: * dom/Document.idl: * dom/Element.cpp: (WebCore::Element::parserSetAttributes): (WebCore::Element::cloneAttributesFromElement): * dom/Element.h: * dom/Element.idl: * dom/Node.idl: * dom/ShadowRoot.idl: * html/HTMLElement.idl: * html/parser/HTMLScriptRunner.cpp: (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): (WebCore::HTMLScriptRunner::runScript): 2013-03-22 Sudarsana Nagineni [GStreamer] Memory leak in AudioFileReader::createBus() https://bugs.webkit.org/show_bug.cgi?id=112925 Reviewed by Martin Robinson. Adopt the reference returned by g_timeout_source_new() to fix a memory leak. No new tests. No change in behavior. * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: (WebCore::AudioFileReader::createBus): 2013-03-22 Steve Block Move page/Coordinates.[h|idl] to Modules/geolocation/ https://bugs.webkit.org/show_bug.cgi?id=112945 Reviewed by Kentaro Hara. No new tests, no functional change. * CMakeLists.txt: * DerivedSources.make: * DerivedSources.pri: * GNUmakefile.list.am: * Modules/geolocation/Coordinates.h: Renamed from Source/WebCore/page/Coordinates.h. (WebCore): (Coordinates): (WebCore::Coordinates::create): (WebCore::Coordinates::isolatedCopy): (WebCore::Coordinates::latitude): (WebCore::Coordinates::longitude): (WebCore::Coordinates::altitude): (WebCore::Coordinates::accuracy): (WebCore::Coordinates::altitudeAccuracy): (WebCore::Coordinates::heading): (WebCore::Coordinates::speed): (WebCore::Coordinates::canProvideAltitude): (WebCore::Coordinates::canProvideAltitudeAccuracy): (WebCore::Coordinates::canProvideHeading): (WebCore::Coordinates::canProvideSpeed): (WebCore::Coordinates::Coordinates): * Modules/geolocation/Coordinates.idl: Renamed from Source/WebCore/page/Coordinates.idl. * Target.pri: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.xcodeproj/project.pbxproj: 2013-03-21 Hajime Morrita Custom Elements: "readyCallback" lifecycle callback should be called. https://bugs.webkit.org/show_bug.cgi?id=112538 Reviewed by Elliott Sprehn. This change allows each custom element definition to hook up its instantiation, namely "readyCallback" lifecycle callback. The change has two parts: - 1. Tracking which Element objects to be created. - 2. Invoking appropriate JavaScript functions, which are readyCallback(), before the Element object is visible from page script. For 1, CustomElementRegistry maintains list of "callback invocaions". Each list item ("invocation") tracks the element which has a lifecycle callback to be invoked. Each invocation is registered when - Any custom element C++ object is instantiated. See changes on CustomElementConstructor.cpp. This also happens when @is attribute is set by the parser or node cloning routine, which can turn a non-custom element into a type-extended custom element. See changes on Element.cpp. For 2, CustomElementRegistry basically follows what MutationObserver is doing, and introduces a method called deliverLifecycleCallbacks(). This function flushes all pending callback invocations. You can think it as a dual of MutationObserver::deliverAllMutations(). The delivery function is called places where MutationObserver's deliverAllMutations() is called. In addition, it is also called just before returning from a set of DOM APIs. For example, it is called just before createElement() returns, so that possibly created custom element becomes ready through its readyCallback(). Such APIs get "V8DeliverCustomElementCallbacks" IDL attribute. In principle, APIs which can create new custom element instnaces are marked. See CustomElementRegistry::CallbackDeliveryScope and changes on CodeGeneratorV8.pm. We need this extra work because the readyCallback() needs to give an illusion so that JavaScript programmers feel like the readyCallback() callback being called just after it is created, instead of called on arbitrary late timing like MutationObserver notifications. Tests: fast/dom/custom/lifecycle-ready-createElement-recursion.html fast/dom/custom/lifecycle-ready-createElement-reentrancy.html fast/dom/custom/lifecycle-ready-creation-api.html fast/dom/custom/lifecycle-ready-innerHTML.html fast/dom/custom/lifecycle-ready-parser-only.html fast/dom/custom/lifecycle-ready-parser-script.html fast/dom/custom/lifecycle-ready-paste.html * bindings/scripts/CodeGeneratorV8.pm: - Hooked up CallbackDeliveryScope through V8DeliverCustomElementCallbacks attriute. (GenerateCustomElementInvocationScopeIfNeeded): (GenerateNormalAttrSetter): (GenerateFunction): * bindings/scripts/IDLAttributes.txt: * bindings/v8/CustomElementHelpers.cpp: (WebCore::CustomElementHelpers::invokeReadyCallbackIfNeeded): (WebCore::CustomElementHelpers::invokeReadyCallbacksIfNeeded): * bindings/v8/CustomElementHelpers.h: (CustomElementHelpers): * bindings/v8/V8RecursionScope.cpp: Added deliverAllLifecycleCallbacks() (WebCore::V8RecursionScope::didLeaveScriptContext): * dom/CustomElementConstructor.cpp: (WebCore::CustomElementConstructor::createElement): (WebCore::CustomElementConstructor::createElementInternal): * dom/CustomElementConstructor.h: (WebCore::CustomElementConstructor::isExtended): (CustomElementConstructor): * dom/CustomElementRegistry.cpp: Adding element tracking and invocation execution. (WebCore::CustomElementInvocation::CustomElementInvocation): (WebCore::CustomElementInvocation::~CustomElementInvocation): (WebCore::activeCustomElementRegistries): (WebCore::CustomElementRegistry::~CustomElementRegistry): (WebCore::CustomElementRegistry::didGiveTypeExtension): (WebCore::CustomElementRegistry::didCreateElement): (WebCore::CustomElementRegistry::activate): (WebCore::CustomElementRegistry::deactivate): (WebCore::CustomElementRegistry::deliverLifecycleCallbacks): (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacks): * dom/CustomElementRegistry.h: (CustomElementInvocation): (WebCore::CustomElementInvocation::element): (CallbackDeliveryScope): (WebCore::CustomElementRegistry::CallbackDeliveryScope::CallbackDeliveryScope): (WebCore::CustomElementRegistry::CallbackDeliveryScope::~CallbackDeliveryScope): (CustomElementRegistry): (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacksIfNeeded): * dom/Document.cpp: (WebCore::Document::createElement): (WebCore::Document::didCreateCustomElement): * dom/Document.h: (Document): * dom/Document.idl: * dom/Element.cpp: (WebCore::Element::attributeChangedFromParserOrByCloning): Added to catch @is attribute (WebCore::Element::parserSetAttributes): (WebCore::Element::cloneAttributesFromElement): * dom/Element.h: * dom/Node.idl: * dom/ShadowRoot.idl: * html/HTMLElement.idl: * html/parser/HTMLScriptRunner.cpp: Added deliverAllLifecycleCallbacks() (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): (WebCore::HTMLScriptRunner::runScript): 2013-03-21 Jer Noble Crash in WebCore::MediaPlayer::cachedResourceLoader + 4 https://bugs.webkit.org/show_bug.cgi?id=112977 Reviewed by Geoffrey Garen. Speculative fix for a NULL-dereference crash. MediaPlayerPrivateAVFoundationObjC is the sole owner of a WebCoreAVFLoaderDelegate instance. It releases this instance in its destructor, but it is possible that, on another thread, the AVAssetResourceLoader has already begun using the delegate and in so doing has retained it. By the time the delegate method is fired on the main thread, the MediaPlayerPrivateAVFoundationObjC owner of the delegate has already been deleted, and the delegate's m_callback pointer is now pointing at freed memory. In addition to calling -[AVAssetResourceLoader setDelegate:queue:] to avoid any not-yet-started delegate callbacks, MediaPlayerPrivateAVFoundationObjC should clear the WebCoreAVFLoaderDelegate m_callback ivar, to avoid calling into freed memory for already queued delegate callbacks. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Clear the m_loaderDelegate's callback pointer. (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): Check the value of m_callback before continuing. (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]): Ditto. (-[WebCoreAVFLoaderDelegate setCallback:]): Added simple setter. 2013-03-21 Takashi Sakamoto XMLDocumentParser doesn't parse