diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-23 17:03:15 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-23 17:03:15 +0200 |
commit | a73d1c176f2f3e0458861de8590dc20321a501ae (patch) | |
tree | d897fc5974797c3cb300d7f5916f258df765401f /Source/WebCore | |
parent | c311cf639cc1d6570d67b0a80a8ba04dc992a658 (diff) | |
download | qtwebkit-a73d1c176f2f3e0458861de8590dc20321a501ae.tar.gz |
Imported WebKit commit a5ae8a56a48e44ebfb9b81aaa5488affaffdb175 (http://svn.webkit.org/repository/webkit/trunk@126420)
New snapshot with OS X 10.6 build fix
Diffstat (limited to 'Source/WebCore')
352 files changed, 7675 insertions, 2892 deletions
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt index a7ae94f61..a14c5bea5 100644 --- a/Source/WebCore/CMakeLists.txt +++ b/Source/WebCore/CMakeLists.txt @@ -222,7 +222,9 @@ SET(WebCore_IDL_FILES Modules/mediastream/NavigatorUserMediaErrorCallback.idl Modules/mediastream/NavigatorUserMediaSuccessCallback.idl Modules/mediastream/PeerConnection00.idl + Modules/mediastream/RTCIceCandidate.idl Modules/mediastream/RTCPeerConnection.idl + Modules/mediastream/RTCSessionDescription.idl Modules/mediastream/SessionDescription.idl Modules/networkinfo/NavigatorNetworkInfoConnection.idl @@ -850,7 +852,9 @@ SET(WebCore_SOURCES Modules/mediastream/MediaStreamTrackList.cpp Modules/mediastream/NavigatorMediaStream.cpp Modules/mediastream/PeerConnection00.cpp + Modules/mediastream/RTCIceCandidate.cpp Modules/mediastream/RTCPeerConnection.cpp + Modules/mediastream/RTCSessionDescription.cpp Modules/mediastream/SessionDescription.cpp Modules/mediastream/UserMediaController.cpp Modules/mediastream/UserMediaRequest.cpp @@ -1922,7 +1926,9 @@ SET(WebCore_SOURCES platform/mediastream/MediaHints.cpp platform/mediastream/MediaStreamCenter.cpp platform/mediastream/PeerConnection00Handler.cpp + platform/mediastream/RTCIceCandidateDescriptor.cpp platform/mediastream/RTCPeerConnectionHandler.cpp + platform/mediastream/RTCSessionDescriptionDescriptor.cpp platform/mediastream/SessionDescriptionDescriptor.cpp platform/mock/DeviceMotionClientMock.cpp @@ -2027,6 +2033,7 @@ SET(WebCore_SOURCES rendering/RenderFlexibleBox.cpp rendering/RenderGrid.cpp rendering/RenderFlowThread.cpp + rendering/RenderFlowThreadContainer.cpp rendering/RenderFrame.cpp rendering/RenderFrameBase.cpp rendering/RenderFrameSet.cpp @@ -2083,6 +2090,7 @@ SET(WebCore_SOURCES rendering/RenderTextControlMultiLine.cpp rendering/RenderTextControlSingleLine.cpp rendering/RenderTextFragment.cpp + rendering/RenderTextTrackCue.cpp rendering/RenderTheme.cpp rendering/RenderTreeAsText.cpp rendering/RenderVideo.cpp diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 62be85eb2..32cd892c8 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,2540 @@ +2012-08-23 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed trivial build fix for Qt/Mac on OS X 10.6: Avoid using an + enum value that clashes with an existing class name that's used in the + same file. + + * bridge/qt/qt_runtime.cpp: + (JSC::Bindings::valueRealType): + (JSC::Bindings::convertValueToQVariant): + +2012-08-22 Patrick Gansterer <paroga@webkit.org> + + Build fix for WinCE after r126359. + + * rendering/RenderThemeWinCE.cpp: + +2012-08-23 Dominic Cooney <dominicc@chromium.org> + + Unreviewed, rolling out r126391. + http://trac.webkit.org/changeset/126391 + https://bugs.webkit.org/show_bug.cgi?id=94302 + + Breaks Chromium browser_tests AccessibilityFooter, + AccessibilityListMarkers, AccessibilityUI + + * accessibility/AccessibilityNodeObject.cpp: + * accessibility/AccessibilityNodeObject.h: + (AccessibilityNodeObject): + * accessibility/AccessibilityObject.cpp: + * accessibility/AccessibilityObject.h: + (AccessibilityObject): + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::title): + (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): + (WebCore::AccessibilityRenderObject::isDescendantOfElementType): + * accessibility/AccessibilityRenderObject.h: + (AccessibilityRenderObject): + +2012-08-23 Andrey Adaikin <aandrey@chromium.org> + + Web Inspector: [WebGL] Allow collecting calls for Resource objects affecting their states + https://bugs.webkit.org/show_bug.cgi?id=94686 + + Reviewed by Pavel Feldman. + + Allow collecting calls for WebGL Resource objects affecting their states. + Clone Call's mutable arguments before pushing it to the log. + + * inspector/InjectedScriptWebGLModuleSource.js: + (.): + +2012-08-23 Robin Cao <robin.cao@torchmobile.com.cn> + + [BlackBerry] draw <video> on <canvas> does not work + https://bugs.webkit.org/show_bug.cgi?id=94791 + PR #195866 + + Reviewed by George Staikos. + + Re-implement MediaPlayerPrivate::paintCurrentFrameInContext() in the + blackberry port. This method is mainly called from <canvas>, and it + is supposed to paint video frames using software rendering path. + + On the other hand, MediaPlayerPrivate::paint() will choose accelerated + rendering if possible. + + media/video-canvas-alpha.html covers this. + + * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp: + (WebCore::MediaPlayerPrivate::paint): + (WebCore): + (WebCore::MediaPlayerPrivate::paintCurrentFrameInContext): + * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h: + (MediaPlayerPrivate): + +2012-08-23 Kentaro Hara <haraken@chromium.org> + + Unreviewed. Build fix for r126399. + + * bindings/v8/ScriptInstance.cpp: + +2012-08-23 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: treat 0 cookies as "no cookies" and render it accordingly in the UI + https://bugs.webkit.org/show_bug.cgi?id=94732 + + Reviewed by Yury Semikhatsky. + + * inspector/front-end/RequestCookiesView.js: + (WebInspector.RequestCookiesView.prototype.get _gotCookies): + +2012-08-23 KwangYong Choi <ky0.choi@samsung.com> + + [EFL] Use vertical slider theme when the slider is vertical + https://bugs.webkit.org/show_bug.cgi?id=93838 + + Reviewed by Kenneth Rohde Christiansen. + + Applied vertical slider theme to the vertical sliders. The height + of the vertical slider is wrong when it's applied horizontal + slider theme. + + And do not resize slider when its size is not specified. It's natural + to use the default value of renderer. + + No new tests. It's covered by existing range and datalist tests. + + * platform/efl/RenderThemeEfl.cpp: + (WebCore::RenderThemeEfl::adjustSliderTrackStyle): + +2012-08-23 Kentaro Hara <haraken@chromium.org> + + [V8] Remove almost all #include "V8Proxy.h" + https://bugs.webkit.org/show_bug.cgi?id=94777 + + Reviewed by Adam Barth. + + No tests. No change in behavior. + + * bindings/v8/NPV8Object.cpp: + * bindings/v8/PageScriptDebugServer.cpp: + * bindings/v8/ScheduledAction.cpp: + * bindings/v8/ScriptController.cpp: + * bindings/v8/ScriptInstance.cpp: + * bindings/v8/ScriptObject.cpp: + * bindings/v8/ScriptRunner.cpp: + * bindings/v8/SerializedScriptValue.cpp: + * bindings/v8/V8AbstractEventListener.cpp: + * bindings/v8/V8Binding.h: + (WebCore): + * bindings/v8/V8BindingMacros.h: + (WebCore): + * bindings/v8/V8Collection.h: + * bindings/v8/V8DOMWindowShell.cpp: + * bindings/v8/V8DOMWrapper.cpp: + * bindings/v8/V8EventListener.cpp: + * bindings/v8/V8GCController.cpp: + * bindings/v8/V8LazyEventListener.cpp: + * bindings/v8/V8NPObject.cpp: + * bindings/v8/V8NPUtils.cpp: + * bindings/v8/V8Proxy.h: + (WebCore): + * bindings/v8/V8Utilities.cpp: + * bindings/v8/WorkerContextExecutionProxy.cpp: + * bindings/v8/WorkerScriptController.cpp: + * bindings/v8/custom/V8ArrayBufferCustom.cpp: + * bindings/v8/custom/V8ArrayBufferViewCustom.h: + * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp: + * bindings/v8/custom/V8AudioContextCustom.cpp: + * bindings/v8/custom/V8BlobCustom.cpp: + * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp: + * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp: + * bindings/v8/custom/V8ClipboardCustom.cpp: + * bindings/v8/custom/V8ConsoleCustom.cpp: + * bindings/v8/custom/V8CoordinatesCustom.cpp: + * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp: + * bindings/v8/custom/V8DOMFormDataCustom.cpp: + * bindings/v8/custom/V8DataViewCustom.cpp: + * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp: + * bindings/v8/custom/V8DeviceMotionEventCustom.cpp: + * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp: + * bindings/v8/custom/V8DocumentCustom.cpp: + * bindings/v8/custom/V8DocumentLocationCustom.cpp: + * bindings/v8/custom/V8EntryCustom.cpp: + * bindings/v8/custom/V8EntrySyncCustom.cpp: + * bindings/v8/custom/V8EventCustom.cpp: + * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp: + * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp: + * bindings/v8/custom/V8HTMLCollectionCustom.cpp: + * bindings/v8/custom/V8HTMLFormElementCustom.cpp: + * bindings/v8/custom/V8HTMLFrameElementCustom.cpp: + * bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp: + * bindings/v8/custom/V8HTMLImageElementConstructor.cpp: + * bindings/v8/custom/V8HTMLInputElementCustom.cpp: + * bindings/v8/custom/V8HTMLLinkElementCustom.cpp: + * bindings/v8/custom/V8HTMLMediaElementCustom.cpp: + * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp: + * bindings/v8/custom/V8HTMLOutputElementCustom.cpp: + * bindings/v8/custom/V8HTMLPlugInElementCustom.cpp: + * bindings/v8/custom/V8HTMLSelectElementCustom.cpp: + * bindings/v8/custom/V8HistoryCustom.cpp: + * bindings/v8/custom/V8InjectedScriptHostCustom.cpp: + * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp: + * bindings/v8/custom/V8IntentConstructor.cpp: + * bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp: + * bindings/v8/custom/V8LocationCustom.cpp: + * bindings/v8/custom/V8MessageChannelConstructor.cpp: + * bindings/v8/custom/V8MessageEventCustom.cpp: + * bindings/v8/custom/V8MessagePortCustom.cpp: + * bindings/v8/custom/V8MutationCallbackCustom.cpp: + * bindings/v8/custom/V8MutationObserverCustom.cpp: + * bindings/v8/custom/V8NamedNodeMapCustom.cpp: + * bindings/v8/custom/V8NodeCustom.cpp: + * bindings/v8/custom/V8NodeListCustom.cpp: + * bindings/v8/custom/V8NotificationCenterCustom.cpp: + * bindings/v8/custom/V8NotificationCustom.cpp: + * bindings/v8/custom/V8PopStateEventCustom.cpp: + * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp: + * bindings/v8/custom/V8SQLTransactionCustom.cpp: + * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp: + * bindings/v8/custom/V8SVGDocumentCustom.cpp: + * bindings/v8/custom/V8ScriptProfileCustom.cpp: + * bindings/v8/custom/V8ScriptProfileNodeCustom.cpp: + * bindings/v8/custom/V8StorageCustom.cpp: + * bindings/v8/custom/V8StyleSheetListCustom.cpp: + * bindings/v8/custom/V8TrackEventCustom.cpp: + * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: + * bindings/v8/custom/V8WebKitAnimationCustom.cpp: + * bindings/v8/custom/V8WebKitPointConstructor.cpp: + * bindings/v8/custom/V8WebSocketCustom.cpp: + * bindings/v8/custom/V8WorkerContextCustom.cpp: + * bindings/v8/custom/V8WorkerCustom.cpp: + * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp: + * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: + * bindings/v8/custom/V8XSLTProcessorCustom.cpp: + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + Unreviewed, rolling out r126348. + http://trac.webkit.org/changeset/126348 + https://bugs.webkit.org/show_bug.cgi?id=94588 + + We should use v8::String::NewSymbol() for symbols. See + https://bugs.webkit.org/show_bug.cgi?id=94574#c10 for more + details + + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateNormalAttrGetter): + (GenerateNormalAttrSetter): + (GenerateNamedConstructorCallback): + (GenerateNonStandardFunction): + (GenerateImplementation): + * bindings/scripts/test/V8/V8Float64Array.cpp: + (WebCore::ConfigureV8Float64ArrayTemplate): + * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: + (WebCore::ConfigureV8TestActiveDOMObjectTemplate): + * bindings/scripts/test/V8/V8TestEventTarget.cpp: + (WebCore::ConfigureV8TestEventTargetTemplate): + * bindings/scripts/test/V8/V8TestInterface.cpp: + (WebCore::ConfigureV8TestInterfaceTemplate): + * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: + (WebCore::V8TestNamedConstructorConstructor::GetTemplate): + * bindings/scripts/test/V8/V8TestObj.cpp: + (WebCore::ConfigureV8TestObjTemplate): + (WebCore::V8TestObj::installPerContextProperties): + * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: + (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrGetter): + (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrSetter): + (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedReadonlyValueAttrGetter): + * bindings/v8/V8Binding.h: + (WebCore): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Remove V8Proxy from CodeGeneratorV8.pm + https://bugs.webkit.org/show_bug.cgi?id=94773 + + Reviewed by Adam Barth. + + To kill V8Proxy, we can remove V8Proxy uses from CodeGeneratorV8.pm. + + No tests. No change in behavior. + + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateToV8Converters): + * bindings/scripts/test/V8/V8Float64Array.cpp: + (WebCore::V8Float64Array::wrapSlow): + * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: + (WebCore::V8TestActiveDOMObject::wrapSlow): + * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: + (WebCore::V8TestCustomNamedGetter::wrapSlow): + * bindings/scripts/test/V8/V8TestEventConstructor.cpp: + (WebCore::V8TestEventConstructor::wrapSlow): + * bindings/scripts/test/V8/V8TestEventTarget.cpp: + (WebCore::V8TestEventTarget::wrapSlow): + * bindings/scripts/test/V8/V8TestException.cpp: + (WebCore::V8TestException::wrapSlow): + * bindings/scripts/test/V8/V8TestInterface.cpp: + (WebCore::V8TestInterface::wrapSlow): + * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: + (WebCore::V8TestMediaQueryListListener::wrapSlow): + * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: + (WebCore::V8TestNamedConstructor::wrapSlow): + * bindings/scripts/test/V8/V8TestNode.cpp: + (WebCore::V8TestNode::wrapSlow): + * bindings/scripts/test/V8/V8TestObj.cpp: + (WebCore::V8TestObj::wrapSlow): + * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: + (WebCore::V8TestSerializedScriptValueInterface::wrapSlow): + +2012-08-22 Sukolsak Sakshuwong <sukolsak@google.com> + + Implement UndoManager's item() method + https://bugs.webkit.org/show_bug.cgi?id=94671 + + Reviewed by Ryosuke Niwa. + + This patch implements UndoManager's item() method and its V8 custom binding. + We need to use custom binding here because we need to return user objects + that are stored in a hidden property of DOMTransaction wrappers, not returning + the wrappers themselves. + + Test: editing/undomanager/undomanager-item.html + + * bindings/js/JSUndoManagerCustom.cpp: + (WebCore::JSUndoManager::item): + (WebCore): + * bindings/v8/DOMTransaction.cpp: + (WebCore::DOMTransaction::data): + (WebCore): + (WebCore::DOMTransaction::setData): + (WebCore::DOMTransaction::getFunction): + * bindings/v8/DOMTransaction.h: + * bindings/v8/custom/V8UndoManagerCustom.cpp: + (WebCore::V8UndoManager::transactCallback): + (WebCore::V8UndoManager::itemCallback): + (WebCore): + * editing/UndoManager.cpp: + (WebCore::UndoManager::item): + (WebCore): + * editing/UndoManager.h: + (UndoManager): + * editing/UndoManager.idl: + +2012-08-22 Dominic Mazzoni <dmazzoni@google.com> + + AX: Focusable elements without a role should not be ignored + https://bugs.webkit.org/show_bug.cgi?id=94302 + + Reviewed by Chris Fleizach. + + Changes the accessibility logic so that a generic element that's focusable is + not ignored for accessibility, and returns its inner text as its title. That way + if you Tab to the element, a reasonable accessibility notification is generated. + + One exception is the body element, because focusing the body is equivalent to + blurring the current focused element and does not result in a "focus" accessibility + notification. + + Also fixes logic that determined if an element was contentEditable by making + sure it catches the case with no attribute value (e.g. <div contentEditable>), + which also implies contentEditable=true according to the spec. + + Test: accessibility/focusable-div.html + + * accessibility/AccessibilityRenderObject.cpp: + (WebCore): + (WebCore::nodeHasContentEditableAttributeSet): + (WebCore::AccessibilityRenderObject::title): + (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + Unreviewed, rolling out r126383. + http://trac.webkit.org/changeset/126383 + https://bugs.webkit.org/show_bug.cgi?id=82888 + + Chromium win build crash + + * bindings/js/JSClipboardCustom.cpp: + (WebCore::JSClipboard::types): + * bindings/v8/custom/V8ClipboardCustom.cpp: + (WebCore::V8Clipboard::typesAccessorGetter): + * dom/Clipboard.h: + (Clipboard): + * platform/blackberry/ClipboardBlackBerry.cpp: + (WebCore::ClipboardBlackBerry::types): + * platform/blackberry/ClipboardBlackBerry.h: + (ClipboardBlackBerry): + * platform/chromium/ChromiumDataObject.cpp: + (WebCore::ChromiumDataObject::types): + * platform/chromium/ChromiumDataObject.h: + (ChromiumDataObject): + * platform/chromium/ClipboardChromium.cpp: + (WebCore::ClipboardChromium::types): + * platform/chromium/ClipboardChromium.h: + (ClipboardChromium): + * platform/efl/ClipboardEfl.cpp: + (WebCore::ClipboardEfl::types): + * platform/efl/ClipboardEfl.h: + (ClipboardEfl): + * platform/gtk/ClipboardGtk.cpp: + (WebCore::ClipboardGtk::types): + * platform/gtk/ClipboardGtk.h: + (ClipboardGtk): + * platform/mac/ClipboardMac.h: + (ClipboardMac): + * platform/mac/ClipboardMac.mm: + (WebCore::addHTMLClipboardTypesForCocoaType): + (WebCore::ClipboardMac::types): + * platform/qt/ClipboardQt.cpp: + (WebCore::ClipboardQt::types): + * platform/qt/ClipboardQt.h: + (ClipboardQt): + * platform/win/ClipboardWin.cpp: + (WebCore::addMimeTypesForFormat): + (WebCore::ClipboardWin::types): + * platform/win/ClipboardWin.h: + (ClipboardWin): + * platform/wx/ClipboardWx.cpp: + (WebCore::ClipboardWx::types): + * platform/wx/ClipboardWx.h: + (ClipboardWx): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Move m_isolatedWorlds and m_isolatedWorldSecurityOrigins from V8Proxy to ScriptController + https://bugs.webkit.org/show_bug.cgi?id=94770 + + Reviewed by Adam Barth. + + Now m_isolatedWorlds and m_isolatedWorldSecurityOrigins of V8Proxy + are used by ScriptController only. We can move them to ScriptController. + + No tests. No change in behavior. + + * bindings/v8/ScriptController.cpp: + (WebCore::ScriptController::resetIsolatedWorlds): + (WebCore::ScriptController::evaluateInIsolatedWorld): + (WebCore::ScriptController::setIsolatedWorldSecurityOrigin): + (WebCore::ScriptController::collectIsolatedContexts): + * bindings/v8/ScriptController.h: + (ScriptController): + * bindings/v8/V8Proxy.h: + (V8Proxy): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Move evaluate() from V8Proxy to ScriptController + https://bugs.webkit.org/show_bug.cgi?id=94768 + + Reviewed by Adam Barth. + + To kill V8Proxy, we can move evaluate() from V8Proxy to ScriptController. + + - Renamed evaluate() to compileAndRunScript() to avoid name conflict + with existing ScriptController::evaluate(). + + - Removed toV8Proxy() from NPV8Object, as it is no longer used. + + No tests. No change in behavior. + + * bindings/v8/NPV8Object.cpp: + (_NPN_EvaluateHelper): + * bindings/v8/ScheduledAction.cpp: + (WebCore::ScheduledAction::execute): + * bindings/v8/ScriptController.cpp: + (WebCore::ScriptController::compileAndRunScript): + (WebCore): + (WebCore::ScriptController::evaluate): + (WebCore::ScriptController::evaluateInIsolatedWorld): + * bindings/v8/ScriptController.h: + (ScriptController): + * bindings/v8/V8Proxy.cpp: + * bindings/v8/V8Proxy.h: + +2012-08-22 Vineet Chaudhary <rgf748@motorola.com> + + Consider replacing return type of Clipboard::types() from HashSet<String> to Vector<String>. + https://bugs.webkit.org/show_bug.cgi?id=82888 + + Reviewed by Kentaro Hara. + + As part of removing custom bindings of types Array Clipboard::types() needs to return + Vector<String> than HashSet<String> + + No new tests. Exixting test should pass with this change as no behavoural changes. + + * bindings/js/JSClipboardCustom.cpp: Replace data type from HashSet<> to Vector<>. + (WebCore::JSClipboard::types): + * bindings/v8/custom/V8ClipboardCustom.cpp: Ditto. + (WebCore::V8Clipboard::typesAccessorGetter): + * dom/Clipboard.h: Ditto. + (Clipboard): + * platform/blackberry/ClipboardBlackBerry.cpp: Ditto. + (WebCore::ClipboardBlackBerry::types): + * platform/blackberry/ClipboardBlackBerry.h: Ditto. + (ClipboardBlackBerry): + * platform/chromium/ChromiumDataObject.cpp: Ditto. + (WebCore::ChromiumDataObject::types): + * platform/chromium/ChromiumDataObject.h: Ditto. + (ChromiumDataObject): + * platform/chromium/ClipboardChromium.cpp: Ditto. + (WebCore::ClipboardChromium::types): + * platform/chromium/ClipboardChromium.h: Ditto. + (ClipboardChromium): + * platform/efl/ClipboardEfl.cpp: Ditto. + (WebCore::ClipboardEfl::types): + * platform/efl/ClipboardEfl.h: Ditto. + (ClipboardEfl): + * platform/gtk/ClipboardGtk.cpp: Ditto. + (WebCore::ClipboardGtk::types): + * platform/gtk/ClipboardGtk.h: Ditto. + (ClipboardGtk): + * platform/mac/ClipboardMac.h: Ditto. + (ClipboardMac): + * platform/mac/ClipboardMac.mm: Ditto. + (WebCore::addHTMLClipboardTypesForCocoaType): + (WebCore::ClipboardMac::types): + * platform/qt/ClipboardQt.cpp: Ditto. + (WebCore::ClipboardQt::types): + * platform/qt/ClipboardQt.h: Ditto. + (ClipboardQt): + * platform/win/ClipboardWin.cpp: Ditto. + (WebCore::addMimeTypesForFormat): + (WebCore::ClipboardWin::types): + * platform/win/ClipboardWin.h: Ditto. + (ClipboardWin): + * platform/wx/ClipboardWx.cpp: Ditto. + (WebCore::ClipboardWx::types): + * platform/wx/ClipboardWx.h: Ditto. + (ClipboardWx): + +2012-08-22 James Robinson <jamesr@chromium.org> + + [chromium] Change WebLayer from a concrete type to a pure virtual interface + https://bugs.webkit.org/show_bug.cgi?id=94174 + + Reviewed by Adrienne Walker. + + This updates WebCore code for the WebLayer interface changes. Classes that have ownership of specific layer + types (such as DrawingBufferChromium, Canvas2DLayerBridge and ScrollingCoordinatorChromium) hold ownership + of a specific type and a pointer to the WebLayer to GraphicsLayerChromium to be included in the final layer + tree. GraphicsLayerChromium holds a WebContentLayer and (optionally) a WebImageLayer and WebLayer (for + m_transformLayer) and assembles the final layer tree. + + * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp: + (WebCore::ScrollingCoordinatorPrivate::ScrollingCoordinatorPrivate): + (ScrollingCoordinatorPrivate): + (WebCore::ScrollingCoordinatorPrivate::setScrollLayer): + (WebCore::ScrollingCoordinatorPrivate::setHorizontalScrollbarLayer): + (WebCore::ScrollingCoordinatorPrivate::setVerticalScrollbarLayer): + (WebCore::ScrollingCoordinatorPrivate::scrollLayer): + (WebCore::scrollableLayerForGraphicsLayer): + (WebCore): + (WebCore::createScrollbarLayer): + (WebCore::ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange): + (WebCore::ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange): + (WebCore::ScrollingCoordinator::setScrollLayer): + (WebCore::ScrollingCoordinator::setNonFastScrollableRegion): + (WebCore::ScrollingCoordinator::setWheelEventHandlerCount): + (WebCore::ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread): + (WebCore::ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers): + (WebCore::ScrollingCoordinator::setLayerIsFixedToContainerLayer): + * platform/graphics/chromium/Canvas2DLayerBridge.cpp: + (WebCore::Canvas2DLayerBridge::Canvas2DLayerBridge): + (WebCore::Canvas2DLayerBridge::~Canvas2DLayerBridge): + (WebCore::Canvas2DLayerBridge::prepareForDraw): + (WebCore::Canvas2DLayerBridge::layer): + (WebCore::Canvas2DLayerBridge::contextAcquired): + * platform/graphics/chromium/Canvas2DLayerBridge.h: + (Canvas2DLayerBridge): + * platform/graphics/chromium/DrawingBufferChromium.cpp: + (WebCore::DrawingBufferPrivate::DrawingBufferPrivate): + (WebCore::DrawingBufferPrivate::~DrawingBufferPrivate): + (WebCore::DrawingBufferPrivate::layer): + (DrawingBufferPrivate): + * platform/graphics/chromium/GraphicsLayerChromium.cpp: + (WebCore::GraphicsLayerChromium::GraphicsLayerChromium): + (WebCore::GraphicsLayerChromium::~GraphicsLayerChromium): + (WebCore::GraphicsLayerChromium::willBeDestroyed): + (WebCore::GraphicsLayerChromium::updateNames): + (WebCore::GraphicsLayerChromium::removeFromParent): + (WebCore::GraphicsLayerChromium::setSize): + (WebCore::GraphicsLayerChromium::clearBackgroundColor): + (WebCore::GraphicsLayerChromium::setContentsOpaque): + (WebCore::GraphicsLayerChromium::setFilters): + (WebCore::GraphicsLayerChromium::setBackgroundFilters): + (WebCore::GraphicsLayerChromium::setMaskLayer): + (WebCore::GraphicsLayerChromium::setBackfaceVisibility): + (WebCore::GraphicsLayerChromium::setOpacity): + (WebCore::GraphicsLayerChromium::setReplicatedByLayer): + (WebCore::GraphicsLayerChromium::setContentsNeedsDisplay): + (WebCore::GraphicsLayerChromium::setNeedsDisplay): + (WebCore::GraphicsLayerChromium::setNeedsDisplayInRect): + (WebCore::GraphicsLayerChromium::setContentsToImage): + (WebCore::GraphicsLayerChromium::setContentsToCanvas): + (WebCore): + (WebCore::GraphicsLayerChromium::setContentsToMedia): + (WebCore::GraphicsLayerChromium::setContentsTo): + (WebCore::GraphicsLayerChromium::addAnimation): + (WebCore::GraphicsLayerChromium::pauseAnimation): + (WebCore::GraphicsLayerChromium::removeAnimation): + (WebCore::GraphicsLayerChromium::suspendAnimations): + (WebCore::GraphicsLayerChromium::resumeAnimations): + (WebCore::GraphicsLayerChromium::platformLayer): + (WebCore::GraphicsLayerChromium::setDebugBackgroundColor): + (WebCore::GraphicsLayerChromium::setDebugBorder): + (WebCore::GraphicsLayerChromium::updateChildList): + (WebCore::GraphicsLayerChromium::updateLayerPosition): + (WebCore::GraphicsLayerChromium::updateLayerSize): + (WebCore::GraphicsLayerChromium::updateAnchorPoint): + (WebCore::GraphicsLayerChromium::updateTransform): + (WebCore::GraphicsLayerChromium::updateChildrenTransform): + (WebCore::GraphicsLayerChromium::updateMasksToBounds): + (WebCore::GraphicsLayerChromium::updateLayerPreserves3D): + (WebCore::GraphicsLayerChromium::updateLayerIsDrawable): + (WebCore::GraphicsLayerChromium::updateLayerBackgroundColor): + (WebCore::GraphicsLayerChromium::updateContentsRect): + (WebCore::GraphicsLayerChromium::updateContentsScale): + (WebCore::GraphicsLayerChromium::setupContentsLayer): + * platform/graphics/chromium/GraphicsLayerChromium.h: + (GraphicsLayerChromium): + (WebCore::GraphicsLayerChromium::hasContentsLayer): + (WebCore::GraphicsLayerChromium::contentLayer): + (WebCore::GraphicsLayerChromium::contentsLayer): + * platform/graphics/chromium/LayerChromium.cpp: + (WebCore::LayerChromium::rootLayer): + * platform/graphics/chromium/LayerChromium.h: + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Move runScript() from V8Proxy to ScriptRunner + https://bugs.webkit.org/show_bug.cgi?id=94706 + + Reviewed by Adam Barth. + + To kill V8Proxy, we can move runScript() from V8Proxy to ScriptRunner. + + - ScriptRunner::runScript() should be a static method. + It should receive ScriptExecutionContext on which the script is evaluated. + + - After this patch is landed, I'll remove WorkerContextExecutionContext::runScript() + and ScriptDebugServer::runScript(). + + No tests. No change in behavior. + + * UseV8.cmake: + * WebCore.gypi: + * bindings/v8/ScriptController.cpp: + * bindings/v8/ScriptRunner.cpp: Added. + (WebCore): + (WebCore::ScriptRunner::runScript): + * bindings/v8/ScriptRunner.h: Added. + (WebCore): + (ScriptRunner): + * bindings/v8/V8Binding.cpp: + (WebCore::handleMaxRecursionDepthExceeded): + (WebCore): + * bindings/v8/V8Binding.h: + (WebCore): + * bindings/v8/V8Proxy.cpp: + (WebCore::V8Proxy::evaluate): + * bindings/v8/V8Proxy.h: + (V8Proxy): + +2012-08-22 Adam Barth <abarth@webkit.org> + + [V8] OwnHandle doesn't need to support weak handles + https://bugs.webkit.org/show_bug.cgi?id=94760 + + Reviewed by Kentaro Hara. + + No code uses makeWeak(). We can drop support for it and simplify this + class. + + * bindings/v8/OwnHandle.h: + (WebCore): + (OwnHandle): + (WebCore::OwnHandle::OwnHandle): + (WebCore::OwnHandle::~OwnHandle): + (WebCore::OwnHandle::get): + (WebCore::OwnHandle::set): + (WebCore::OwnHandle::clear): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Remove V8Proxy from getXPathNSResolver() + https://bugs.webkit.org/show_bug.cgi?id=94715 + + Reviewed by Adam Barth. + + - The V8Proxy* argument of getXPathNSResolver(..., V8Proxy* = 0) is not used. + We can remove it. + + - We can rename getXPathNSResolver() to toXPathNSResolver(). + + - We can move toXPathNSResolver() from V8DOMWrapper to V8Binding, + since other toXXX() methods are written in V8Binding. + + - Change the return value of toXPathNSResolver() from RefPtr to PassRefPtr. + + No tests. No change in behavior. + + * bindings/scripts/CodeGeneratorV8.pm: + (JSValueToNative): + * bindings/v8/V8Binding.cpp: + (WebCore::toXPathNSResolver): + (WebCore): + * bindings/v8/V8Binding.h: + (WebCore): + * bindings/v8/V8DOMWrapper.cpp: + * bindings/v8/V8DOMWrapper.h: + (V8DOMWrapper): + * bindings/v8/custom/V8DocumentCustom.cpp: + (WebCore::V8Document::evaluateCallback): + +2012-08-22 Kenneth Russell <kbr@google.com> + + Unreviewed, rolling out r126325. + http://trac.webkit.org/changeset/126325 + https://bugs.webkit.org/show_bug.cgi?id=94644 + + Caused subtle but reproducible failure to call onload handler + properly in an SVG layout test in Chromium Mac Debug builds, + indicating potentially larger problem + + * css/CSSFontSelector.cpp: + (WebCore::CSSFontSelector::beginLoadTimerFired): + * loader/cache/CachedResourceLoader.cpp: + (WebCore::CachedResourceLoader::decrementRequestCount): + +2012-08-22 Victor Carbune <victor@rosedu.org> + + Display a TextTrackCue when snap-to-lines flag is set + https://bugs.webkit.org/show_bug.cgi?id=79751 + + Reviewed by Tony Chang. + + This patch implements rendering functionality for a given text track, + following closer the exact WebVTT specification. There are two new classes + which have been added in order to succesfully cover rendering when of a text + track cue. + + RenderTextTrackCue handles the specific rendering algorithm required, + by checking for overlaps with other boxes that are in the same + container (these can be any other boxes, not necessarily other cues, + the video controls, for example). + + TextTrackCueBox extends HTMLDivElement and is an intermediate layer + between the renderer class and the actual cue object. Its purpose is + to instantiate the particular renderer and cover all the default CSS + styling that needs to be applied to the cue. + + The layout is done in two steps: + - Step 1: Layout the TextTrackCue with default CSS properties set (this is + the TextTrackCueBox decorated with the respective CSS elements) + - Step 2: RenderTextTrackCue adjusts the box position depending on the + parameters of the TextTrackCue object and the overlaps that may occur with + previously positioned cues. + + Tests: media/track/track-cue-rendering-horizontal.html + media/track/track-cue-rendering-vertical.html + + * CMakeLists.txt: Updated to include RenderTextTrackCue. + * GNUmakefile.list.am: Updated to include RenderTextTrackCue. + * Target.pri: Updated to include RenderTextTrackCue. + * WebCore.gypi: Updated to include RenderTextTrackCue. + * WebCore.vcproj/WebCore.vcproj: Updated to include RenderTextTrackCue. + * WebCore.xcodeproj/project.pbxproj: Updated to include RenderTextTrackCue. + * css/mediaControls.css: Removed unreliable CSS. + (video::-webkit-media-text-track-display): Removed properties. + * html/shadow/MediaControlElements.cpp: Updated to not use the new class. + (RenderTextTrackContainerElement): + (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Simplified + the function by moving the check if track is rendered in TextTrack and used + the TextTrackCueBox for cues. + * html/track/TextTrack.cpp: Added a new method. + (WebCore::TextTrack::isRendered): Method that returns whether the track should + be rendered or not. + (WebCore): + * html/track/TextTrack.h: Added the isRendered method. + (TextTrack): + * html/track/TextTrackCue.cpp: Added several helper methods and + the TextTrackCueBox. + (WebCore): + (WebCore::TextTrackCueBox::TextTrackCueBox): The TextTrackCueBox extends + the HTMLDivElement and represents a bridge class between RenderTextTrackCue + and TextTrackCue. This is required as the layout is done in two steps, as + explained on top of the ChangeLog entry. + (WebCore::TextTrackCueBox::getCue): Returns the associated TextTrackCue object. + (WebCore::TextTrackCueBox::applyCSSProperties): Applies a part of the default CSS + properties, as defined by section 3.5.1 of the WebVTT specification. + (WebCore::TextTrackCueBox::shadowPseudoId): Moved the shadow pseudo id. + (WebCore::TextTrackCueBox::createRenderer): Creates the particular renderer. + (WebCore::TextTrackCue::TextTrackCue): Corrected the internal writing mode map. + (WebCore::TextTrackCue::calculateComputedLinePosition): Updated the compute line + position algorithm. This requires, however, a method to consider only rendered + tracks (and therefore will be addressed completely in subsequent changeset). + (WebCore::TextTrackCue::calculateDisplayParameters): Updated and corrected the + computed display parameters to match the current specification. + (WebCore::TextTrackCue::getDisplayTree): Update to use the TextTrackCueBox class + and moved CSS application to the respective class. + (WebCore::TextTrackCue::getPositionCoordinates): Added comment to specify in which + situation this method is used and change visibility to private. + (WebCore::TextTrackCue::getCSSWritingMode): Returns the CSS writing mode corresponding + to the cue writing mode. + (WebCore::TextTrackCue::getCSSSize): Returns the cue width / height (depending on the + writing direction. + (WebCore::TextTrackCue::getCSSPosition): Returns the default display position, that is + used in the first layout step. + * html/track/TextTrackCue.h: + (WebCore): + (TextTrackCueBox): + (WebCore::TextTrackCueBox::create): Initialization method. + (TextTrackCue): + (WebCore::TextTrackCue::getWritingDirection): Helper method to return the internal + values used to represent the writing direction. + * rendering/RenderTextTrackCue.cpp: Added. + (WebCore): + (WebCore::RenderTextTrackCue::RenderTextTrackCue): + (WebCore::RenderTextTrackCue::layout): The rendering steps, as mentioned in + the WebVTT rendering rules. Currently, this treats only the snap-to-lines set + case. It is implemented following closely the spec, and might be subject to + change as discussions on various bugs evolve. + (WebCore::RenderTextTrackCue::initializeLayoutParameters): Steps 1 - 7. + (WebCore::RenderTextTrackCue::placeBoxInDefaultPosition): Steps 8 - 10. + (WebCore::RenderTextTrackCue::isOutside): Inline method to check if the cue is outside. + (WebCore::RenderTextTrackCue::isOverlapping): Inline method to check if the cue overlaps other boxes. + (WebCore::RenderTextTrackCue::shouldSwitchDirection): Step 12. + (WebCore::RenderTextTrackCue::moveBoxesByStep): Step 13. + (WebCore::RenderTextTrackCue::switchDirection): Steps 15 - 18. + (WebCore::RenderTextTrackCue::repositionCueSnapToLinesSet): Cue repositioning + for text track cue when the snap to lines flag is set. + (WebCore::RenderTextTrackCue::repositionCueSnapToLinesNotSet): Cue repositioning + for text track cue when the snap to lines flag is not set. Not implemented yet. + * rendering/RenderTextTrackCue.h: Added. + (WebCore): + (RenderTextTrackCue): Rendering class, handling the display of cues. + +2012-08-21 Kentaro Hara <haraken@chromium.org> + + [V8] Move matchesCurrentContext() from V8Proxy to ScriptController + https://bugs.webkit.org/show_bug.cgi?id=94596 + + Reviewed by Adam Barth. + + To kill V8Proxy: + + - We can move matchesCurrentContext() from V8Proxy to ScriptController. + - We can remove V8Proxy::isolatedWorldContext() since it is not used by anybody. + - We can remove V8Proxy::finishedWithEvent() since it is empty. + + No tests. No change in behavior. + + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateToV8Converters): + * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: + (WebCore::V8TestActiveDOMObject::wrapSlow): + * bindings/scripts/test/V8/V8TestNode.cpp: + (WebCore::V8TestNode::wrapSlow): + * bindings/v8/ScriptController.cpp: + (WebCore::ScriptController::finishedWithEvent): + (WebCore::ScriptController::matchesCurrentContext): + (WebCore): + * bindings/v8/ScriptController.h: + (ScriptController): + * bindings/v8/V8Proxy.cpp: + * bindings/v8/V8Proxy.h: + (V8Proxy): + +2012-08-22 Alejandro Piñeiro <apinheiro@igalia.com> + + [Gtk] Dojo toggle buttons should expose ROLE_TOGGLE_BUTTON not ROLE_PUSH_BUTTON + https://bugs.webkit.org/show_bug.cgi?id=73819 + + Reviewed by Chris Fleizach. + + Added a new role, Toggle Button, based on whether aria-pressed is present. + http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed + + Test: platform/gtk/accessibility/aria-toggle-button-role.html + + * accessibility/AccessibilityNodeObject.cpp: + (WebCore::AccessibilityNodeObject::determineAccessibilityRole): using buttonRoleType + to classify a button-related role. + (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute): using buttonRoleType + to classify a button-related role. + * accessibility/AccessibilityObject.cpp: + (WebCore::AccessibilityObject::ariaPressedIsPresent): checks if aria-pressed + attribute is present. + (WebCore::AccessibilityObject::buttonRoleType): returns a specific button-related + role if the object is a button-related role. + * accessibility/AccessibilityObject.h: + (AccessibilityObject): added new role ToggleButtonRole. + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::determineAccessibilityRole): using buttonRoleType + to classify a button-related role. + * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp: + (atkRole): added a mapping between ToggleButtonRole and + ATK_ROLE_TOGGLE_BUTTON. + * accessibility/mac/WebAccessibilityObjectWrapper.mm: + (createAccessibilityRoleMap): added a mapping between + ToggleButtonRole and NSAccessibilityButtonRole + +2012-08-22 David Grogan <dgrogan@chromium.org> + + IndexedDB: revert int version when version change transaction aborts + https://bugs.webkit.org/show_bug.cgi?id=94662 + + Reviewed by Tony Chang. + + Test: storage/indexeddb/intversion-revert-on-abort.html + + * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: + (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction): + (WebCore::IDBDatabaseBackendImpl::resetIntVersion): + One-liner modeled after resetVersion. + + (WebCore): + * Modules/indexeddb/IDBDatabaseBackendImpl.h: + (IDBDatabaseBackendImpl): + +2012-08-17 Jeffrey Pfau <jpfau@apple.com> + + Allow blocking of Web SQL databases in third-party web workers + https://bugs.webkit.org/show_bug.cgi?id=94170 + + Reviewed by Adam Barth. + + Web workers did not previously know anything about the document that + spawned them. This is undefined for shared workers, but for dedicated + workers, we now pipe the information through. + + Tests: http/tests/security/cross-origin-worker-websql-allowed.html + http/tests/security/cross-origin-worker-websql.html + + * Modules/webdatabase/WorkerContextWebDatabase.cpp: Pass information about the top origin to canAccessDatabase + (WebCore::WorkerContextWebDatabase::openDatabase): + (WebCore::WorkerContextWebDatabase::openDatabaseSync): + * WebCore.exp.in: Make SecurityOrigin::isolatedCopy const + * page/SecurityOrigin.cpp: + (WebCore::SecurityOrigin::isolatedCopy): + (WebCore::SecurityOrigin::canAccessStorage): + * page/SecurityOrigin.h: + * workers/DedicatedWorkerContext.cpp: Pass topOrigin + (WebCore::DedicatedWorkerContext::create): + (WebCore::DedicatedWorkerContext::DedicatedWorkerContext): + * workers/DedicatedWorkerContext.h: + (DedicatedWorkerContext): + * workers/DedicatedWorkerThread.cpp: Pass topOrigin + (WebCore::DedicatedWorkerThread::create): + (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): + (WebCore::DedicatedWorkerThread::createWorkerContext): + * workers/DedicatedWorkerThread.h: + (DedicatedWorkerThread): + * workers/SharedWorkerContext.cpp: Pass topOrigin + (WebCore::SharedWorkerContext::SharedWorkerContext): + * workers/SharedWorkerThread.cpp: + (WebCore::SharedWorkerThread::SharedWorkerThread): + (WebCore::SharedWorkerThread::createWorkerContext): + * workers/SharedWorkerThread.h: + (SharedWorkerThread): Pass topOrigin + * workers/WorkerContext.cpp: + (WebCore::WorkerContext::WorkerContext): + * workers/WorkerContext.h: + (WebCore::WorkerContext::topOrigin): + (WorkerContext): + * workers/WorkerMessagingProxy.cpp: Pass topOrigin + (WebCore::WorkerMessagingProxy::startWorkerContext): + * workers/WorkerThread.cpp: + (WebCore::WorkerThreadStartupData::create): + (WorkerThreadStartupData): + (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): + (WebCore::WorkerThread::WorkerThread): + (WebCore::WorkerThread::workerThread): + * workers/WorkerThread.h: + (WorkerThread): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Move context() from V8Proxy to ScriptController + https://bugs.webkit.org/show_bug.cgi?id=94593 + + Reviewed by Adam Barth. + + - This patch removes V8Proxy::context(Frame*). + - This patch moves V8Proxy::context() to ScriptController::context(). + - This patch renames ScriptController::context() to ScriptController::currentWorldContext(), + for naming consistency with ScriptController::maintWorldContext(). + + No tests. No change in behavior. + + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateToV8Converters): + * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: + (WebCore::V8TestActiveDOMObject::wrapSlow): + * bindings/scripts/test/V8/V8TestNode.cpp: + (WebCore::V8TestNode::wrapSlow): + * bindings/v8/ScriptController.cpp: + (WebCore::ScriptController::context): + (WebCore): + * bindings/v8/ScriptController.h: + (ScriptController): + * bindings/v8/V8DOMWrapper.cpp: + (WebCore::V8DOMWrapper::setNamedHiddenWindowReference): + * bindings/v8/V8Proxy.cpp: + * bindings/v8/V8Proxy.h: + (V8Proxy): + * bindings/v8/custom/V8DOMWindowCustom.cpp: + (WebCore::WindowSetTimeoutImpl): + (WebCore::V8DOMWindow::eventAccessorGetter): + (WebCore::V8DOMWindow::eventAccessorSetter): + (WebCore::DialogHandler::dialogCreated): + (WebCore::toV8): + * bindings/v8/custom/V8HTMLDocumentCustom.cpp: + (WebCore::V8HTMLDocument::openCallback): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Remove V8Proxy from V8DOMWrapper::instantiateV8Object() + https://bugs.webkit.org/show_bug.cgi?id=94713 + + Reviewed by Adam Barth. + + To kill V8Proxy, V8DOMWrapper::instantiateV8Object() should receive Frame* + instead of V8Proxy*. + + No tests. No change in behavior. + + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateToV8Converters): + * bindings/scripts/test/V8/V8Float64Array.cpp: + (WebCore::V8Float64Array::wrapSlow): + * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: + (WebCore::V8TestActiveDOMObject::wrapSlow): + * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: + (WebCore::V8TestCustomNamedGetter::wrapSlow): + * bindings/scripts/test/V8/V8TestEventConstructor.cpp: + (WebCore::V8TestEventConstructor::wrapSlow): + * bindings/scripts/test/V8/V8TestEventTarget.cpp: + (WebCore::V8TestEventTarget::wrapSlow): + * bindings/scripts/test/V8/V8TestException.cpp: + (WebCore::V8TestException::wrapSlow): + * bindings/scripts/test/V8/V8TestInterface.cpp: + (WebCore::V8TestInterface::wrapSlow): + * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: + (WebCore::V8TestMediaQueryListListener::wrapSlow): + * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: + (WebCore::V8TestNamedConstructor::wrapSlow): + * bindings/scripts/test/V8/V8TestNode.cpp: + (WebCore::V8TestNode::wrapSlow): + * bindings/scripts/test/V8/V8TestObj.cpp: + (WebCore::V8TestObj::wrapSlow): + * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: + (WebCore::V8TestSerializedScriptValueInterface::wrapSlow): + * bindings/v8/V8DOMWrapper.cpp: + (WebCore): + (WebCore::V8DOMWrapper::instantiateV8Object): + * bindings/v8/V8DOMWrapper.h: + (V8DOMWrapper): + +2012-08-22 Joshua Bell <jsbell@chromium.org> + + IndexedDB: IDBRequest can be destructed during abort + https://bugs.webkit.org/show_bug.cgi?id=94618 + + Reviewed by Tony Chang. + + If there are no script references, an IDBRequest could be kept alive + only by enqueued events. On document destruction, the parent transaction + is aborted, which aborts the request. During the abort, the enqueued events + are deleted, releasing the last reference to the IDBRequest which then + destructs in mid-method call and an "unfinished" state, hitting an assert. + + This patch keeps the IDBRequest alive through the completion of the abort() + method, which will enqueue another event. In the document destruction case, + this will end up with the IDBRequest having stop() called on it which will + send the IDBRequest into EarlyDeath state, satisfying the destructor assert. + + Addresses existing layout tests that behave flakily in Chromium port. + + * Modules/indexeddb/IDBRequest.cpp: + (WebCore::IDBRequest::abort): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Move precompileScript() from V8Proxy to ScriptSourceCode + https://bugs.webkit.org/show_bug.cgi?id=94701 + + Reviewed by Adam Barth. + + To kill V8Proxy, we can move precompileScript() from V8Proxy + to ScriptSourceCode. + + No tests. No change in behavior. + + * bindings/v8/ScriptSourceCode.cpp: + (WebCore::ScriptSourceCode::precompileScript): + (WebCore): + * bindings/v8/ScriptSourceCode.h: + (ScriptSourceCode): + * bindings/v8/V8Proxy.cpp: + (WebCore::V8Proxy::evaluate): + * bindings/v8/V8Proxy.h: + (V8Proxy): + +2012-08-22 Nikhil Bhargava <nbhargava@google.com> + + Reduce Font.h includes across project -- improves RenderObject.h compile time + https://bugs.webkit.org/show_bug.cgi?id=93629 + + Reviewed by Eric Seidel. + + RenderStyle.h no longer depends on Font.h. The files that transitively + need to be updated with proper includes are fixed. + + No new tests. Functionality should remain the same. + + * accessibility/gtk/WebKitAccessibleInterfaceText.cpp: + * accessibility/mac/WebAccessibilityObjectWrapper.mm: + * bindings/objc/DOM.mm: + * css/CSSComputedStyleDeclaration.cpp: + * css/CSSPrimitiveValue.cpp: + * css/StyleResolver.h: + * dom/CharacterData.cpp: + * dom/ElementRareData.h: + * dom/NodeRenderingContext.cpp: + * dom/Text.cpp: + * editing/TextIterator.cpp: + * editing/mac/EditorMac.mm: + * html/HTMLTitleElement.cpp: + * html/shadow/TextControlInnerElements.cpp: + * inspector/InspectorOverlay.cpp: + * page/ContextMenuController.cpp: + * page/PrintContext.cpp: + * platform/efl/RenderThemeEfl.cpp: + * platform/graphics/FontMetrics.h: + * platform/gtk/RenderThemeGtk.cpp: + * platform/gtk/RenderThemeGtk2.cpp: + * platform/mac/HTMLConverter.mm: + * rendering/EllipsisBox.cpp: + * rendering/FlowThreadController.cpp: + * rendering/InlineBox.cpp: + * rendering/InlineFlowBox.cpp: + * rendering/InlineFlowBox.h: + (WebCore): + * rendering/RenderButton.cpp: + * rendering/RenderCombineText.cpp: + * rendering/RenderCombineText.h: + * rendering/RenderDeprecatedFlexibleBox.cpp: + * rendering/RenderEmbeddedObject.h: + (WebCore): + * rendering/RenderFileUploadControl.cpp: + * rendering/RenderFullScreen.h: + * rendering/RenderImage.cpp: + * rendering/RenderInline.cpp: + * rendering/RenderListItem.cpp: + * rendering/RenderListMarker.cpp: + * rendering/RenderMultiColumnBlock.cpp: + * rendering/RenderRegion.h: + * rendering/RenderRuby.cpp: + * rendering/RenderRubyRun.cpp: + * rendering/RenderScrollbar.cpp: + * rendering/RenderTable.cpp: + * rendering/RenderTableCell.cpp: + * rendering/RenderTableRow.cpp: + * rendering/RenderTableSection.cpp: + * rendering/RenderTextControl.cpp: + * rendering/RenderTextControlMultiLine.cpp: + * rendering/RenderThemeChromiumSkia.cpp: + * rendering/RenderView.cpp: + * rendering/TextAutosizer.cpp: + * rendering/mathml/RenderMathMLBlock.h: + * rendering/style/KeyframeList.h: + * rendering/style/RenderStyle.cpp: + * rendering/style/RenderStyle.h: + (WebCore): + * rendering/style/StyleInheritedData.cpp: + * rendering/svg/RenderSVGBlock.cpp: + * rendering/svg/RenderSVGInlineText.h: + * svg/SVGLengthContext.cpp: + * svg/SVGTRefElement.cpp: + +2012-08-22 Alex Christensen <alex.christensen@flexsim.com> + win64 compile error fix for BinaryPropertyList.cpp + https://bugs.webkit.org/show_bug.cgi?id=94122 + + Reviewed by Eric Seidel. + + Fixed compile errors for MSVC x64 without changing performance + + * platform/cf/BinaryPropertyList.cpp: + (WebCore::BinaryPropertyListSerializer::appendStringObject): + +2012-08-22 Kwang Yul Seo <skyul@company100.net> + + HTMLTreeBuilder::furthestBlockForFormattingElement should belong to HTMLElementStack + https://bugs.webkit.org/show_bug.cgi?id=93857 + + Reviewed by Eric Seidel. + + HTMLTreeBuilder::furthestBlockForFormattingElement should belong to + HTMLElementStack because it traverses the element stack and finds the + furthest block for the given formatting element. + + Currently, it belongs to HTMLTreeBuilder just because + isSpecialNode(const HTMLStackItem*) function used by + furthestBlockForFormattingElement is internal to HTMLTreeBuilder. + + Moved isSpecialNode to HTMLStackItem and changed + furthestBlockForFormattingElement to be a method of HTMLElementStack. + + No behavior change. Just a refactoring. + + * html/parser/HTMLElementStack.cpp: + (WebCore): + (WebCore::HTMLElementStack::popUntilNumberedHeaderElementPopped): + (WebCore::HTMLElementStack::hasNumberedHeaderElementInScope): + (WebCore::HTMLElementStack::furthestBlockForFormattingElement): + * html/parser/HTMLElementStack.h: + (HTMLElementStack): + * html/parser/HTMLStackItem.h: + (WebCore::HTMLStackItem::isInHTMLNamespace): + (HTMLStackItem): + (WebCore::HTMLStackItem::isNumberedHeaderElement): + (WebCore::HTMLStackItem::isTableBodyContextElement): + (WebCore::HTMLStackItem::isSpecialNode): + * html/parser/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::constructTreeFromAtomicToken): + (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag): + (WebCore::HTMLTreeBuilder::processStartTagForInBody): + (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody): + (WebCore::HTMLTreeBuilder::callTheAdoptionAgency): + (WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent): + (WebCore::HTMLTreeBuilder::processTokenInForeignContent): + * html/parser/HTMLTreeBuilder.h: + +2012-08-22 Alexandre Elias <aelias@google.com> + + [chromium] Add software bitmap resources to CCResourceProvider + https://bugs.webkit.org/show_bug.cgi?id=93677 + + Reviewed by Adrienne Walker. + + Second commit after revert. + + This adds the ability to CCResourceProvider to use software bitmaps. + They are allocated as plain-old-memory, and exposed as Skia objects. + + We want the ResourceProvider to be able to handle different resource + types at the same time. In practice, a default resource type is + desired for most uses within a single compositor instance, which is + specified by the default resource type. Default resource types are + expected to be mostly 1-to-1 with CCRenderer types. + + New tests added by parametrizing existing CCResourceProvider tests. + + * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp: + (WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect): + * platform/graphics/chromium/LayerRendererChromium.cpp: + (WebCore::applyFilters): + (WebCore::LayerRendererChromium::drawRenderPassQuad): + (WebCore::LayerRendererChromium::drawTileQuad): + (WebCore::LayerRendererChromium::drawYUVVideoQuad): + (WebCore::LayerRendererChromium::drawTextureQuad): + (WebCore::LayerRendererChromium::getFramebufferTexture): + (WebCore::LayerRendererChromium::bindFramebufferToTexture): + * platform/graphics/chromium/LayerRendererChromium.h: + (DrawingFrame): + * platform/graphics/chromium/cc/CCResourceProvider.cpp: + (WebCore::CCResourceProvider::createResource): + (WebCore): + (WebCore::CCResourceProvider::createGLTexture): + (WebCore::CCResourceProvider::createBitmap): + (WebCore::CCResourceProvider::createResourceFromExternalTexture): + (WebCore::CCResourceProvider::deleteResource): + (WebCore::CCResourceProvider::upload): + (WebCore::CCResourceProvider::flush): + (WebCore::CCResourceProvider::shallowFlushIfSupported): + (WebCore::CCResourceProvider::lockForRead): + (WebCore::CCResourceProvider::unlockForRead): + (WebCore::CCResourceProvider::lockForWrite): + (WebCore::CCResourceProvider::unlockForWrite): + (WebCore::CCResourceProvider::ScopedReadLockGL::ScopedReadLockGL): + (WebCore::CCResourceProvider::ScopedReadLockGL::~ScopedReadLockGL): + (WebCore::CCResourceProvider::ScopedWriteLockGL::ScopedWriteLockGL): + (WebCore::CCResourceProvider::ScopedWriteLockGL::~ScopedWriteLockGL): + (WebCore::CCResourceProvider::populateSkBitmapWithResource): + (WebCore::CCResourceProvider::ScopedReadLockSoftware::ScopedReadLockSoftware): + (WebCore::CCResourceProvider::ScopedReadLockSoftware::~ScopedReadLockSoftware): + (WebCore::CCResourceProvider::ScopedWriteLockSoftware::ScopedWriteLockSoftware): + (WebCore::CCResourceProvider::ScopedWriteLockSoftware::~ScopedWriteLockSoftware): + (WebCore::CCResourceProvider::CCResourceProvider): + * platform/graphics/chromium/cc/CCResourceProvider.h: + (WebCore): + (WebCore::CCResourceProvider::setCreationPolicy): + (WebCore::CCResourceProvider::creationPolicy): + (CCResourceProvider): + (ScopedReadLockGL): + (WebCore::CCResourceProvider::ScopedReadLockGL::textureId): + (ScopedWriteLockGL): + (WebCore::CCResourceProvider::ScopedWriteLockGL::textureId): + (ScopedReadLockSoftware): + (WebCore::CCResourceProvider::ScopedReadLockSoftware::skBitmap): + (ScopedWriteLockSoftware): + (WebCore::CCResourceProvider::ScopedWriteLockSoftware::skCanvas): + (Resource): + +2012-08-22 Anna Cavender <annacc@chromium.org> + + Update the TextTrackCue Constructor + https://bugs.webkit.org/show_bug.cgi?id=88583 + + Reviewed by Eric Carlson. + + The TextTrackCue constructor has been changed to: + [Constructor(double startTime, double endTime, DOMString text)] + http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcue + + No new tests. Update to media/track/track-add-remove-cue.html + + * html/track/TextTrackCue.cpp: + (WebCore::TextTrackCue::TextTrackCue): + * html/track/TextTrackCue.h: + (WebCore::TextTrackCue::create): + (TextTrackCue): + * html/track/TextTrackCue.idl: + * html/track/WebVTTParser.cpp: + (WebCore::WebVTTParser::createNewCue): + +2012-08-22 Erik Arvidsson <arv@chromium.org> + + Changing class attribute is not reflected in the classList property + https://bugs.webkit.org/show_bug.cgi?id=93665 + + Reviewed by Ojan Vafai. + + Before this change classAttributeChanged was only called for StyledElement. With this refactoring + it gets called for all Elements when the class attribute changes. + + Test: fast/dom/Element/class-list-update.html + + * css/StyleResolver.cpp: + (WebCore::StyleResolver::collectMatchingRules): To match the old behavior we only include StyledElements. + * dom/ClassNodeList.cpp: + (WebCore::ClassNodeList::nodeMatches): Ditto. + * dom/Element.cpp: + (WebCore::Element::attributeChanged): Moved the call to parseAttribute here, from StyledElement::attributeChanged. + (WebCore::Element::parseAttribute): Moved from StyledElement. + (WebCore): + (WebCore::Element::classAttributeChanged): Ditto. + * dom/Element.h: + (Element): + (WebCore::Element::classNames): Ditto. + (WebCore): + * dom/StyledElement.cpp: + (WebCore::StyledElement::attributeChanged): Let Element::attributeChanged call parseAttribtue instead. + (WebCore::StyledElement::parseAttribute): Move the class attribute handling to Element::parseAttribute. + * dom/StyledElement.h: + (StyledElement): + +2012-08-22 Kentaro Hara <haraken@chromium.org> + + [V8] Replace v8::String::NewSymbol() in CodeGeneratorV8.pm with v8String() + https://bugs.webkit.org/show_bug.cgi?id=94588 + + Reviewed by Eric Seidel. + + v8String() is faster than String::NewSymbol(). + This patch implements v8String(char*, Isolate*) and + replaces String::NewSymbol(char*) in CodeGeneratorV8.pm + with v8String(char*, Isolate*). + + Performance result: + + // 272 nano sec + static v8::Handle<v8::Value> attr3AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) + { + v8::Handle<v8::Value> v1 = v8String(String("foo")); + v8::Handle<v8::Value> v2 = v8String(String("bar")); + if (!v1.IsEmpty() && !v2.IsEmpty()) + return v8Undefined(); + return v8::Null(); // Never reach. + } + + // 377 nano sec + static v8::Handle<v8::Value> attr4AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) + { + v8::Handle<v8::Value> v1 = v8::String::NewSymbol("foo"); + v8::Handle<v8::Value> v2 = v8::String::NewSymbol("bar"); + if (!v1.IsEmpty() && !v2.IsEmpty()) + return v8Undefined(); + return v8::Null(); // Never reach. + } + + No tests. No change in behavior. + + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateNormalAttrGetter): + (GenerateNormalAttrSetter): + (GenerateNamedConstructorCallback): + (GenerateNonStandardFunction): + (GenerateImplementation): + * bindings/scripts/test/V8/V8Float64Array.cpp: + (WebCore::ConfigureV8Float64ArrayTemplate): + * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: + (WebCore::ConfigureV8TestActiveDOMObjectTemplate): + * bindings/scripts/test/V8/V8TestEventTarget.cpp: + (WebCore::ConfigureV8TestEventTargetTemplate): + * bindings/scripts/test/V8/V8TestInterface.cpp: + (WebCore::ConfigureV8TestInterfaceTemplate): + * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: + (WebCore::V8TestNamedConstructorConstructor::GetTemplate): + * bindings/scripts/test/V8/V8TestObj.cpp: + (WebCore::ConfigureV8TestObjTemplate): + (WebCore::V8TestObj::installPerContextProperties): + * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: + (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrGetter): + (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrSetter): + (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedReadonlyValueAttrGetter): + * bindings/v8/V8Binding.h: + (WebCore): + (WebCore::v8String): + * html/HTMLDivElement.idl: + +2012-08-22 Pratik Solanki <psolanki@apple.com> + + Setting WebKitEnableHTTPPipelining doesn't work if default is true + https://bugs.webkit.org/show_bug.cgi?id=94537 + + Reviewed by David Kilzer. + + * platform/network/cf/ResourceRequestCFNet.cpp: + (WebCore::initializeMaximumHTTPConnectionCountPerHost): Read in the HTTP pipelining pref and + allow it to override the default pipelining behavior if it was actually set. + +2012-08-22 W. James MacLean <wjmaclean@chromium.org> + + [chromium] Add touch link highlight animation layers. + https://bugs.webkit.org/show_bug.cgi?id=84487 + + Reviewed by James Robinson. + + Adds support for creating composited touch link highlights in renderer thread. Clipping not yet + implemented for non-composited frames/overflow divs, but scrolling and layout changes are supported. + Transform support currently limited to translation. + + Unit tests for LinkHighlight revised. + + Tests: platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled-clipped.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled-late-composite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled-late-noncomposite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-scrolled-clipped.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-scrolled.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-composited-scroll-clip.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-composited-scrolled.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-composited.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-layout-change-2.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-layout-change.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-scroll-clip.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-scrolled-late-composite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-scrolled-late-noncomposite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-scrolled.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-composited-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-composited-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner-clipped.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner-late-composite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer-clipped.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer-late-composite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-inner-scroll-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-inner-scroll-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-outer-scroll-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-outer-scroll-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-scrolled-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-scrolled-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-rotated.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledX.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledY.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-window-scroll.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple.html + + * WebCore.gypi: + * platform/graphics/chromium/GraphicsLayerChromium.cpp: + (WebCore::GraphicsLayerChromium::GraphicsLayerChromium): + (WebCore::GraphicsLayerChromium::willBeDestroyed): Adds notification to LinkHighlight when layer goes away. + (WebCore::GraphicsLayerChromium::updateNames): Now sets debug name for LinkHighlight layer. + (WebCore::GraphicsLayerChromium::setSize): Invalidates LinkHighlight if present. + (WebCore::GraphicsLayerChromium::setNeedsDisplay): Invalidates LinkHighlight if present. + (WebCore::GraphicsLayerChromium::setNeedsDisplayInRect): Invalidates LinkHighlight if present. + (WebCore::GraphicsLayerChromium::setLinkHighlight): Registers LinkHighlightClient* with GraphicsLayerChromium. + (WebCore::GraphicsLayerChromium::updateChildList): Now adds LinkHighlight WebLayer if highlight active. + (WebCore::GraphicsLayerChromium::updateLayerIsDrawable): Invalidates LinkHighlight if present. + * platform/graphics/chromium/GraphicsLayerChromium.h: + (WebCore): + (LinkHighlightClient): Abstract interface seen by GraphicsLayerChromium. + (WebCore::LinkHighlightClient::~LinkHighlightClient): + (GraphicsLayerChromium): + (WebCore::GraphicsLayerChromium::linkHighlight): + * platform/graphics/chromium/LinkHighlight.cpp: Removed. + +2012-08-22 Beth Dakin <bdakin@apple.com> + + https://bugs.webkit.org/show_bug.cgi?id=94401 + Add support for making a web site become paginated using overflow: + paged-x | paged-y + -and corresponding- + <rdar://problem/11831783> + + Reviewed by Dave Hyatt. + + This patch adds two new possible values for overflow-y. They are - + webkit-paged-x and -webkit-paged-y. When you set these as overflow-y + values on the html or body element, they make the RenderView + paginated, much like the API on Page. + + -webkit-paged-x and -webkit-paged-y are only valid values for + overflow-y, NOT overflow-x. overflow-x defaults to a value of auto + (for now) unless it has been set to something else. + * css/CSSParser.cpp: + (WebCore::isValidKeywordPropertyAndValue): + (WebCore::CSSParser::parseValue): + + Two new CSS value keywords. + * css/CSSValueKeywords.in: + + EOverflow has two new values for pagination. + * rendering/style/RenderStyleConstants.h: + * css/CSSPrimitiveValueMappings.h: + (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): + (WebCore::CSSPrimitiveValue::operator EOverflow): + + A bunch of existing code from StyleResolver::styleForDocument() is + moved into a helper function so that it can be called from two + places. + * css/StyleResolver.cpp: + (WebCore::StyleResolver::collectMatchingRulesForList): + + Even though this pagination is very similar to Page::pagination(), it + is different in one critical way. Page::pagination() will apply to + all FrameViews, even those in the page cache. For this reason, + FrameView needs to keep its own Pagination value that just applies to + this FrameView. + * page/FrameView.cpp: + * page/FrameView.h: + (WebCore): + (FrameView): + + Map RenderStyle values to a Pagination::Mode. + (WebCore::paginationModeForRenderStyle): + (WebCore): + + Account for paged-x and paged-y here. + (WebCore::FrameView::applyOverflowToViewport): + + As is explained in the header, FrameView::pagination() will return + m_pagination if it has been set. Otherwise, it will return + Page::pagination() since currently there are no callers that need to + distinguish between the two. + (WebCore::FrameView::pagination): + (WebCore::FrameView::setPagination): + + Generally this means that everywhere in WebCore should ask FrameView + for the pagination(), not Page. These call sites all look to + FrameView now. + (WebCore::FrameView::paintContents): + * rendering/RenderView.cpp: + (WebCore::RenderView::requiresColumns): + (WebCore::RenderView::calcColumnWidth): + (WebCore::RenderView::paginationUnit): + (WebCore::RenderView::viewLogicalHeight): + + Since we need to define Pagination in Page.h AND FrameView.h, it is + now in its own header, Pagination.h. And therefore it is no longer + WebCore::Page::Pagination, but rather it is just WebCore::Pagination. + * page/Page.h: + (Page): + * rendering/Pagination.h: Added. + (WebCore): + (WebCore::Pagination::Pagination): + (Pagination): + (WebCore::Pagination::operator==): + (WebCore::Pagination::operator!=): + * WebCore.exp.in: + * WebCore.xcodeproj/project.pbxproj: + * GNUmakefile.list.am: + * Target.pri: + * WebCore.exp.in: + * WebCore.gypi: + + Certain ColumnInfo values are set based on the RenderStyle. So if + those RenderStyle values change, the ColumnInfo needs to be updated. + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::updateColumnInfoFromStyle): + (WebCore): + * rendering/RenderBlock.h: + (RenderBlock): + + Factor in paged-x and paged-y when determining if a RenderBlock + requires columns. + (WebCore::RenderBlock::requiresColumns): + + RenderStyle::specifiesColumns() is an odd and probably broken + function. At the very least, it should be re-named, if not removed + entirely. It does not accurately assess if columns have been + specified. I had to add this code here because specifiesColumns() + returns false for paged-x and true for paged-y. We were hitting a + number of crashes with paged-y because of this, so I chose for the + time being to limit this check to non-root layers. + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::shouldBeNormalFlowOnly): + + It's just Pagination now, not Page::Pagination. + * testing/InternalSettings.cpp: + (WebCore::InternalSettings::reset): + (WebCore::InternalSettings::setPagination): + +2012-08-22 Dean Jackson <dino@apple.com> + + [WebGL] Mac/ATI/AMD systems need to translate built-in GLSL functions + https://bugs.webkit.org/show_bug.cgi?id=94030 + + Reviewed by Tim Horton. + + ATI/AMD GPUs on Apple platforms do not give correct values for some of + the built-in GLSL functions. Add a compile flag that is passed to ANGLE + so that, with this configuration, it will rewrite the shader to emulate + the function in code. + + This is exposing some design weaknesses in the way we call ANGLE. We'll + soon need to add more compiler flags; Future bugs will likely clean + this code up. But this approach is satisfactory for the moment. + + This change is tested by the Khronos WebGL conformance test suite, in particular: + conformance/glsl/functions/glsl-function-distance.html + conformance/glsl/functions/glsl-function-dot.html + conformance/glsl/functions/glsl-function-length.html + + * platform/graphics/ANGLEWebKitBridge.cpp: + (WebCore::ANGLEWebKitBridge::validateShaderSource): Test for ATI cards + on the Mac platform, and pass in an extra flag to the translation step. + * platform/graphics/ANGLEWebKitBridge.h: + (ANGLEWebKitBridge): Add a new parameter to getTranslatedShaderSourceANGLE + that accepts some extra options to pass to ANGLE. + * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: + (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): Pass + the extra options into ANGLE's compile function. + +2012-08-22 Tommy Widenflycht <tommyw@google.com> + + [chromium] MediaStream API: Add MockWebRTCPeerConnectionHandler + https://bugs.webkit.org/show_bug.cgi?id=93091 + + Reviewed by Adam Barth. + + Fixing a FIXME that the patch obsoletes. + + Covered by existing tests. + + * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp: + (WebCore::RTCPeerConnectionHandlerChromium::initialize): + +2012-08-22 Eric Penner <epenner@google.com> + + [chromium] Simplify updateContentRect, removing rect parameter, refactor unit tests. + https://bugs.webkit.org/show_bug.cgi?id=94165 + + Reviewed by Adrienne Walker. + + Remove visible rect parameter from TiledLayerChromium functions. Passing a + rect that is not the visible rect wouldn't make sense, and soon we might + need further visibility information. + + In refactoring the unit tests, I removed texture manager from all tests + and put it in the test class. I also made some utility functions to + simulate the commit flow and remove tons of boilerplate code. I refactored + about half the unit tests to use the utility functions. + + Refactored tests. + + * platform/graphics/chromium/ContentLayerChromium.cpp: + (WebCore::ContentLayerChromium::update): + (WebCore::ContentLayerChromium::needMoreUpdates): + * platform/graphics/chromium/ImageLayerChromium.cpp: + (WebCore::ImageLayerChromium::update): + * platform/graphics/chromium/TiledLayerChromium.cpp: + (WebCore): + (WebCore::TiledLayerChromium::setTexturePriorities): + (WebCore::TiledLayerChromium::resetUpdateState): + (WebCore::TiledLayerChromium::update): + (WebCore::TiledLayerChromium::needsIdlePaint): + (WebCore::TiledLayerChromium::idlePaintRect): + * platform/graphics/chromium/TiledLayerChromium.h: + (TiledLayerChromium): + +2012-08-22 Otto Derek Cheung <otcheung@rim.com> + + [BlackBerry] Add a check to filter out cookies that tries to set the + domain to a top level domain + https://bugs.webkit.org/show_bug.cgi?id=94722 + + Reviewed by Rob Buis. + + Adding conditions to check whether a cookie domain is a top level domain. + If it is, throw it out when parsing. + + Manual Testing by trying to insert a cookie with an invalid domain + using web-inspector. (ex: when on news.yahoo.com.hk, try to document. + cookie="test1=seeifthiscookieexist; domain=.com.hk") + + PR121622 + + * platform/blackberry/CookieParser.cpp: + WebCore::CookieParser::parseOneCookie): + +2012-08-22 Rob Buis <rwlbuis@webkit.org> + + Remove RenderBlock::paintEllipsisBoxes + https://bugs.webkit.org/show_bug.cgi?id=94709 + + Reviewed by Eric Seidel. + + Remove unused method. + + No change in functionality, no new tests. + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::paintFloats): + * rendering/RenderBlock.h: + (RenderBlock): + +2012-08-22 Tommy Widenflycht <tommyw@google.com> + + MediaStream API: Introduce RTCSessionDescription + https://bugs.webkit.org/show_bug.cgi?id=93119 + + Reviewed by Adam Barth. + + This patch introduces RTCSessionDescription together with its + corresponding WebCore/platform representation. + + Test: fast/mediastream/RTCSessionDescription.html + + * CMakeLists.txt: + * GNUmakefile.list.am: + * Modules/mediastream/DOMWindowMediaStream.idl: + * Modules/mediastream/RTCSessionDescription.cpp: Added. + (WebCore): + (WebCore::RTCSessionDescription::create): + (WebCore::RTCSessionDescription::RTCSessionDescription): + (WebCore::RTCSessionDescription::~RTCSessionDescription): + (WebCore::RTCSessionDescription::type): + (WebCore::RTCSessionDescription::setType): + (WebCore::RTCSessionDescription::sdp): + (WebCore::RTCSessionDescription::setSdp): + (WebCore::RTCSessionDescription::descriptor): + * Modules/mediastream/RTCSessionDescription.h: Added. + (WebCore): + (RTCSessionDescription): + * Modules/mediastream/RTCSessionDescription.idl: Added. + * WebCore.gypi: + * platform/mediastream/RTCSessionDescriptionDescriptor.cpp: Added. + (WebCore): + (WebCore::RTCSessionDescriptionDescriptor::create): + (WebCore::RTCSessionDescriptionDescriptor::RTCSessionDescriptionDescriptor): + (WebCore::RTCSessionDescriptionDescriptor::~RTCSessionDescriptionDescriptor): + * platform/mediastream/RTCSessionDescriptionDescriptor.h: Added. + (WebCore): + (RTCSessionDescriptionDescriptor): + (WebCore::RTCSessionDescriptionDescriptor::type): + (WebCore::RTCSessionDescriptionDescriptor::setType): + (WebCore::RTCSessionDescriptionDescriptor::sdp): + (WebCore::RTCSessionDescriptionDescriptor::setSdp): + +2012-08-22 Victor Carbune <victor@rosedu.org> + + DOM manipulation crashes the browser + + Creating a DOM track element by script and changing the mode crashes + results in a browser crash. + https://bugs.webkit.org/show_bug.cgi?id=94628 + + Reviewed by Eric Carlson. + + Simple fix that creates the text track cue list in case of mode change. + + Test: media/track/track-element-dom-change-crash.html + + * html/HTMLMediaElement.cpp: + (WebCore::HTMLMediaElement::textTrackModeChanged): + +2012-08-22 Ryosuke Niwa <rniwa@webkit.org> + + Microdata build fix. + + * html/HTMLPropertiesCollection.h: + (WebCore::HTMLPropertiesCollection::updatePropertyCache): + +2012-08-22 Tommy Widenflycht <tommyw@google.com> + + MediaStream API: Introduce RTCIceCandidate + https://bugs.webkit.org/show_bug.cgi?id=93117 + + Reviewed by Adam Barth. + + This patch introduces RTCIceCandidate together with its corresponding + WebCore/platform representation. + + Test: fast/mediastream/RTCIceCandidate.html + + * CMakeLists.txt: + * GNUmakefile.list.am: + * Modules/mediastream/DOMWindowMediaStream.idl: + * Modules/mediastream/RTCIceCandidate.cpp: Added. + (WebCore): + (WebCore::RTCIceCandidate::create): + (WebCore::RTCIceCandidate::RTCIceCandidate): + (WebCore::RTCIceCandidate::~RTCIceCandidate): + (WebCore::RTCIceCandidate::candidate): + (WebCore::RTCIceCandidate::sdpMid): + (WebCore::RTCIceCandidate::sdpMLineIndex): + (WebCore::RTCIceCandidate::descriptor): + * Modules/mediastream/RTCIceCandidate.h: Added. + (WebCore): + (RTCIceCandidate): + * Modules/mediastream/RTCIceCandidate.idl: Added. + * WebCore.gypi: + * platform/mediastream/RTCIceCandidateDescriptor.cpp: Added. + (WebCore): + (WebCore::RTCIceCandidateDescriptor::create): + (WebCore::RTCIceCandidateDescriptor::RTCIceCandidateDescriptor): + (WebCore::RTCIceCandidateDescriptor::~RTCIceCandidateDescriptor): + * platform/mediastream/RTCIceCandidateDescriptor.h: Added. + (WebCore): + (RTCIceCandidateDescriptor): + (WebCore::RTCIceCandidateDescriptor::candidate): + (WebCore::RTCIceCandidateDescriptor::sdpMid): + (WebCore::RTCIceCandidateDescriptor::sdpMLineIndex): + +2012-08-22 Mark Rowe <mrowe@apple.com> + + <http://webkit.org/b/94679> WebCore scrolling thread leaks objects due to them being autoreleased without any autorelease pool in place + + Reviewed by Dan Bernstein. + + * page/scrolling/mac/ScrollingThreadMac.mm: + (WebCore::ScrollingThread::threadRunLoopSourceCallback): Ensure that an autorelease pool is in place when + dispatching functions on the scrolling thread. + +2012-08-22 Pratik Solanki <psolanki@apple.com> + + Failure to dispatch delegate callbacks if resource load fails synchronously + https://bugs.webkit.org/show_bug.cgi?id=94644 + + Reviewed by Antti Koivisto. + + Resource loads can be triggered by layout after document load is + complete but before we have dispatched didFinishLoadForFrame callback. + In such cases, if the load fails synchronously due to the client + returning 0 from willSendRequest callback, we would fail to call + didFinishLoading. this was fixed for Font resources in r122446 for bug + 91018. This fixes it in the general case by having CachedResourceLoader + call FrameLoader::checkLoadComplete() when it is done loading all + resources. + + * css/CSSFontSelector.cpp: + (WebCore::CSSFontSelector::beginLoadTimerFired): + * loader/cache/CachedResourceLoader.cpp: + (WebCore::CachedResourceLoader::decrementRequestCount): + +2012-08-22 Kenneth Russell <kbr@google.com> + + Unreviewed, rolling out r126319. + http://trac.webkit.org/changeset/126319 + https://bugs.webkit.org/show_bug.cgi?id=84487 + + Broke Chromium Mac build + + * WebCore.gypi: + * platform/graphics/chromium/GraphicsLayerChromium.cpp: + (WebCore::GraphicsLayerChromium::GraphicsLayerChromium): + (WebCore::GraphicsLayerChromium::willBeDestroyed): + (WebCore::GraphicsLayerChromium::updateNames): + (WebCore::GraphicsLayerChromium::setSize): + (WebCore::GraphicsLayerChromium::setNeedsDisplay): + (WebCore::GraphicsLayerChromium::setNeedsDisplayInRect): + (WebCore::GraphicsLayerChromium::addLinkHighlight): + (WebCore::GraphicsLayerChromium::didFinishLinkHighlight): + (WebCore): + (WebCore::GraphicsLayerChromium::updateChildList): + (WebCore::GraphicsLayerChromium::updateLayerIsDrawable): + * platform/graphics/chromium/GraphicsLayerChromium.h: + (WebCore): + (GraphicsLayerChromium): + * platform/graphics/chromium/LinkHighlight.cpp: Added. + (WebCore): + (WebCore::LinkHighlight::create): + (WebCore::LinkHighlight::LinkHighlight): + (WebCore::LinkHighlight::~LinkHighlight): + (WebCore::LinkHighlight::contentLayer): + (WebCore::LinkHighlight::paintContents): + (WebCore::LinkHighlight::notifyAnimationStarted): + (WebCore::LinkHighlight::notifyAnimationFinished): + * platform/graphics/chromium/LinkHighlight.h: Renamed from Source/WebKit/chromium/src/LinkHighlight.h. + (WebCore): + (LinkHighlight): + +2012-08-22 Alexei Svitkine <asvitkine@chromium.org> + + Respect system setting for rubber-banding in ScrollAnimatorMac. + https://bugs.webkit.org/show_bug.cgi?id=94356 + + Reviewed by James Robinson. + + Respects user defaults setting of NSScrollViewRubberbanding, + which controls rubber-banding in other Mac OS X applications. + + If NSScrollViewRubberbanding is not set, defaults to enabling + rubber banding. Otherwise, rubber banding is disabled if the + value is 0 and enabled otherwise. + + No new tests since the behavior depends on system settings. + + * platform/mac/ScrollAnimatorMac.mm: + (WebCore): + (WebCore::rubberBandingEnabledForSystem): + (WebCore::ScrollAnimatorMac::handleWheelEvent): + +2012-08-22 James Robinson <jamesr@chromium.org> + + [chromium/mac] Remove unnecessary checks for OS version <= 10.5. We don't support those + https://bugs.webkit.org/show_bug.cgi?id=94658 + + Reviewed by Tony Chang. + + The chromium mac port hasn't supported Leopard for a while now, so remove chromium-specific code that checks + for OS X version <= Leopard. + + * platform/graphics/chromium/CrossProcessFontLoading.mm: + (WebCore::FontPlatformData::loadFont): + * platform/graphics/cocoa/FontPlatformDataCocoa.mm: + (WebCore::canSetCascadeListForCustomFont): + +2012-08-22 W. James MacLean <wjmaclean@chromium.org> + + [chromium] Add touch link highlight animation layers. + https://bugs.webkit.org/show_bug.cgi?id=84487 + + Reviewed by James Robinson. + + Adds support for creating composited touch link highlights in renderer thread. Clipping not yet + implemented for non-composited frames/overflow divs, but scrolling and layout changes are supported. + Transform support currently limited to translation. + + Unit tests for LinkHighlight revised. + + Tests: platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled-clipped.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled-late-composite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled-late-noncomposite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-composited.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-scrolled-clipped.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe-scrolled.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-iframe.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-composited-scroll-clip.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-composited-scrolled.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-composited.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-layout-change-2.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-layout-change.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-scroll-clip.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-scrolled-late-composite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-scrolled-late-noncomposite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div-scrolled.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-1-overflow-div.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-composited-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-composited-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner-clipped.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner-late-composite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer-clipped.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer-late-composite.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-iframe.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-inner-scroll-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-inner-scroll-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-outer-scroll-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-outer-scroll-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-composited-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-scrolled-inner.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div-scrolled-outer.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-2-overflow-div.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-rotated.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledX.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledY.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-window-scroll.html + platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple.html + + * WebCore.gypi: + * platform/graphics/chromium/GraphicsLayerChromium.cpp: + (WebCore::GraphicsLayerChromium::GraphicsLayerChromium): + (WebCore::GraphicsLayerChromium::willBeDestroyed): Adds notification to LinkHighlight when layer goes away. + (WebCore::GraphicsLayerChromium::updateNames): Now sets debug name for LinkHighlight layer. + (WebCore::GraphicsLayerChromium::setSize): Invalidates LinkHighlight if present. + (WebCore::GraphicsLayerChromium::setNeedsDisplay): Invalidates LinkHighlight if present. + (WebCore::GraphicsLayerChromium::setNeedsDisplayInRect): Invalidates LinkHighlight if present. + (WebCore::GraphicsLayerChromium::setLinkHighlight): Registers LinkHighlightClient* with GraphicsLayerChromium. + (WebCore::GraphicsLayerChromium::updateChildList): Now adds LinkHighlight WebLayer if highlight active. + (WebCore::GraphicsLayerChromium::updateLayerIsDrawable): Invalidates LinkHighlight if present. + * platform/graphics/chromium/GraphicsLayerChromium.h: + (WebCore): + (LinkHighlightClient): Abstract interface seen by GraphicsLayerChromium. + (WebCore::LinkHighlightClient::~LinkHighlightClient): + (GraphicsLayerChromium): + (WebCore::GraphicsLayerChromium::linkHighlight): + * platform/graphics/chromium/LinkHighlight.cpp: Removed. + +2012-08-22 Gustavo Noronha Silva <gns@gnome.org> + + Unreviewed build fix. Missing PANGO_CFLAGS. + + * GNUmakefile.am: + +2012-08-22 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: make "sdk" component compile independently from the rest of the front-end. + https://bugs.webkit.org/show_bug.cgi?id=94705 + + Reviewed by Vsevolod Vlasov. + + This change refactors the way we compile. Running "compile-front-end.py sdk" will compile sdk only. + It also introduces DOMStorageModel and DatabaseModel that are used to split model / UI layers. + + * WebCore.gypi: + * WebCore.vcproj/WebCore.vcproj: + * inspector/InjectedScriptExterns.js: + (InjectedScriptHost.prototype.evaluate): + * inspector/Inspector.json: + * inspector/compile-front-end.py: + (dump_module): + * inspector/front-end/CompilerScriptMapping.js: + * inspector/front-end/ConsoleModel.js: + (WebInspector.ConsoleMessage): + (WebInspector.ConsoleMessage.prototype.clone): + (WebInspector.ConsoleMessage.prototype.location): + * inspector/front-end/DOMAgent.js: + * inspector/front-end/DOMStorage.js: + (WebInspector.DOMStorageModel): + (WebInspector.DOMStorageModel.prototype._addDOMStorage): + (WebInspector.DOMStorageModel.prototype._domStorageUpdated): + (WebInspector.DOMStorageModel.prototype.storageForId): + (WebInspector.DOMStorageModel.prototype.storages): + (WebInspector.DOMStorageDispatcher): + (WebInspector.DOMStorageDispatcher.prototype.addDOMStorage): + (WebInspector.DOMStorageDispatcher.prototype.domStorageUpdated): + * inspector/front-end/Database.js: + (WebInspector.Database): + (WebInspector.Database.prototype.executeSql): + (WebInspector.DatabaseModel): + (WebInspector.DatabaseModel.prototype.databases): + (WebInspector.DatabaseModel.prototype.databaseForId): + (WebInspector.DatabaseModel.prototype._addDatabase): + (WebInspector.DatabaseModel.prototype._sqlTransactionSucceeded): + (WebInspector.DatabaseModel.prototype._sqlTransactionFailed): + (WebInspector.DatabaseDispatcher): + (WebInspector.DatabaseDispatcher.prototype.addDatabase): + (WebInspector.DatabaseDispatcher.prototype.sqlTransactionSucceeded): + (WebInspector.DatabaseDispatcher.prototype.sqlTransactionFailed): + * inspector/front-end/DebuggerModel.js: + * inspector/front-end/FileUtils.js: + (WebInspector.OutputStreamDelegate.prototype.onTransferStarted): + (WebInspector.OutputStreamDelegate.prototype.onChunkTransferred): + (WebInspector.OutputStreamDelegate.prototype.onTransferFinished): + (WebInspector.OutputStreamDelegate.prototype.onError): + (WebInspector.OutputStream): + (WebInspector.OutputStream.prototype.startTransfer): + (WebInspector.OutputStream.prototype.transferChunk): + (WebInspector.OutputStream.prototype.finishTransfer): + (WebInspector.OutputStream.prototype.dispose): + * inspector/front-end/HandlerRegistry.js: + * inspector/front-end/HeapSnapshotView.js: + * inspector/front-end/InspectorFrontendHostStub.js: + * inspector/front-end/PresentationConsoleMessageHelper.js: + (WebInspector.PresentationConsoleMessageHelper.prototype._parsedScriptSource): + * inspector/front-end/ResourcesPanel.js: + (WebInspector.ResourcesPanel): + (WebInspector.ResourcesPanel.prototype._reset): + (WebInspector.ResourcesPanel.prototype._databaseAdded): + (WebInspector.ResourcesPanel.prototype._addDatabase): + (WebInspector.ResourcesPanel.prototype._domStorageAdded): + (WebInspector.ResourcesPanel.prototype._addDOMStorage): + (WebInspector.ResourcesPanel.prototype._showDatabase.get if): + (WebInspector.ResourcesPanel.prototype._showDatabase.else.get if): + (WebInspector.ResourcesPanel.prototype._showDatabase): + (WebInspector.ResourcesPanel.prototype._showDOMStorage.get if): + (WebInspector.ResourcesPanel.prototype._showDOMStorage): + (WebInspector.ResourcesPanel.prototype._updateDatabaseTables.get if): + (WebInspector.ResourcesPanel.prototype._updateDatabaseTables.tableNamesCallback): + (WebInspector.DatabaseTreeElement.prototype.onselect): + (WebInspector.DatabaseTableTreeElement.prototype.onselect): + (WebInspector.DOMStorageTreeElement.prototype.onselect): + * inspector/front-end/ScriptsPanel.js: + (WebInspector.ScriptsPanel.prototype.showFunctionDefinition): + * inspector/front-end/SearchController.js: + (WebInspector.SearchController.prototype.disableSearchUntilExplicitAction): + * inspector/front-end/Settings.js: + * inspector/front-end/Spectrum.js: + * inspector/front-end/TextEditorModel.js: + * inspector/front-end/UIString.js: Added. + (WebInspector.UIString): + * inspector/front-end/UIUtils.js: + * inspector/front-end/WebKit.qrc: + * inspector/front-end/externs.js: + (InspectorFrontendHostAPI.prototype.platform): + (InspectorFrontendHostAPI.prototype.port): + (InspectorFrontendHostAPI.prototype.bringToFront): + (InspectorFrontendHostAPI.prototype.closeWindow): + (InspectorFrontendHostAPI.prototype.requestAttachWindow): + (InspectorFrontendHostAPI.prototype.requestDetachWindow): + (InspectorFrontendHostAPI.prototype.requestSetDockSide): + (InspectorFrontendHostAPI.prototype.setAttachedWindowHeight): + (InspectorFrontendHostAPI.prototype.moveWindowBy): + (InspectorFrontendHostAPI.prototype.setInjectedScriptForOrigin): + (InspectorFrontendHostAPI.prototype.loaded): + (InspectorFrontendHostAPI.prototype.localizedStringsURL): + (InspectorFrontendHostAPI.prototype.hiddenPanels): + (InspectorFrontendHostAPI.prototype.inspectedURLChanged): + (InspectorFrontendHostAPI.prototype.documentCopy): + (InspectorFrontendHostAPI.prototype.copyText): + (InspectorFrontendHostAPI.prototype.openInNewTab): + (InspectorFrontendHostAPI.prototype.canSave): + (InspectorFrontendHostAPI.prototype.save): + (InspectorFrontendHostAPI.prototype.canAppend): + (InspectorFrontendHostAPI.prototype.append): + (InspectorFrontendHostAPI.prototype.sendMessageToBackend): + (InspectorFrontendHostAPI.prototype.recordActionTaken): + (InspectorFrontendHostAPI.prototype.recordPanelShown): + (InspectorFrontendHostAPI.prototype.recordSettingChanged): + (InspectorFrontendHostAPI.prototype.loadResourceSynchronously): + (InspectorFrontendHostAPI.prototype.setZoomFactor): + (InspectorFrontendHostAPI.prototype.canInspectWorkers): + (SourceMapV3): + (SourceMapV3.Section): + (SourceMapV3.Offset): + * inspector/front-end/inspector.html: + * inspector/front-end/inspector.js: + (WebInspector.inspect): + +2012-08-22 Gustavo Noronha Silva <gns@gnome.org> + + Unreviewed build fix. libWebCore needs include paths + for some bits of WebCoreGtk. + + * GNUmakefile.am: + +2012-08-22 Koji Ishii <kojiishi@gmail.com> + + FontMetrics.unitsPerEm(), FontPlatformData.orientation(), SimpleFontData::platformBoundsForGlyph are not implemented on Chromium Windows + https://bugs.webkit.org/show_bug.cgi?id=83512 + + Reviewed by Tony Chang. + + Chromium Windows does not implement following 3 functions that are required for bug 51450. + 1. FontMetrics.unitsPerEm() always returns the default value (gDefaultUnitsPerEm = 1000). + 2. FontPlatformData.orientation() always returns Horizontal. + 3. SimpleFontData::platformBoundsForGlyph() always returns FloatRect(). + Tony suggested in bug 51450 review to split code that is not behind + #if ENABLE(OPENTYPE_VERTICAL) to a separate patch. + + Test: Following 3 existing but skipped tests are now enabled and pass. + fast/text/emphasis-overlap.html + fast/text/emphasis-avoid-ruby.html + fast/repaint/text-emphasis-v.html + + * platform/graphics/chromium/FontCacheChromiumWin.cpp: + (WebCore::FontCache::createFontPlatformData): Add orientation. + * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp: + (WebCore::FontPlatformData::FontPlatformData): Add orientation. + (WebCore::FontPlatformData::operator=): Add orientation. + * platform/graphics/chromium/FontPlatformDataChromiumWin.h: + (FontPlatformData): + (WebCore::FontPlatformData::orientation): Add orientation. + (WebCore::FontPlatformData::setOrientation): Add orientation. + (WebCore::FontPlatformData::operator==): Add orientation. + * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp: + (WebCore::SimpleFontData::platformInit): Set FontMetrics.unitsPerEm. + (WebCore::SimpleFontData::createScaledFontData): Add orientation. + (WebCore::SimpleFontData::platformBoundsForGlyph): Implemented. + * platform/graphics/skia/FontCustomPlatformData.cpp: + (WebCore::FontCustomPlatformData::fontPlatformData): Add orientation. + +2012-08-22 Robert Hogan <robert@webkit.org> + + REGRESSION(r125578): fast/regex/unicodeCaseInsensitive.html crash on Linux Debug Chromium + https://bugs.webkit.org/show_bug.cgi?id=94010 + + Reviewed by Tony Chang. + + r125578 inspected the raw text run for word-end but the index it used to do so was for a normalized + version of the run that could be longer than the raw text run. So to allow proper detection of word-end + in complex text (i) do not normalize tabs to plain white-space and (ii) go back to using the normalized version + of the run for detecting word-end. There is a risk that some fonts may create glyphs for the '\t' character + but this does not turn up in any of our regression tests and the more common risk appears to be the new-line. + + Test: fast/regex/unicodeCaseInsensitive.html + + * platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp: + (WebCore::normalizeSpacesAndMirrorChars): + +2012-08-22 Andrey Adaikin <aandrey@chromium.org> + + Web Inspector: [WebGL] Support the communication protocol from the injected script + https://bugs.webkit.org/show_bug.cgi?id=94689 + + Reviewed by Pavel Feldman. + + Support the WebGL communication protocol from the injected script module. + + * inspector/InjectedScriptWebGLModuleSource.js: + (.): + +2012-08-22 Gustavo Noronha Silva <gns@gnome.org> + + [GTK] Split WebCore/platform into a separate library + https://bugs.webkit.org/show_bug.cgi?id=94435 + + Reviewed by Martin Robinson. + + More people have been reporting problems when linking WebCore because + the command line limit is being exceeded. Splitting WebCore a bit more + is in order. + + * GNUmakefile.am: add new libWebCorePlatform convenience library. + * GNUmakefile.list.am: move list of platform/* files to its own variable. + +2012-08-22 Raphael Kubo da Costa <rakuco@webkit.org> + + [EFL] Build failures with harfbuzz outside standard locations + https://bugs.webkit.org/show_bug.cgi?id=93030 + + Reviewed by Rob Buis. + + Add ${HARFBUZZ_INCLUDE_DIRS} to the list of included paths: so far + it was being implicitly pulled from evas's pkg-config file, and + used to work when WebKit-EFL's dependencies were built with + jhbuild -- in this case, harfbuzz is built before evas, which is + then built with harfbuzz support and adds the required paths to + its .pc file. + + We need to include things directly to account for the case of + people not using jhbuild and thus not necessarily having harfbuzz + as an evas dependency. + + * PlatformEfl.cmake: + +2012-08-22 Raul Hudea <rhudea@adobe.com> + + Crash in WebCore::RenderBlock::removeChild + https://bugs.webkit.org/show_bug.cgi?id=93879 + + Reviewed by Abhishek Arya. + + By adding the lifetime state to the RenderNamedFlowThread (r122556), it become possible for the a RenderRegion object to delete its sibling, + the RenderNamedFlowThread. This is unexpected in the rendering world and cause problems in RenderBlock::removeChild where we retain previous + and next sibling pointers. + So, all the RenderNamedFlowThread are created under a RenderFlowThreadContainer object insted of the RenderView. The new object is created only + when the first named flow is created. + + Test: fast/regions/remove-flow-thread-crash.html + + * CMakeLists.txt: + * GNUmakefile.list.am: + * Target.pri: + * WebCore.gypi: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * rendering/FlowThreadController.cpp: + (WebCore::FlowThreadController::FlowThreadController): Added initialization for the new RenderFlowThreadContainer member + (WebCore::FlowThreadController::ensureRenderFlowThreadWithName): Added the creation of the RenderFlowThreadContainer object and use it as a parent for all RenderNamedFlowThreads + (WebCore::FlowThreadController::styleDidChange): Inform all the RenderNamedFlowThreads that the style changed in regions (initially this code was in RenderView, but now all RenderNamedFlowThreads are children of RenderFlowThreadContainer) + (WebCore): + * rendering/FlowThreadController.h: + (WebCore): + (FlowThreadController): + * rendering/RenderFlowThreadContainer.cpp: Added. + (WebCore): + (WebCore::RenderFlowThreadContainer::RenderFlowThreadContainer): + (WebCore::RenderFlowThreadContainer::layout): + * rendering/RenderFlowThreadContainer.h: Added. + * rendering/RenderObject.cpp: + (WebCore::RenderObject::markContainingBlocksForLayout): Skip to RenderView if the current object is an RenderFlowThreadContainer. + * rendering/RenderObject.h: + (WebCore::RenderObject::isRenderFlowThreadContainer): + * rendering/RenderView.cpp: + (WebCore::RenderView::styleDidChange): Moved the code associated to RenderNamedFlowThreads to FlowThreadController:styleDidChange and call it instead. + +2012-08-22 Rob Buis <rbuis@rim.com> + + [BlackBerry] Add RSS content handling support + https://bugs.webkit.org/show_bug.cgi?id=93496 + + Reviewed by Yong Li. + + Cleanup some more. + + * platform/network/blackberry/rss/RSSFilterStream.cpp: + (WebCore): + (WebCore::createParser): + (WebCore::defaultEncodingForLanguage): + (WebCore::isTranscodingNeeded): + +2012-08-21 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> + + Remove unused TextDrawingMode flags from GraphicsContext + https://bugs.webkit.org/show_bug.cgi?id=21898 + + Reviewed by Benjamin Poulain. + + Remove TextModeClip and TextModeInvisible. These are not used by any port, and + according to https://bugs.webkit.org/show_bug.cgi?id=42110#c2 these were added + just to map CG existing flags, but are not used. + + * platform/graphics/GraphicsContext.h: + * platform/graphics/cg/GraphicsContextCG.cpp: + (WebCore::GraphicsContext::setPlatformTextDrawingMode): + * platform/graphics/openvg/PainterOpenVG.cpp: + (WebCore::PainterOpenVG::drawText): + * platform/graphics/skia/PlatformContextSkia.cpp: + (WebCore::PlatformContextSkia::setTextDrawingMode): + +2012-08-22 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r126287. + http://trac.webkit.org/changeset/126287 + https://bugs.webkit.org/show_bug.cgi?id=94708 + + It made WK1 layout testing 3.7x slower (>1hours) (Requested by + ossy on #webkit). + + * bridge/qt/qt_instance.cpp: + (JSC::Bindings::unusedWeakObjectMapCallback): + (Bindings): + (JSC::Bindings::WeakMapImpl::WeakMapImpl): + (JSC::Bindings::WeakMapImpl::~WeakMapImpl): + (JSC::Bindings::WeakMap::~WeakMap): + (JSC::Bindings::WeakMap::set): + (JSC::Bindings::WeakMap::get): + (JSC::Bindings::WeakMap::remove): + * bridge/qt/qt_instance.h: + (QtInstance): + * bridge/qt/qt_runtime.cpp: + (JSC::Bindings::prototypeForSignalsAndSlots): + (JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod): + (JSC::Bindings::QtRuntimeMethod::call): + (JSC::Bindings::QtRuntimeMethod::jsObjectRef): + (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect): + * bridge/qt/qt_runtime.h: + (QtRuntimeMethod): + +2012-08-22 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: follow up to r126297, fixing WebCore.gypi. + + * WebCore.gypi: + +2012-08-22 Carlos Garcia Campos <cgarcia@igalia.com> + + [GTK] Preferred languages and spellchecker APIs are not consistent in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=94683 + + Reviewed by Alejandro G. Castro. + + Use a Vector<String> instead of a comma-separated string to + get/set languages. + + * platform/text/gtk/TextCheckerEnchant.cpp: + (TextCheckerEnchant::updateSpellCheckingLanguages): + (TextCheckerEnchant::getSpellCheckingLanguages): + * platform/text/gtk/TextCheckerEnchant.h: + (TextCheckerEnchant): + +2012-08-22 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: move NavigatorView and NavigatorOverlayController to ScriptsPanel module + https://bugs.webkit.org/show_bug.cgi?id=94693 + + Reviewed by Vsevolod Vlasov. + + Loading them via importScript now. + + * inspector/compile-front-end.py: + * inspector/front-end/ScriptsPanel.js: + * inspector/front-end/inspector.html: + +2012-08-22 KwangYong Choi <ky0.choi@samsung.com> + + [EFL] Support slider tick mark snapping + https://bugs.webkit.org/show_bug.cgi?id=94560 + + Reviewed by Kenneth Rohde Christiansen. + + Increased the threshold for the EFL port. The value is snapped + when it clicked near tick mark. + + No new tests. Covered by fast/forms/datalist/range-snap-to-datalist.html. + + * platform/efl/RenderThemeEfl.cpp: + (WebCore): + (WebCore::RenderThemeEfl::sliderTickSnappingThreshold): + * platform/efl/RenderThemeEfl.h: + (RenderThemeEfl): + +2012-08-22 Allan Sandfeld Jensen <allan.jensen@nokia.com> + + [Qt] Optionally support smooth-scrolling on all platforms + https://bugs.webkit.org/show_bug.cgi?id=74926 + + Reviewed by Simon Hausmann. + + Make GestureAnimations depend on the GESTURE_ANIMATION feature flag, + since GestureAnimations are unused on some platforms. + + * Target.pri: + * platform/ScrollAnimatorNone.cpp: + (WebCore::ScrollAnimatorNone::fireUpAnAnimation): + (WebCore::ScrollAnimatorNone::cancelAnimations): + (WebCore::ScrollAnimatorNone::animationTimerFired): + * platform/ScrollAnimatorNone.h: + (ScrollAnimatorNone): + +2012-08-22 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] Port convertQVariantToValue to use the JSC C API + https://bugs.webkit.org/show_bug.cgi?id=93889 + + Reviewed by Kenneth Rohde Christiansen. + + Based on patch by Noam Rosenthal. + + This patch is another step towards reducing the use of internal JSC API + in the Qt bridge. Most of the conversion from QVariant to JS values is + straight-forward. The biggest behavioural change is that QVariant lists + are converted on-the-spot instead of lazily. Bug #94691 tracks fixing + that. + + * bridge/qt/qt_instance.cpp: + (Bindings): + (JSC::Bindings::QtField::valueFromInstance): + * bridge/qt/qt_runtime.cpp: + (JSC::Bindings::convertQVariantToValue): + (JSC::Bindings::QtRuntimeMethod::call): + (JSC::Bindings::QtConnectionObject::execute): + (JSC::Bindings::::valueAt): + * bridge/qt/qt_runtime.h: + (Bindings): + +2012-08-22 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] REGRESSION(r125428): fast/profiler/nested-start-and-stop-profiler.html fails + https://bugs.webkit.org/show_bug.cgi?id=93897 + + Reviewed by Kenneth Rohde Christiansen. + + Before r125428 run-time methods (wrapped signals, slots or invokable + functions) were subclasses of JSInternalFunction and therefore real + function objects in the JavaScript sense. r125428 changed them to be + just callable objects, but they did not have Function.prototype as + prototype anymore for example nor was their name correct (resulting in + a layout test failure). + + This patch changes run-time methods back to being real function objects + that have a correct name and have Function.prototype in their prototype + change + + The objects returned by JSObjectMakeFunctionWithCallbackInjected are + light-weight internal function objects that do not support + JSObject{Set/Get}Private. Therefore we inject our own prototype right + before the Function.prototype prototype, which uses private data to + store a pointer to our C++ QtRuntimeMethod object. This complicates + the retrieval of the pointer to that instance slightly, which is why + this patch introduces the toRuntimeMethod convenience function that + looks up our prototype first and does a check for type-safety. + + At the same time the patch removes the length properties from the + run-time method itself as well as connect/disconnect. The length + property on a function signifies the number of arguments, but in all + three cases that number is actually variable, because of overloading. + That is why we choose not to expose it in the first place. + + In QtInstance we cache the JS wrapper objects for QtRuntimeMethod in a + JSWeakObjectMap. JSWeakObjectMap requires the stored objects to be + either the result of JSObjectMake or the global object of a context ref + (AFAICS), which is ensured using an ASSERT. Objects created via + JSObjectMakeFunctionWithCalllback do not fall into the required + category, cause a failing assertion and can therefore not be stored in + the weak object map. + + Consequently this patch removes the use of JSWeakObjectMap again and + goes back to the old way of using the internal Weak<> API, for the time + being. In a future patch the storage will be simplified to not require + the use of a weak object map cache for the run-time methods anymore. + + * bridge/qt/qt_instance.cpp: Remove unused WeakMap code. + * bridge/qt/qt_instance.h: Remove method cache. + (QtInstance): + * bridge/qt/qt_runtime.cpp: + (JSC::Bindings::prototypeForSignalsAndSlots): + (JSC::Bindings::QtRuntimeMethod::call): + (JSC::Bindings::QtRuntimeMethod::jsObjectRef): + (JSC::Bindings::QtRuntimeMethod::toRuntimeMethod): + (Bindings): + (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect): + * bridge/qt/qt_runtime.h: + (QtRuntimeMethod): Remove unused member variables. + +2012-08-22 Christophe Dumez <christophe.dumez@intel.com> + + window.postMessage() / MessagePort.postMessage() throw wrong exception for invalid ports argument + https://bugs.webkit.org/show_bug.cgi?id=94581 + + Reviewed by Kentaro Hara. + + Update JSC and V8 implementations of window.postMessage() and + MessagePort.postMessage() in order to throw an + INVALID_STATE_ERR instead of a DATA_CLONE_ERR when values + in the "ports" argument are invalid. Additionally, we now + check for duplicate ports and throw an exception for this + case as well. + + This change was made to comply with the latest HTML5 + specification at: + http://www.w3.org/TR/html5/comms.html + + No new tests, already tested by: + fast/events/constructors/message-event-constructor.html + fast/events/message-port-clone.html + fast/events/message-port-multi.html + fast/workers/worker-context-multi-port.html + fast/workers/worker-multi-port.html + + * bindings/js/JSMessagePortCustom.cpp: + (WebCore::fillMessagePortArray): + * bindings/v8/V8Utilities.cpp: + (WebCore::extractTransferables): + * dom/MessagePort.cpp: + (WebCore::MessagePort::postMessage): + 2012-08-22 Allan Sandfeld Jensen <allan.jensen@nokia.com> [TouchAdjustment] Adjust to word or selection diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am index 394098616..761b21495 100644 --- a/Source/WebCore/GNUmakefile.am +++ b/Source/WebCore/GNUmakefile.am @@ -949,6 +949,7 @@ DerivedSources/WebCore/JS%.h: %.idl $(SCRIPTS_FOR_GENERATE_BINDINGS) $(WebCore)/ $(webkitgtk_sources) $(webkit2_sources) $(webkit2_plugin_process_sources) $(webcore_sources) $(webcoregtk_sources) : | $(supplemental_dependency_file) $(webcore_built_sources) noinst_LTLIBRARIES += \ + libWebCorePlatform.la \ libWebCoreModules.la \ libWebCore.la @@ -960,24 +961,10 @@ $(webcore_lib_for_dep): $(srcdir)/Source/WebCore/GNUmakefile.am $(srcdir)/Source webcoremodules_lib_for_dep = libWebcoreModules.la $(webcoremodules_lib_for_dep): $(srcdir)/Source/WebCore/GNUmakefile.am $(srcdir)/Source/WebCore/GNUmakefile.list.am -nodist_EXTRA_libWebCore_la_SOURCES = \ - $(webcore_built_nosources) - -nodist_libWebCore_la_SOURCES = \ - $(webcore_built_sources) +webcoreplatform_lib_for_dep = libWebcorePlatform.la +$(webcoreplatform_lib_for_dep): $(srcdir)/Source/WebCore/GNUmakefile.am $(srcdir)/Source/WebCore/GNUmakefile.list.am -libWebCore_la_SOURCES = \ - $(webcore_sources) - -libWebCore_la_CXXFLAGS = \ - $(SYMBOL_VISIBILITY_INLINES) \ - $(global_cxxflags) - -libWebCore_la_CFLAGS = \ - $(SYMBOL_VISIBILITY) \ - $(global_cflags) - -libWebCore_la_CPPFLAGS = \ +common_webcore_shards_cppflags += \ -DBUILDING_WEBKIT \ $(global_cppflags) \ $(webcore_cppflags) \ @@ -995,12 +982,31 @@ libWebCore_la_CPPFLAGS = \ $(LIBSOUP_CFLAGS) \ $(LIBXML_CFLAGS) \ $(LIBXSLT_CFLAGS) \ - $(PANGO_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(UNICODE_CFLAGS) \ $(XRENDER_CFLAGS) \ $(XT_CFLAGS) +nodist_EXTRA_libWebCore_la_SOURCES = \ + $(webcore_built_nosources) + +nodist_libWebCore_la_SOURCES = \ + $(webcore_built_sources) + +libWebCore_la_SOURCES = \ + $(webcore_sources) + +libWebCore_la_CXXFLAGS = \ + $(SYMBOL_VISIBILITY_INLINES) \ + $(global_cxxflags) + +libWebCore_la_CFLAGS = \ + $(SYMBOL_VISIBILITY) \ + $(global_cflags) + +libWebCore_la_CPPFLAGS = \ + $(common_webcore_shards_cppflags) + if TARGET_WIN32 # PluginPackageWin.cpp needs the symbols from version dll libWebCore_la_LIBADD = -lversion @@ -1015,6 +1021,21 @@ libWebCoreModules_la_CFLAGS = $(libWebCore_la_CFLAGS) libWebCoreModules_la_CPPFLAGS = $(libWebCore_la_CPPFLAGS) +libWebCorePlatform_la_SOURCES = \ + $(webcore_platform_sources) + +libWebCorePlatform_la_CXXFLAGS = \ + $(SYMBOL_VISIBILITY_INLINES) \ + $(global_cxxflags) + +libWebCorePlatform_la_CFLAGS = \ + $(SYMBOL_VISIBILITY) \ + $(global_cflags) + +libWebCorePlatform_la_CPPFLAGS = \ + $(common_webcore_shards_cppflags) \ + $(PANGO_CFLAGS) + # We have a different library with only the files that require GTK+. It allows us # to build a common WebCore lib and two different gtk WebCore libs depending on # the gtk version. In WeKit2 gtk2 is not supported, but the plugin process needs to @@ -1035,30 +1056,12 @@ libWebCoreGtk_la_CFLAGS = \ $(global_cflags) libWebCoreGtk_la_CPPFLAGS = \ - -DBUILDING_WEBKIT \ - $(global_cppflags) \ - $(webcore_cppflags) \ - $(webcoregtk_cppflags) \ - $(javascriptcore_cppflags) \ - -fno-strict-aliasing \ + $(common_webcore_shards_cppflags) \ $(HILDON_CPPFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(ENCHANT_CFLAGS) \ - $(FARSTREAM_CFLAGS) \ - $(GAIL_CFLAGS) \ - $(GEOCLUE_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(GSTREAMER_CFLAGS) \ - $(GTK_CFLAGS) \ $(HILDON_CFLAGS) \ - $(LIBSOUP_CFLAGS) \ - $(LIBXML_CFLAGS) \ - $(LIBXSLT_CFLAGS) \ - $(SQLITE3_CFLAGS) \ - $(UNICODE_CFLAGS) \ - $(XCOMPOSITE_CFLAGS) \ - $(XRENDER_CFLAGS) \ - $(XT_CFLAGS) + $(GAIL_CFLAGS) \ + $(FARSTREAM_CFLAGS) + EXTRA_DIST += \ $(shell ls $(srcdir)/Source/WebCore/Modules/filesystem/*.idl) \ diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am index b7336ccff..f57642056 100644 --- a/Source/WebCore/GNUmakefile.list.am +++ b/Source/WebCore/GNUmakefile.list.am @@ -624,8 +624,12 @@ webcore_built_sources += \ DerivedSources/WebCore/JSRequestAnimationFrameCallback.h \ DerivedSources/WebCore/JSRGBColor.cpp \ DerivedSources/WebCore/JSRGBColor.h \ + DerivedSources/WebCore/JSRTCIceCandidate.cpp \ + DerivedSources/WebCore/JSRTCIceCandidate.h \ DerivedSources/WebCore/JSRTCPeerConnection.cpp \ DerivedSources/WebCore/JSRTCPeerConnection.h \ + DerivedSources/WebCore/JSRTCSessionDescription.cpp \ + DerivedSources/WebCore/JSRTCSessionDescription.h \ DerivedSources/WebCore/JSScreen.cpp \ DerivedSources/WebCore/JSScreen.h \ DerivedSources/WebCore/JSScriptProfile.cpp \ @@ -1214,7 +1218,9 @@ dom_binding_idls += \ $(WebCore)/Modules/mediastream/NavigatorUserMediaErrorCallback.idl \ $(WebCore)/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl \ $(WebCore)/Modules/mediastream/PeerConnection00.idl \ + $(WebCore)/Modules/mediastream/RTCIceCandidate.idl \ $(WebCore)/Modules/mediastream/RTCPeerConnection.idl \ + $(WebCore)/Modules/mediastream/RTCSessionDescription.idl \ $(WebCore)/Modules/mediastream/SessionDescription.idl \ $(WebCore)/Modules/notifications/Notification.idl \ $(WebCore)/Modules/notifications/NotificationCenter.idl \ @@ -1899,8 +1905,12 @@ webcore_modules_sources += \ Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.h \ Source/WebCore/Modules/mediastream/PeerConnection00.cpp \ Source/WebCore/Modules/mediastream/PeerConnection00.h \ + Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp \ + Source/WebCore/Modules/mediastream/RTCIceCandidate.h \ Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp \ Source/WebCore/Modules/mediastream/RTCPeerConnection.h \ + Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp \ + Source/WebCore/Modules/mediastream/RTCSessionDescription.h \ Source/WebCore/Modules/mediastream/SessionDescription.cpp \ Source/WebCore/Modules/mediastream/SessionDescription.h \ Source/WebCore/Modules/mediastream/UserMediaClient.h \ @@ -4032,739 +4042,6 @@ webcore_sources += \ Source/WebCore/page/WindowFocusAllowedIndicator.h \ Source/WebCore/page/WorkerNavigator.cpp \ Source/WebCore/page/WorkerNavigator.h \ - Source/WebCore/platform/animation/Animation.cpp \ - Source/WebCore/platform/animation/Animation.h \ - Source/WebCore/platform/animation/AnimationList.cpp \ - Source/WebCore/platform/animation/AnimationList.h \ - Source/WebCore/platform/animation/AnimationUtilities.h \ - Source/WebCore/platform/animation/TimingFunction.h \ - Source/WebCore/platform/audio/AudioArray.h \ - Source/WebCore/platform/audio/AudioBus.cpp \ - Source/WebCore/platform/audio/AudioBus.h \ - Source/WebCore/platform/audio/AudioChannel.cpp \ - Source/WebCore/platform/audio/AudioChannel.h \ - Source/WebCore/platform/audio/AudioDestination.h \ - Source/WebCore/platform/audio/AudioDSPKernel.h \ - Source/WebCore/platform/audio/AudioDSPKernelProcessor.cpp \ - Source/WebCore/platform/audio/AudioDSPKernelProcessor.h \ - Source/WebCore/platform/audio/AudioFileReader.h \ - Source/WebCore/platform/audio/AudioIOCallback.h \ - Source/WebCore/platform/audio/AudioProcessor.h \ - Source/WebCore/platform/audio/AudioResampler.cpp \ - Source/WebCore/platform/audio/AudioResampler.h \ - Source/WebCore/platform/audio/AudioResamplerKernel.cpp \ - Source/WebCore/platform/audio/AudioResamplerKernel.h \ - Source/WebCore/platform/audio/AudioSourceProvider.h \ - Source/WebCore/platform/audio/AudioSourceProviderClient.h \ - Source/WebCore/platform/audio/AudioUtilities.cpp \ - Source/WebCore/platform/audio/AudioUtilities.h \ - Source/WebCore/platform/audio/Biquad.cpp \ - Source/WebCore/platform/audio/Biquad.h \ - Source/WebCore/platform/audio/Cone.cpp \ - Source/WebCore/platform/audio/Cone.h \ - Source/WebCore/platform/audio/DenormalDisabler.h \ - Source/WebCore/platform/audio/DirectConvolver.cpp \ - Source/WebCore/platform/audio/DirectConvolver.h \ - Source/WebCore/platform/audio/Distance.cpp \ - Source/WebCore/platform/audio/Distance.h \ - Source/WebCore/platform/audio/DynamicsCompressor.h \ - Source/WebCore/platform/audio/DynamicsCompressorKernel.cpp \ - Source/WebCore/platform/audio/DynamicsCompressorKernel.h \ - Source/WebCore/platform/audio/DynamicsCompressor.cpp \ - Source/WebCore/platform/audio/EqualPowerPanner.cpp \ - Source/WebCore/platform/audio/EqualPowerPanner.h \ - Source/WebCore/platform/audio/FFTConvolver.cpp \ - Source/WebCore/platform/audio/FFTConvolver.h \ - Source/WebCore/platform/audio/FFTFrame.cpp \ - Source/WebCore/platform/audio/FFTFrame.h \ - Source/WebCore/platform/audio/FFTFrameStub.cpp \ - Source/WebCore/platform/audio/HRTFDatabase.cpp \ - Source/WebCore/platform/audio/HRTFDatabase.h \ - Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp \ - Source/WebCore/platform/audio/HRTFDatabaseLoader.h \ - Source/WebCore/platform/audio/HRTFElevation.cpp \ - Source/WebCore/platform/audio/HRTFElevation.h \ - Source/WebCore/platform/audio/HRTFKernel.cpp \ - Source/WebCore/platform/audio/HRTFKernel.h \ - Source/WebCore/platform/audio/HRTFPanner.cpp \ - Source/WebCore/platform/audio/HRTFPanner.h \ - Source/WebCore/platform/audio/MultiChannelResampler.cpp \ - Source/WebCore/platform/audio/MultiChannelResampler.h \ - Source/WebCore/platform/audio/Panner.cpp \ - Source/WebCore/platform/audio/Panner.h \ - Source/WebCore/platform/audio/ReverbAccumulationBuffer.cpp \ - Source/WebCore/platform/audio/ReverbAccumulationBuffer.h \ - Source/WebCore/platform/audio/ReverbConvolver.cpp \ - Source/WebCore/platform/audio/ReverbConvolver.h \ - Source/WebCore/platform/audio/ReverbConvolverStage.cpp \ - Source/WebCore/platform/audio/ReverbConvolverStage.h \ - Source/WebCore/platform/audio/Reverb.cpp \ - Source/WebCore/platform/audio/Reverb.h \ - Source/WebCore/platform/audio/ReverbInputBuffer.cpp \ - Source/WebCore/platform/audio/ReverbInputBuffer.h \ - Source/WebCore/platform/audio/SincResampler.cpp \ - Source/WebCore/platform/audio/SincResampler.h \ - Source/WebCore/platform/audio/VectorMath.cpp \ - Source/WebCore/platform/audio/VectorMath.h \ - Source/WebCore/platform/audio/ZeroPole.cpp \ - Source/WebCore/platform/audio/ZeroPole.h \ - Source/WebCore/platform/ActivePlatformGestureAnimation.cpp \ - Source/WebCore/platform/ActivePlatformGestureAnimation.h \ - Source/WebCore/platform/PlatformGestureCurve.h \ - Source/WebCore/platform/PlatformGestureCurveTarget.h \ - Source/WebCore/platform/Arena.cpp \ - Source/WebCore/platform/Arena.h \ - Source/WebCore/platform/AsyncFileSystem.cpp \ - Source/WebCore/platform/AsyncFileSystem.h \ - Source/WebCore/platform/AutodrainedPool.h \ - Source/WebCore/platform/CalculationValue.cpp \ - Source/WebCore/platform/CalculationValue.h \ - Source/WebCore/platform/Clock.cpp \ - Source/WebCore/platform/Clock.h \ - Source/WebCore/platform/ClockGeneric.cpp \ - Source/WebCore/platform/ClockGeneric.h \ - Source/WebCore/platform/ColorChooser.h \ - Source/WebCore/platform/ColorChooserClient.h \ - Source/WebCore/platform/ContentType.cpp \ - Source/WebCore/platform/ContentType.h \ - Source/WebCore/platform/ContextMenu.h \ - Source/WebCore/platform/ContextMenuItem.h \ - Source/WebCore/platform/Cookie.h \ - Source/WebCore/platform/CookiesStrategy.h \ - Source/WebCore/platform/CookieJar.h \ - Source/WebCore/platform/CrossThreadCopier.cpp \ - Source/WebCore/platform/CrossThreadCopier.h \ - Source/WebCore/platform/Cursor.cpp \ - Source/WebCore/platform/Cursor.h \ - Source/WebCore/platform/DateComponents.cpp \ - Source/WebCore/platform/DateComponents.h \ - Source/WebCore/platform/Decimal.cpp \ - Source/WebCore/platform/Decimal.h \ - Source/WebCore/platform/DragData.cpp \ - Source/WebCore/platform/DragData.h \ - Source/WebCore/platform/DragImage.cpp \ - Source/WebCore/platform/DragImage.h \ - Source/WebCore/platform/EventLoop.h \ - Source/WebCore/platform/EventTracer.cpp \ - Source/WebCore/platform/EventTracer.h \ - Source/WebCore/platform/PlatformInstrumentation.cpp \ - Source/WebCore/platform/PlatformInstrumentation.h \ - Source/WebCore/platform/FileChooser.cpp \ - Source/WebCore/platform/FileChooser.h \ - Source/WebCore/platform/FileIconLoader.cpp \ - Source/WebCore/platform/FileIconLoader.h \ - Source/WebCore/platform/FileMetadata.h \ - Source/WebCore/platform/FileStreamClient.h \ - Source/WebCore/platform/FileStream.cpp \ - Source/WebCore/platform/FileStream.h \ - Source/WebCore/platform/FileSystem.cpp \ - Source/WebCore/platform/FileSystem.h \ - Source/WebCore/platform/FloatConversion.h \ - Source/WebCore/platform/FractionalLayoutUnit.h \ - Source/WebCore/platform/Gamepads.h \ - Source/WebCore/platform/HashTools.h \ - Source/WebCore/platform/HistogramSupport.cpp \ - Source/WebCore/platform/HistogramSupport.h \ - Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp \ - Source/WebCore/platform/graphics/ANGLEWebKitBridge.h \ - Source/WebCore/platform/graphics/BitmapImage.cpp \ - Source/WebCore/platform/graphics/BitmapImage.h \ - Source/WebCore/platform/graphics/Color.cpp \ - Source/WebCore/platform/graphics/Color.h \ - Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp \ - Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h \ - Source/WebCore/platform/graphics/ColorSpace.h \ - Source/WebCore/platform/graphics/DashArray.h \ - Source/WebCore/platform/graphics/Extensions3D.h \ - Source/WebCore/platform/graphics/NativeImagePtr.h \ - Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp \ - Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp \ - Source/WebCore/platform/graphics/cairo/CairoUtilities.h \ - Source/WebCore/platform/graphics/cairo/FloatRectCairo.cpp \ - Source/WebCore/platform/graphics/cairo/FontCairo.cpp \ - Source/WebCore/platform/graphics/cairo/FontCustomPlatformData.h \ - Source/WebCore/platform/graphics/cairo/GradientCairo.cpp \ - Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp \ - Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h \ - Source/WebCore/platform/graphics/cairo/ImageCairo.cpp \ - Source/WebCore/platform/graphics/cairo/IntRectCairo.cpp \ - Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp \ - Source/WebCore/platform/graphics/cairo/NativeImageCairo.h \ - Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp \ - Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h \ - Source/WebCore/platform/graphics/cairo/PathCairo.cpp \ - Source/WebCore/platform/graphics/cairo/PatternCairo.cpp \ - Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp \ - Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h \ - Source/WebCore/platform/graphics/cairo/PlatformPathCairo.h \ - Source/WebCore/platform/graphics/cairo/PlatformPathCairo.cpp \ - Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp \ - Source/WebCore/platform/graphics/cairo/RefPtrCairo.h \ - Source/WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp \ - Source/WebCore/platform/graphics/filters/CustomFilterGlobalContext.cpp \ - Source/WebCore/platform/graphics/filters/CustomFilterGlobalContext.h \ - Source/WebCore/platform/graphics/filters/CustomFilterMesh.cpp \ - Source/WebCore/platform/graphics/filters/CustomFilterMesh.h \ - Source/WebCore/platform/graphics/filters/CustomFilterNumberParameter.h \ - Source/WebCore/platform/graphics/filters/CustomFilterOperation.cpp \ - Source/WebCore/platform/graphics/filters/CustomFilterOperation.h \ - Source/WebCore/platform/graphics/filters/CustomFilterParameter.h \ - Source/WebCore/platform/graphics/filters/CustomFilterProgram.cpp \ - Source/WebCore/platform/graphics/filters/CustomFilterProgram.h \ - Source/WebCore/platform/graphics/filters/CustomFilterProgramInfo.cpp \ - Source/WebCore/platform/graphics/filters/CustomFilterProgramInfo.h \ - Source/WebCore/platform/graphics/filters/CustomFilterCompiledProgram.cpp \ - Source/WebCore/platform/graphics/filters/CustomFilterCompiledProgram.h \ - Source/WebCore/platform/graphics/filters/DistantLightSource.cpp \ - Source/WebCore/platform/graphics/filters/DistantLightSource.h \ - Source/WebCore/platform/graphics/filters/FEBlend.cpp \ - Source/WebCore/platform/graphics/filters/FEBlend.h \ - Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp \ - Source/WebCore/platform/graphics/filters/FEColorMatrix.h \ - Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp \ - Source/WebCore/platform/graphics/filters/FEComponentTransfer.h \ - Source/WebCore/platform/graphics/filters/FEComposite.cpp \ - Source/WebCore/platform/graphics/filters/FEComposite.h \ - Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp \ - Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h \ - Source/WebCore/platform/graphics/filters/FECustomFilter.cpp \ - Source/WebCore/platform/graphics/filters/FECustomFilter.h \ - Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp \ - Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h \ - Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp \ - Source/WebCore/platform/graphics/filters/FEDisplacementMap.h \ - Source/WebCore/platform/graphics/filters/FEDropShadow.cpp \ - Source/WebCore/platform/graphics/filters/FEDropShadow.h \ - Source/WebCore/platform/graphics/filters/FEFlood.cpp \ - Source/WebCore/platform/graphics/filters/FEFlood.h \ - Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp \ - Source/WebCore/platform/graphics/filters/FEGaussianBlur.h \ - Source/WebCore/platform/graphics/filters/FELighting.cpp \ - Source/WebCore/platform/graphics/filters/FELighting.h \ - Source/WebCore/platform/graphics/filters/FEMerge.cpp \ - Source/WebCore/platform/graphics/filters/FEMerge.h \ - Source/WebCore/platform/graphics/filters/FEMorphology.cpp \ - Source/WebCore/platform/graphics/filters/FEMorphology.h \ - Source/WebCore/platform/graphics/filters/FEOffset.cpp \ - Source/WebCore/platform/graphics/filters/FEOffset.h \ - Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp \ - Source/WebCore/platform/graphics/filters/FESpecularLighting.h \ - Source/WebCore/platform/graphics/filters/FETile.cpp \ - Source/WebCore/platform/graphics/filters/FETile.h \ - Source/WebCore/platform/graphics/filters/FETurbulence.cpp \ - Source/WebCore/platform/graphics/filters/FETurbulence.h \ - Source/WebCore/platform/graphics/filters/Filter.h \ - Source/WebCore/platform/graphics/filters/FilterEffect.cpp \ - Source/WebCore/platform/graphics/filters/FilterEffect.h \ - Source/WebCore/platform/graphics/filters/FilterOperation.h \ - Source/WebCore/platform/graphics/filters/FilterOperation.cpp \ - Source/WebCore/platform/graphics/filters/FilterOperations.cpp \ - Source/WebCore/platform/graphics/filters/FilterOperations.h \ - Source/WebCore/platform/graphics/filters/LightSource.cpp \ - Source/WebCore/platform/graphics/filters/LightSource.h \ - Source/WebCore/platform/graphics/filters/PointLightSource.cpp \ - Source/WebCore/platform/graphics/filters/PointLightSource.h \ - Source/WebCore/platform/graphics/filters/SourceAlpha.cpp \ - Source/WebCore/platform/graphics/filters/SourceAlpha.h \ - Source/WebCore/platform/graphics/filters/SourceGraphic.cpp \ - Source/WebCore/platform/graphics/filters/SourceGraphic.h \ - Source/WebCore/platform/graphics/filters/SpotLightSource.cpp \ - Source/WebCore/platform/graphics/filters/SpotLightSource.h \ - Source/WebCore/platform/graphics/filters/arm/NEONHelpers.h \ - Source/WebCore/platform/graphics/filters/arm/FEBlendNEON.h \ - Source/WebCore/platform/graphics/filters/arm/FECompositeArithmeticNEON.h \ - Source/WebCore/platform/graphics/filters/arm/FEGaussianBlurNEON.h \ - Source/WebCore/platform/graphics/filters/arm/FELightingNEON.cpp \ - Source/WebCore/platform/graphics/filters/arm/FELightingNEON.h \ - Source/WebCore/platform/graphics/FloatPoint3D.cpp \ - Source/WebCore/platform/graphics/FloatPoint3D.h \ - Source/WebCore/platform/graphics/FloatPoint.cpp \ - Source/WebCore/platform/graphics/FloatPoint.h \ - Source/WebCore/platform/graphics/FloatQuad.cpp \ - Source/WebCore/platform/graphics/FloatQuad.h \ - Source/WebCore/platform/graphics/FloatRect.cpp \ - Source/WebCore/platform/graphics/FloatRect.h \ - Source/WebCore/platform/graphics/FloatSize.cpp \ - Source/WebCore/platform/graphics/FloatSize.h \ - Source/WebCore/platform/graphics/FontBaseline.h \ - Source/WebCore/platform/graphics/FontCache.cpp \ - Source/WebCore/platform/graphics/FontCache.h \ - Source/WebCore/platform/graphics/Font.cpp \ - Source/WebCore/platform/graphics/FontData.cpp \ - Source/WebCore/platform/graphics/FontData.h \ - Source/WebCore/platform/graphics/FontDescription.cpp \ - Source/WebCore/platform/graphics/FontDescription.h \ - Source/WebCore/platform/graphics/FontFallbackList.cpp \ - Source/WebCore/platform/graphics/FontFallbackList.h \ - Source/WebCore/platform/graphics/FontFamily.cpp \ - Source/WebCore/platform/graphics/FontFamily.h \ - Source/WebCore/platform/graphics/FontFastPath.cpp \ - Source/WebCore/platform/graphics/FontFeatureSettings.cpp \ - Source/WebCore/platform/graphics/FontFeatureSettings.h \ - Source/WebCore/platform/graphics/Font.h \ - Source/WebCore/platform/graphics/FontMetrics.h \ - Source/WebCore/platform/graphics/FontOrientation.h \ - Source/WebCore/platform/graphics/FontPlatformData.h \ - Source/WebCore/platform/graphics/FontRenderingMode.h \ - Source/WebCore/platform/graphics/FontSelector.h \ - Source/WebCore/platform/graphics/FontSmoothingMode.h \ - Source/WebCore/platform/graphics/FontTraitsMask.h \ - Source/WebCore/platform/graphics/FontWidthVariant.h \ - Source/WebCore/platform/graphics/FractionalLayoutBoxExtent.cpp \ - Source/WebCore/platform/graphics/FractionalLayoutBoxExtent.h \ - Source/WebCore/platform/graphics/FractionalLayoutPoint.h \ - Source/WebCore/platform/graphics/FractionalLayoutRect.cpp \ - Source/WebCore/platform/graphics/FractionalLayoutRect.h \ - Source/WebCore/platform/graphics/FractionalLayoutSize.h \ - Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp \ - Source/WebCore/platform/graphics/GeneratorGeneratedImage.h \ - Source/WebCore/platform/graphics/GeneratedImage.h \ - Source/WebCore/platform/graphics/Generator.h \ - Source/WebCore/platform/graphics/Glyph.h \ - Source/WebCore/platform/graphics/GlyphBuffer.h \ - Source/WebCore/platform/graphics/GlyphMetricsMap.h \ - Source/WebCore/platform/graphics/GlyphPage.h \ - Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp \ - Source/WebCore/platform/graphics/GlyphPageTreeNode.h \ - Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp \ - Source/WebCore/platform/graphics/gpu/DrawingBuffer.h \ - Source/WebCore/platform/graphics/Gradient.cpp \ - Source/WebCore/platform/graphics/Gradient.h \ - Source/WebCore/platform/graphics/GraphicsContext.cpp \ - Source/WebCore/platform/graphics/GraphicsContext.h \ - Source/WebCore/platform/graphics/GraphicsContext3D.cpp \ - Source/WebCore/platform/graphics/GraphicsContext3D.h \ - Source/WebCore/platform/graphics/GraphicsLayer.h \ - Source/WebCore/platform/graphics/GraphicsLayer.cpp \ - Source/WebCore/platform/graphics/GraphicsLayerClient.h \ - Source/WebCore/platform/graphics/GraphicsTypes.cpp \ - Source/WebCore/platform/graphics/GraphicsTypes.h \ - Source/WebCore/platform/graphics/GraphicsTypes3D.h \ - Source/WebCore/platform/graphics/Icon.h \ - Source/WebCore/platform/graphics/ImageBuffer.cpp \ - Source/WebCore/platform/graphics/ImageBuffer.h \ - Source/WebCore/platform/graphics/ImageBufferData.h \ - Source/WebCore/platform/graphics/Image.cpp \ - Source/WebCore/platform/graphics/Image.h \ - Source/WebCore/platform/graphics/ImageObserver.h \ - Source/WebCore/platform/graphics/ImageOrientation.cpp \ - Source/WebCore/platform/graphics/ImageOrientation.h \ - Source/WebCore/platform/graphics/ImageSource.cpp \ - Source/WebCore/platform/graphics/ImageSource.h \ - Source/WebCore/platform/graphics/IntPoint.h \ - Source/WebCore/platform/graphics/IntPointHash.h \ - Source/WebCore/platform/graphics/IntRect.cpp \ - Source/WebCore/platform/graphics/IntRect.h \ - Source/WebCore/platform/graphics/IntSize.h \ - Source/WebCore/platform/graphics/IntSizeHash.h \ - Source/WebCore/platform/graphics/MediaPlayer.cpp \ - Source/WebCore/platform/graphics/MediaPlayer.h \ - Source/WebCore/platform/graphics/MediaPlayerPrivate.h \ - Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp \ - Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h \ - Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp \ - Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h \ - Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \ - Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp \ - Source/WebCore/platform/graphics/OpenGLShims.cpp \ - Source/WebCore/platform/graphics/OpenGLShims.h \ - Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.h \ - Source/WebCore/platform/graphics/Path.cpp \ - Source/WebCore/platform/graphics/Path.h \ - Source/WebCore/platform/graphics/PathTraversalState.cpp \ - Source/WebCore/platform/graphics/PathTraversalState.h \ - Source/WebCore/platform/graphics/Pattern.cpp \ - Source/WebCore/platform/graphics/Pattern.h \ - Source/WebCore/platform/graphics/PlatformLayer.h \ - Source/WebCore/platform/graphics/Region.cpp \ - Source/WebCore/platform/graphics/Region.h \ - Source/WebCore/platform/graphics/RoundedRect.cpp \ - Source/WebCore/platform/graphics/RoundedRect.h \ - Source/WebCore/platform/graphics/SegmentedFontData.cpp \ - Source/WebCore/platform/graphics/SegmentedFontData.h \ - Source/WebCore/platform/graphics/ShadowBlur.cpp \ - Source/WebCore/platform/graphics/ShadowBlur.h \ - Source/WebCore/platform/graphics/SimpleFontData.cpp \ - Source/WebCore/platform/graphics/SimpleFontData.h \ - Source/WebCore/platform/graphics/StringTruncator.cpp \ - Source/WebCore/platform/graphics/StringTruncator.h \ - Source/WebCore/platform/graphics/StrokeStyleApplier.h \ - Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp \ - Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h \ - Source/WebCore/platform/graphics/SVGGlyph.cpp \ - Source/WebCore/platform/graphics/SVGGlyph.h \ - Source/WebCore/platform/graphics/TextRenderingMode.h \ - Source/WebCore/platform/graphics/TextRun.cpp \ - Source/WebCore/platform/graphics/TextRun.h \ - Source/WebCore/platform/graphics/TiledBacking.h \ - Source/WebCore/platform/graphics/transforms/AffineTransform.cpp \ - Source/WebCore/platform/graphics/transforms/AffineTransform.h \ - Source/WebCore/platform/graphics/transforms/IdentityTransformOperation.h \ - Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.cpp \ - Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h \ - Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp \ - Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.h \ - Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.cpp \ - Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.h \ - Source/WebCore/platform/graphics/transforms/RotateTransformOperation.cpp \ - Source/WebCore/platform/graphics/transforms/RotateTransformOperation.h \ - Source/WebCore/platform/graphics/transforms/ScaleTransformOperation.cpp \ - Source/WebCore/platform/graphics/transforms/ScaleTransformOperation.h \ - Source/WebCore/platform/graphics/transforms/SkewTransformOperation.cpp \ - Source/WebCore/platform/graphics/transforms/SkewTransformOperation.h \ - Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp \ - Source/WebCore/platform/graphics/transforms/TransformationMatrix.h \ - Source/WebCore/platform/graphics/transforms/TransformOperation.h \ - Source/WebCore/platform/graphics/transforms/TransformOperations.cpp \ - Source/WebCore/platform/graphics/transforms/TransformOperations.h \ - Source/WebCore/platform/graphics/transforms/TransformState.cpp \ - Source/WebCore/platform/graphics/transforms/TransformState.h \ - Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.cpp \ - Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h \ - Source/WebCore/platform/graphics/TypesettingFeatures.h \ - Source/WebCore/platform/graphics/UnitBezier.h \ - Source/WebCore/platform/graphics/WidthIterator.cpp \ - Source/WebCore/platform/graphics/WidthIterator.h \ - Source/WebCore/platform/graphics/WindRule.h \ - Source/WebCore/platform/graphics/WOFFFileFormat.cpp \ - Source/WebCore/platform/graphics/WOFFFileFormat.h \ - Source/WebCore/platform/gtk/ErrorsGtk.cpp \ - Source/WebCore/platform/gtk/ErrorsGtk.h \ - Source/WebCore/platform/gtk/GamepadsGtk.cpp \ - Source/WebCore/platform/gtk/KURLGtk.cpp \ - Source/WebCore/platform/gtk/LanguageGtk.cpp \ - Source/WebCore/platform/gtk/LoggingGtk.cpp \ - Source/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp \ - Source/WebCore/platform/gtk/SharedBufferGtk.cpp \ - Source/WebCore/platform/gtk/TemporaryLinkStubs.cpp \ - Source/WebCore/platform/HostWindow.h \ - Source/WebCore/platform/KillRing.h \ - Source/WebCore/platform/KillRingNone.cpp \ - Source/WebCore/platform/KURL.cpp \ - Source/WebCore/platform/KURL.h \ - Source/WebCore/platform/KURLHash.h \ - Source/WebCore/platform/KURLWTFURL.cpp \ - Source/WebCore/platform/KURLWTFURLImpl.h \ - Source/WebCore/platform/Language.cpp \ - Source/WebCore/platform/Language.h \ - Source/WebCore/platform/LengthBox.cpp \ - Source/WebCore/platform/LengthBox.h \ - Source/WebCore/platform/Length.cpp \ - Source/WebCore/platform/Length.h \ - Source/WebCore/platform/LengthSize.h \ - Source/WebCore/platform/leveldb/LevelDBComparator.h \ - Source/WebCore/platform/leveldb/LevelDBDatabase.cpp \ - Source/WebCore/platform/leveldb/LevelDBDatabase.h \ - Source/WebCore/platform/leveldb/LevelDBIterator.h \ - Source/WebCore/platform/leveldb/LevelDBSlice.h \ - Source/WebCore/platform/leveldb/LevelDBTransaction.h \ - Source/WebCore/platform/leveldb/LevelDBTransaction.cpp \ - Source/WebCore/platform/leveldb/LevelDBWriteBatch.h \ - Source/WebCore/platform/leveldb/LevelDBWriteBatch.cpp \ - Source/WebCore/platform/LinkHash.cpp \ - Source/WebCore/platform/LinkHash.h \ - Source/WebCore/platform/LocalizedStrings.h \ - Source/WebCore/platform/Logging.cpp \ - Source/WebCore/platform/Logging.h \ - Source/WebCore/platform/MIMETypeRegistry.cpp \ - Source/WebCore/platform/MIMETypeRegistry.h \ - Source/WebCore/platform/MemoryPressureHandler.cpp \ - Source/WebCore/platform/MemoryPressureHandler.h \ - Source/WebCore/platform/MemoryUsageSupport.cpp \ - Source/WebCore/platform/MemoryUsageSupport.h \ - Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp \ - Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h \ - Source/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp \ - Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h \ - Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp \ - Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp \ - Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h \ - Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp \ - Source/WebCore/platform/image-decoders/gif/GIFImageReader.h \ - Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp \ - Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h \ - Source/WebCore/platform/image-decoders/ImageDecoder.cpp \ - Source/WebCore/platform/image-decoders/ImageDecoder.h \ - Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \ - Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h \ - Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp \ - Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h \ - Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp \ - Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h \ - Source/WebCore/platform/LayoutTestSupport.cpp \ - Source/WebCore/platform/LayoutTestSupport.h \ - Source/WebCore/platform/linux/GamepadDeviceLinux.cpp \ - Source/WebCore/platform/linux/GamepadDeviceLinux.h \ - Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp \ - Source/WebCore/platform/mediastream/IceCandidateDescriptor.h \ - Source/WebCore/platform/mediastream/IceOptions.cpp \ - Source/WebCore/platform/mediastream/IceOptions.h \ - Source/WebCore/platform/mediastream/MediaHints.cpp \ - Source/WebCore/platform/mediastream/MediaHints.h \ - Source/WebCore/platform/mediastream/MediaStreamCenter.cpp \ - Source/WebCore/platform/mediastream/MediaStreamCenter.h \ - Source/WebCore/platform/mediastream/MediaStreamComponent.h \ - Source/WebCore/platform/mediastream/MediaStreamDescriptor.h \ - Source/WebCore/platform/mediastream/MediaStreamSource.cpp \ - Source/WebCore/platform/mediastream/MediaStreamSource.h \ - Source/WebCore/platform/mediastream/MediaStreamSourcesQueryClient.h \ - Source/WebCore/platform/mediastream/PeerConnection00Handler.cpp \ - Source/WebCore/platform/mediastream/PeerConnection00Handler.h \ - Source/WebCore/platform/mediastream/PeerConnection00HandlerClient.h \ - Source/WebCore/platform/mediastream/RTCConfiguration.h \ - Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp \ - Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h \ - Source/WebCore/platform/mediastream/RTCPeerConnectionHandlerClient.h \ - Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.cpp \ - Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h \ - Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp \ - Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h \ - Source/WebCore/platform/mock/DeviceMotionClientMock.cpp \ - Source/WebCore/platform/mock/DeviceMotionClientMock.h \ - Source/WebCore/platform/mock/DeviceOrientationClientMock.cpp \ - Source/WebCore/platform/mock/DeviceOrientationClientMock.h \ - Source/WebCore/platform/mock/GeolocationClientMock.cpp \ - Source/WebCore/platform/mock/GeolocationClientMock.h \ - Source/WebCore/platform/mock/ScrollbarThemeMock.cpp \ - Source/WebCore/platform/mock/ScrollbarThemeMock.h \ - Source/WebCore/platform/network/AuthenticationChallengeBase.cpp \ - Source/WebCore/platform/network/AuthenticationChallengeBase.h \ - Source/WebCore/platform/network/AuthenticationClient.h \ - Source/WebCore/platform/network/BlobData.cpp \ - Source/WebCore/platform/network/BlobData.h \ - Source/WebCore/platform/network/BlobRegistry.h \ - Source/WebCore/platform/network/BlobRegistryImpl.cpp \ - Source/WebCore/platform/network/BlobRegistryImpl.h \ - Source/WebCore/platform/network/BlobResourceHandle.cpp \ - Source/WebCore/platform/network/BlobResourceHandle.h \ - Source/WebCore/platform/network/BlobStorageData.h \ - Source/WebCore/platform/network/ContentTypeParser.cpp \ - Source/WebCore/platform/network/ContentTypeParser.h \ - Source/WebCore/platform/network/CookieStorage.h \ - Source/WebCore/platform/network/Credential.cpp \ - Source/WebCore/platform/network/Credential.h \ - Source/WebCore/platform/network/CredentialStorage.cpp \ - Source/WebCore/platform/network/CredentialStorage.h \ - Source/WebCore/platform/network/DNS.h \ - Source/WebCore/platform/network/DNSResolveQueue.cpp \ - Source/WebCore/platform/network/DNSResolveQueue.h \ - Source/WebCore/platform/network/FormDataBuilder.cpp \ - Source/WebCore/platform/network/FormDataBuilder.h \ - Source/WebCore/platform/network/FormData.cpp \ - Source/WebCore/platform/network/FormData.h \ - Source/WebCore/platform/network/HTTPHeaderMap.cpp \ - Source/WebCore/platform/network/HTTPHeaderMap.h \ - Source/WebCore/platform/network/HTTPParsers.cpp \ - Source/WebCore/platform/network/HTTPParsers.h \ - Source/WebCore/platform/network/HTTPRequest.cpp \ - Source/WebCore/platform/network/HTTPRequest.h \ - Source/WebCore/platform/network/HTTPValidation.cpp \ - Source/WebCore/platform/network/HTTPValidation.h \ - Source/WebCore/platform/network/MIMEHeader.cpp \ - Source/WebCore/platform/network/MIMEHeader.h \ - Source/WebCore/platform/network/NetworkingContext.h \ - Source/WebCore/platform/network/ProxyServer.cpp \ - Source/WebCore/platform/network/ProxyServer.h \ - Source/WebCore/platform/network/NetworkStateNotifier.cpp \ - Source/WebCore/platform/network/NetworkStateNotifier.h \ - Source/WebCore/platform/network/ProtectionSpaceHash.h \ - Source/WebCore/platform/network/ProtectionSpace.cpp \ - Source/WebCore/platform/network/ProtectionSpace.h \ - Source/WebCore/platform/network/ResourceErrorBase.cpp \ - Source/WebCore/platform/network/ResourceErrorBase.h \ - Source/WebCore/platform/network/ResourceHandleClient.h \ - Source/WebCore/platform/network/ResourceHandle.cpp \ - Source/WebCore/platform/network/ResourceHandle.h \ - Source/WebCore/platform/network/ResourceHandleInternal.h \ - Source/WebCore/platform/network/ResourceLoadInfo.h \ - Source/WebCore/platform/network/ResourceLoadPriority.h \ - Source/WebCore/platform/network/ResourceLoadTiming.cpp \ - Source/WebCore/platform/network/ResourceLoadTiming.h \ - Source/WebCore/platform/network/ResourceRequestBase.cpp \ - Source/WebCore/platform/network/ResourceRequestBase.h \ - Source/WebCore/platform/network/ResourceResponseBase.cpp \ - Source/WebCore/platform/network/ResourceResponseBase.h \ - Source/WebCore/platform/network/SocketStreamErrorBase.cpp \ - Source/WebCore/platform/network/SocketStreamErrorBase.h \ - Source/WebCore/platform/network/SocketStreamHandleBase.cpp \ - Source/WebCore/platform/network/SocketStreamHandleBase.h \ - Source/WebCore/platform/network/SocketStreamHandleClient.h \ - Source/WebCore/platform/network/soup/AuthenticationChallenge.h \ - Source/WebCore/platform/network/soup/CookieJarSoup.cpp \ - Source/WebCore/platform/network/soup/CookieJarSoup.h \ - Source/WebCore/platform/network/soup/CookieStorageSoup.cpp \ - Source/WebCore/platform/network/soup/CredentialStorageSoup.cpp \ - Source/WebCore/platform/network/soup/DNSSoup.cpp \ - Source/WebCore/platform/network/soup/GOwnPtrSoup.cpp \ - Source/WebCore/platform/network/soup/GOwnPtrSoup.h \ - Source/WebCore/platform/network/soup/ProxyServerSoup.cpp \ - Source/WebCore/platform/network/soup/ResourceError.h \ - Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp \ - Source/WebCore/platform/network/soup/ResourceRequest.h \ - Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp \ - Source/WebCore/platform/network/soup/ResourceResponse.h \ - Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp \ - Source/WebCore/platform/network/soup/SocketStreamError.h \ - Source/WebCore/platform/network/soup/SocketStreamHandle.h \ - Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp \ - Source/WebCore/platform/network/soup/SoupURIUtils.cpp \ - Source/WebCore/platform/network/soup/SoupURIUtils.h \ - Source/WebCore/platform/NotImplemented.h \ - Source/WebCore/platform/Pasteboard.h \ - Source/WebCore/platform/PasteboardStrategy.h \ - Source/WebCore/platform/PlatformEvent.cpp \ - Source/WebCore/platform/PlatformEvent.h \ - Source/WebCore/platform/PlatformExportMacros.h \ - Source/WebCore/platform/PlatformGestureCurve.h \ - Source/WebCore/platform/PlatformGestureEvent.h \ - Source/WebCore/platform/PlatformKeyboardEvent.h \ - Source/WebCore/platform/PlatformMenuDescription.h \ - Source/WebCore/platform/PlatformMouseEvent.h \ - Source/WebCore/platform/PlatformPasteboard.h \ - Source/WebCore/platform/PlatformScreen.h \ - Source/WebCore/platform/PlatformStrategies.cpp \ - Source/WebCore/platform/PlatformStrategies.h \ - Source/WebCore/platform/PlatformWheelEvent.h \ - Source/WebCore/platform/PODArena.h \ - Source/WebCore/platform/PODFreeListArena.h \ - Source/WebCore/platform/PODInterval.h \ - Source/WebCore/platform/PODIntervalTree.h \ - Source/WebCore/platform/PODRedBlackTree.h \ - Source/WebCore/platform/PopupMenuClient.h \ - Source/WebCore/platform/PopupMenu.h \ - Source/WebCore/platform/PopupMenuStyle.h \ - Source/WebCore/platform/PrerenderHandle.h \ - Source/WebCore/platform/PurgeableBuffer.h \ - Source/WebCore/platform/PurgePriority.h \ - Source/WebCore/platform/RefCountedSupplement.h \ - Source/WebCore/platform/ReferrerPolicy.h \ - Source/WebCore/platform/RunLoop.cpp \ - Source/WebCore/platform/RunLoop.h \ - Source/WebCore/platform/RuntimeApplicationChecks.cpp \ - Source/WebCore/platform/RuntimeApplicationChecks.h \ - Source/WebCore/platform/SchemeRegistry.cpp \ - Source/WebCore/platform/SchemeRegistry.h \ - Source/WebCore/platform/ScrollAnimator.cpp \ - Source/WebCore/platform/ScrollAnimator.h \ - Source/WebCore/platform/ScrollAnimatorNone.cpp \ - Source/WebCore/platform/ScrollAnimatorNone.h \ - Source/WebCore/platform/ScrollableArea.cpp \ - Source/WebCore/platform/ScrollableArea.h \ - Source/WebCore/platform/Scrollbar.cpp \ - Source/WebCore/platform/Scrollbar.h \ - Source/WebCore/platform/ScrollbarThemeClient.h \ - Source/WebCore/platform/ScrollbarThemeComposite.cpp \ - Source/WebCore/platform/ScrollbarThemeComposite.h \ - Source/WebCore/platform/ScrollbarTheme.cpp \ - Source/WebCore/platform/ScrollbarTheme.h \ - Source/WebCore/platform/ScrollTypes.h \ - Source/WebCore/platform/ScrollView.cpp \ - Source/WebCore/platform/ScrollView.h \ - Source/WebCore/platform/SearchPopupMenu.h \ - Source/WebCore/platform/SecureTextInput.h \ - Source/WebCore/platform/SharedBuffer.cpp \ - Source/WebCore/platform/SharedBuffer.h \ - Source/WebCore/platform/SharedBufferChunkReader.cpp \ - Source/WebCore/platform/SharedBufferChunkReader.h \ - Source/WebCore/platform/SharedTimer.h \ - Source/WebCore/platform/Sound.h \ - Source/WebCore/platform/sql/SQLiteAuthorizer.cpp \ - Source/WebCore/platform/sql/SQLiteDatabase.cpp \ - Source/WebCore/platform/sql/SQLiteDatabase.h \ - Source/WebCore/platform/sql/SQLiteFileSystem.cpp \ - Source/WebCore/platform/sql/SQLiteFileSystem.h \ - Source/WebCore/platform/sql/SQLiteStatement.cpp \ - Source/WebCore/platform/sql/SQLiteStatement.h \ - Source/WebCore/platform/sql/SQLiteTransaction.cpp \ - Source/WebCore/platform/sql/SQLiteTransaction.h \ - Source/WebCore/platform/sql/SQLValue.cpp \ - Source/WebCore/platform/sql/SQLValue.h \ - Source/WebCore/platform/SSLKeyGenerator.h \ - Source/WebCore/platform/StatsCounter.h \ - Source/WebCore/platform/SuddenTermination.h \ - Source/WebCore/platform/Supplementable.h \ - Source/WebCore/platform/SystemTime.h \ - Source/WebCore/platform/text/gtk/TextCheckerEnchant.h \ - Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp \ - Source/WebCore/platform/text/BidiContext.cpp \ - Source/WebCore/platform/text/BidiContext.h \ - Source/WebCore/platform/text/BidiResolver.h \ - Source/WebCore/platform/text/BidiRunList.h \ - Source/WebCore/platform/text/DateTimeFormat.cpp \ - Source/WebCore/platform/text/DateTimeFormat.h \ - Source/WebCore/platform/text/DecodeEscapeSequences.h \ - Source/WebCore/platform/text/Hyphenation.cpp \ - Source/WebCore/platform/text/Hyphenation.h \ - Source/WebCore/platform/text/LineBreakIteratorPoolICU.h \ - Source/WebCore/platform/text/LineEnding.cpp \ - Source/WebCore/platform/text/LineEnding.h \ - Source/WebCore/platform/text/LocaleToScriptMapping.h \ - Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp \ - Source/WebCore/platform/text/LocalizedDate.h \ - Source/WebCore/platform/text/LocalizedDateNone.cpp \ - Source/WebCore/platform/text/LocalizedNumber.h \ - Source/WebCore/platform/text/LocalizedNumberNone.cpp \ - Source/WebCore/platform/text/ParserUtilities.h \ - Source/WebCore/platform/text/PlatformString.h \ - Source/WebCore/platform/text/QuotedPrintable.cpp \ - Source/WebCore/platform/text/QuotedPrintable.h \ - Source/WebCore/platform/text/RegularExpression.cpp \ - Source/WebCore/platform/text/RegularExpression.h \ - Source/WebCore/platform/text/SegmentedString.cpp \ - Source/WebCore/platform/text/SegmentedString.h \ - Source/WebCore/platform/text/String.cpp \ - Source/WebCore/platform/text/StringWithDirection.h \ - Source/WebCore/platform/text/SuffixTree.h \ - Source/WebCore/platform/text/TextBoundaries.cpp \ - Source/WebCore/platform/text/TextBoundaries.h \ - Source/WebCore/platform/text/TextBreakIterator.h \ - Source/WebCore/platform/text/TextCheckerClient.h \ - Source/WebCore/platform/text/TextChecking.h \ - Source/WebCore/platform/text/TextCodec.cpp \ - Source/WebCore/platform/text/TextCodec.h \ - Source/WebCore/platform/text/TextCodecASCIIFastPath.h \ - Source/WebCore/platform/text/TextCodecLatin1.cpp \ - Source/WebCore/platform/text/TextCodecLatin1.h \ - Source/WebCore/platform/text/TextCodecUserDefined.cpp \ - Source/WebCore/platform/text/TextCodecUserDefined.h \ - Source/WebCore/platform/text/TextCodecUTF16.cpp \ - Source/WebCore/platform/text/TextCodecUTF16.h \ - Source/WebCore/platform/text/TextCodecUTF8.cpp \ - Source/WebCore/platform/text/TextCodecUTF8.h \ - Source/WebCore/platform/text/TextDirection.h \ - Source/WebCore/platform/text/TextEncoding.cpp \ - Source/WebCore/platform/text/TextEncodingDetector.h \ - Source/WebCore/platform/text/TextEncodingDetectorNone.cpp \ - Source/WebCore/platform/text/TextEncoding.h \ - Source/WebCore/platform/text/TextEncodingRegistry.cpp \ - Source/WebCore/platform/text/TextEncodingRegistry.h \ - Source/WebCore/platform/text/TextOrientation.h \ - Source/WebCore/platform/text/TextStream.cpp \ - Source/WebCore/platform/text/TextStream.h \ - Source/WebCore/platform/text/transcoder/FontTranscoder.cpp \ - Source/WebCore/platform/text/transcoder/FontTranscoder.h \ - Source/WebCore/platform/text/UnicodeBidi.h \ - Source/WebCore/platform/text/UnicodeRange.cpp \ - Source/WebCore/platform/text/UnicodeRange.h \ - Source/WebCore/platform/TouchpadFlingPlatformGestureCurve.cpp \ - Source/WebCore/platform/TouchpadFlingPlatformGestureCurve.h \ - Source/WebCore/platform/ThemeTypes.h \ - Source/WebCore/platform/ThreadCheck.h \ - Source/WebCore/platform/ThreadGlobalData.cpp \ - Source/WebCore/platform/ThreadGlobalData.h \ - Source/WebCore/platform/ThreadTimers.cpp \ - Source/WebCore/platform/ThreadTimers.h \ - Source/WebCore/platform/Timer.cpp \ - Source/WebCore/platform/Timer.h \ - Source/WebCore/platform/TreeShared.h \ - Source/WebCore/platform/UUID.cpp \ - Source/WebCore/platform/UUID.h \ - Source/WebCore/platform/VisitedLinkStrategy.h \ - Source/WebCore/platform/VisitedLinks.cpp \ - Source/WebCore/platform/VisitedLinks.h \ - Source/WebCore/platform/Widget.cpp \ - Source/WebCore/platform/Widget.h \ - Source/WebCore/platform/WindowsKeyboardCodes.h \ Source/WebCore/plugins/npapi.h \ Source/WebCore/plugins/npruntime.h \ Source/WebCore/plugins/nptypes.h \ @@ -4831,6 +4108,7 @@ webcore_sources += \ Source/WebCore/rendering/LayoutRepainter.h \ Source/WebCore/rendering/LayoutRepainter.cpp \ Source/WebCore/rendering/OverlapTestRequestClient.h \ + Source/WebCore/rendering/Pagination.h \ Source/WebCore/rendering/PaintInfo.h \ Source/WebCore/rendering/PaintPhase.h \ Source/WebCore/rendering/PointerEventsHitRules.cpp \ @@ -4869,6 +4147,8 @@ webcore_sources += \ Source/WebCore/rendering/RenderFlexibleBox.h \ Source/WebCore/rendering/RenderFlowThread.cpp \ Source/WebCore/rendering/RenderFlowThread.h \ + Source/WebCore/rendering/RenderFlowThreadContainer.cpp \ + Source/WebCore/rendering/RenderFlowThreadContainer.h \ Source/WebCore/rendering/RenderFrameBase.cpp \ Source/WebCore/rendering/RenderFrameBase.h \ Source/WebCore/rendering/RenderFrame.cpp \ @@ -4983,6 +4263,8 @@ webcore_sources += \ Source/WebCore/rendering/RenderTextControlSingleLine.cpp \ Source/WebCore/rendering/RenderTextControlSingleLine.h \ Source/WebCore/rendering/RenderText.cpp \ + Source/WebCore/rendering/RenderTextTrackCue.cpp \ + Source/WebCore/rendering/RenderTextTrackCue.h \ Source/WebCore/rendering/RenderTextFragment.cpp \ Source/WebCore/rendering/RenderTextFragment.h \ Source/WebCore/rendering/RenderText.h \ @@ -5731,6 +5013,746 @@ webcore_sources += \ Source/WebCore/xml/XSLTUnicodeSort.cpp \ Source/WebCore/xml/XSLTUnicodeSort.h +webcore_platform_sources += \ + Source/WebCore/platform/animation/Animation.cpp \ + Source/WebCore/platform/animation/Animation.h \ + Source/WebCore/platform/animation/AnimationList.cpp \ + Source/WebCore/platform/animation/AnimationList.h \ + Source/WebCore/platform/animation/AnimationUtilities.h \ + Source/WebCore/platform/animation/TimingFunction.h \ + Source/WebCore/platform/audio/AudioArray.h \ + Source/WebCore/platform/audio/AudioBus.cpp \ + Source/WebCore/platform/audio/AudioBus.h \ + Source/WebCore/platform/audio/AudioChannel.cpp \ + Source/WebCore/platform/audio/AudioChannel.h \ + Source/WebCore/platform/audio/AudioDestination.h \ + Source/WebCore/platform/audio/AudioDSPKernel.h \ + Source/WebCore/platform/audio/AudioDSPKernelProcessor.cpp \ + Source/WebCore/platform/audio/AudioDSPKernelProcessor.h \ + Source/WebCore/platform/audio/AudioFileReader.h \ + Source/WebCore/platform/audio/AudioIOCallback.h \ + Source/WebCore/platform/audio/AudioProcessor.h \ + Source/WebCore/platform/audio/AudioResampler.cpp \ + Source/WebCore/platform/audio/AudioResampler.h \ + Source/WebCore/platform/audio/AudioResamplerKernel.cpp \ + Source/WebCore/platform/audio/AudioResamplerKernel.h \ + Source/WebCore/platform/audio/AudioSourceProvider.h \ + Source/WebCore/platform/audio/AudioSourceProviderClient.h \ + Source/WebCore/platform/audio/AudioUtilities.cpp \ + Source/WebCore/platform/audio/AudioUtilities.h \ + Source/WebCore/platform/audio/Biquad.cpp \ + Source/WebCore/platform/audio/Biquad.h \ + Source/WebCore/platform/audio/Cone.cpp \ + Source/WebCore/platform/audio/Cone.h \ + Source/WebCore/platform/audio/DenormalDisabler.h \ + Source/WebCore/platform/audio/DirectConvolver.cpp \ + Source/WebCore/platform/audio/DirectConvolver.h \ + Source/WebCore/platform/audio/Distance.cpp \ + Source/WebCore/platform/audio/Distance.h \ + Source/WebCore/platform/audio/DynamicsCompressor.h \ + Source/WebCore/platform/audio/DynamicsCompressorKernel.cpp \ + Source/WebCore/platform/audio/DynamicsCompressorKernel.h \ + Source/WebCore/platform/audio/DynamicsCompressor.cpp \ + Source/WebCore/platform/audio/EqualPowerPanner.cpp \ + Source/WebCore/platform/audio/EqualPowerPanner.h \ + Source/WebCore/platform/audio/FFTConvolver.cpp \ + Source/WebCore/platform/audio/FFTConvolver.h \ + Source/WebCore/platform/audio/FFTFrame.cpp \ + Source/WebCore/platform/audio/FFTFrame.h \ + Source/WebCore/platform/audio/FFTFrameStub.cpp \ + Source/WebCore/platform/audio/HRTFDatabase.cpp \ + Source/WebCore/platform/audio/HRTFDatabase.h \ + Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp \ + Source/WebCore/platform/audio/HRTFDatabaseLoader.h \ + Source/WebCore/platform/audio/HRTFElevation.cpp \ + Source/WebCore/platform/audio/HRTFElevation.h \ + Source/WebCore/platform/audio/HRTFKernel.cpp \ + Source/WebCore/platform/audio/HRTFKernel.h \ + Source/WebCore/platform/audio/HRTFPanner.cpp \ + Source/WebCore/platform/audio/HRTFPanner.h \ + Source/WebCore/platform/audio/MultiChannelResampler.cpp \ + Source/WebCore/platform/audio/MultiChannelResampler.h \ + Source/WebCore/platform/audio/Panner.cpp \ + Source/WebCore/platform/audio/Panner.h \ + Source/WebCore/platform/audio/ReverbAccumulationBuffer.cpp \ + Source/WebCore/platform/audio/ReverbAccumulationBuffer.h \ + Source/WebCore/platform/audio/ReverbConvolver.cpp \ + Source/WebCore/platform/audio/ReverbConvolver.h \ + Source/WebCore/platform/audio/ReverbConvolverStage.cpp \ + Source/WebCore/platform/audio/ReverbConvolverStage.h \ + Source/WebCore/platform/audio/Reverb.cpp \ + Source/WebCore/platform/audio/Reverb.h \ + Source/WebCore/platform/audio/ReverbInputBuffer.cpp \ + Source/WebCore/platform/audio/ReverbInputBuffer.h \ + Source/WebCore/platform/audio/SincResampler.cpp \ + Source/WebCore/platform/audio/SincResampler.h \ + Source/WebCore/platform/audio/VectorMath.cpp \ + Source/WebCore/platform/audio/VectorMath.h \ + Source/WebCore/platform/audio/ZeroPole.cpp \ + Source/WebCore/platform/audio/ZeroPole.h \ + Source/WebCore/platform/ActivePlatformGestureAnimation.cpp \ + Source/WebCore/platform/ActivePlatformGestureAnimation.h \ + Source/WebCore/platform/PlatformGestureCurve.h \ + Source/WebCore/platform/PlatformGestureCurveTarget.h \ + Source/WebCore/platform/Arena.cpp \ + Source/WebCore/platform/Arena.h \ + Source/WebCore/platform/AsyncFileSystem.cpp \ + Source/WebCore/platform/AsyncFileSystem.h \ + Source/WebCore/platform/AutodrainedPool.h \ + Source/WebCore/platform/CalculationValue.cpp \ + Source/WebCore/platform/CalculationValue.h \ + Source/WebCore/platform/Clock.cpp \ + Source/WebCore/platform/Clock.h \ + Source/WebCore/platform/ClockGeneric.cpp \ + Source/WebCore/platform/ClockGeneric.h \ + Source/WebCore/platform/ColorChooser.h \ + Source/WebCore/platform/ColorChooserClient.h \ + Source/WebCore/platform/ContentType.cpp \ + Source/WebCore/platform/ContentType.h \ + Source/WebCore/platform/ContextMenu.h \ + Source/WebCore/platform/ContextMenuItem.h \ + Source/WebCore/platform/Cookie.h \ + Source/WebCore/platform/CookiesStrategy.h \ + Source/WebCore/platform/CookieJar.h \ + Source/WebCore/platform/CrossThreadCopier.cpp \ + Source/WebCore/platform/CrossThreadCopier.h \ + Source/WebCore/platform/Cursor.cpp \ + Source/WebCore/platform/Cursor.h \ + Source/WebCore/platform/DateComponents.cpp \ + Source/WebCore/platform/DateComponents.h \ + Source/WebCore/platform/Decimal.cpp \ + Source/WebCore/platform/Decimal.h \ + Source/WebCore/platform/DragData.cpp \ + Source/WebCore/platform/DragData.h \ + Source/WebCore/platform/DragImage.cpp \ + Source/WebCore/platform/DragImage.h \ + Source/WebCore/platform/EventLoop.h \ + Source/WebCore/platform/EventTracer.cpp \ + Source/WebCore/platform/EventTracer.h \ + Source/WebCore/platform/PlatformInstrumentation.cpp \ + Source/WebCore/platform/PlatformInstrumentation.h \ + Source/WebCore/platform/FileChooser.cpp \ + Source/WebCore/platform/FileChooser.h \ + Source/WebCore/platform/FileIconLoader.cpp \ + Source/WebCore/platform/FileIconLoader.h \ + Source/WebCore/platform/FileMetadata.h \ + Source/WebCore/platform/FileStreamClient.h \ + Source/WebCore/platform/FileStream.cpp \ + Source/WebCore/platform/FileStream.h \ + Source/WebCore/platform/FileSystem.cpp \ + Source/WebCore/platform/FileSystem.h \ + Source/WebCore/platform/FloatConversion.h \ + Source/WebCore/platform/FractionalLayoutUnit.h \ + Source/WebCore/platform/Gamepads.h \ + Source/WebCore/platform/HashTools.h \ + Source/WebCore/platform/HistogramSupport.cpp \ + Source/WebCore/platform/HistogramSupport.h \ + Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp \ + Source/WebCore/platform/graphics/ANGLEWebKitBridge.h \ + Source/WebCore/platform/graphics/BitmapImage.cpp \ + Source/WebCore/platform/graphics/BitmapImage.h \ + Source/WebCore/platform/graphics/Color.cpp \ + Source/WebCore/platform/graphics/Color.h \ + Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp \ + Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h \ + Source/WebCore/platform/graphics/ColorSpace.h \ + Source/WebCore/platform/graphics/DashArray.h \ + Source/WebCore/platform/graphics/Extensions3D.h \ + Source/WebCore/platform/graphics/NativeImagePtr.h \ + Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp \ + Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp \ + Source/WebCore/platform/graphics/cairo/CairoUtilities.h \ + Source/WebCore/platform/graphics/cairo/FloatRectCairo.cpp \ + Source/WebCore/platform/graphics/cairo/FontCairo.cpp \ + Source/WebCore/platform/graphics/cairo/FontCustomPlatformData.h \ + Source/WebCore/platform/graphics/cairo/GradientCairo.cpp \ + Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp \ + Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h \ + Source/WebCore/platform/graphics/cairo/ImageCairo.cpp \ + Source/WebCore/platform/graphics/cairo/IntRectCairo.cpp \ + Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp \ + Source/WebCore/platform/graphics/cairo/NativeImageCairo.h \ + Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp \ + Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h \ + Source/WebCore/platform/graphics/cairo/PathCairo.cpp \ + Source/WebCore/platform/graphics/cairo/PatternCairo.cpp \ + Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp \ + Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h \ + Source/WebCore/platform/graphics/cairo/PlatformPathCairo.h \ + Source/WebCore/platform/graphics/cairo/PlatformPathCairo.cpp \ + Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp \ + Source/WebCore/platform/graphics/cairo/RefPtrCairo.h \ + Source/WebCore/platform/graphics/cairo/TransformationMatrixCairo.cpp \ + Source/WebCore/platform/graphics/filters/CustomFilterGlobalContext.cpp \ + Source/WebCore/platform/graphics/filters/CustomFilterGlobalContext.h \ + Source/WebCore/platform/graphics/filters/CustomFilterMesh.cpp \ + Source/WebCore/platform/graphics/filters/CustomFilterMesh.h \ + Source/WebCore/platform/graphics/filters/CustomFilterNumberParameter.h \ + Source/WebCore/platform/graphics/filters/CustomFilterOperation.cpp \ + Source/WebCore/platform/graphics/filters/CustomFilterOperation.h \ + Source/WebCore/platform/graphics/filters/CustomFilterParameter.h \ + Source/WebCore/platform/graphics/filters/CustomFilterProgram.cpp \ + Source/WebCore/platform/graphics/filters/CustomFilterProgram.h \ + Source/WebCore/platform/graphics/filters/CustomFilterProgramInfo.cpp \ + Source/WebCore/platform/graphics/filters/CustomFilterProgramInfo.h \ + Source/WebCore/platform/graphics/filters/CustomFilterCompiledProgram.cpp \ + Source/WebCore/platform/graphics/filters/CustomFilterCompiledProgram.h \ + Source/WebCore/platform/graphics/filters/DistantLightSource.cpp \ + Source/WebCore/platform/graphics/filters/DistantLightSource.h \ + Source/WebCore/platform/graphics/filters/FEBlend.cpp \ + Source/WebCore/platform/graphics/filters/FEBlend.h \ + Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp \ + Source/WebCore/platform/graphics/filters/FEColorMatrix.h \ + Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp \ + Source/WebCore/platform/graphics/filters/FEComponentTransfer.h \ + Source/WebCore/platform/graphics/filters/FEComposite.cpp \ + Source/WebCore/platform/graphics/filters/FEComposite.h \ + Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp \ + Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h \ + Source/WebCore/platform/graphics/filters/FECustomFilter.cpp \ + Source/WebCore/platform/graphics/filters/FECustomFilter.h \ + Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp \ + Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h \ + Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp \ + Source/WebCore/platform/graphics/filters/FEDisplacementMap.h \ + Source/WebCore/platform/graphics/filters/FEDropShadow.cpp \ + Source/WebCore/platform/graphics/filters/FEDropShadow.h \ + Source/WebCore/platform/graphics/filters/FEFlood.cpp \ + Source/WebCore/platform/graphics/filters/FEFlood.h \ + Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp \ + Source/WebCore/platform/graphics/filters/FEGaussianBlur.h \ + Source/WebCore/platform/graphics/filters/FELighting.cpp \ + Source/WebCore/platform/graphics/filters/FELighting.h \ + Source/WebCore/platform/graphics/filters/FEMerge.cpp \ + Source/WebCore/platform/graphics/filters/FEMerge.h \ + Source/WebCore/platform/graphics/filters/FEMorphology.cpp \ + Source/WebCore/platform/graphics/filters/FEMorphology.h \ + Source/WebCore/platform/graphics/filters/FEOffset.cpp \ + Source/WebCore/platform/graphics/filters/FEOffset.h \ + Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp \ + Source/WebCore/platform/graphics/filters/FESpecularLighting.h \ + Source/WebCore/platform/graphics/filters/FETile.cpp \ + Source/WebCore/platform/graphics/filters/FETile.h \ + Source/WebCore/platform/graphics/filters/FETurbulence.cpp \ + Source/WebCore/platform/graphics/filters/FETurbulence.h \ + Source/WebCore/platform/graphics/filters/Filter.h \ + Source/WebCore/platform/graphics/filters/FilterEffect.cpp \ + Source/WebCore/platform/graphics/filters/FilterEffect.h \ + Source/WebCore/platform/graphics/filters/FilterOperation.h \ + Source/WebCore/platform/graphics/filters/FilterOperation.cpp \ + Source/WebCore/platform/graphics/filters/FilterOperations.cpp \ + Source/WebCore/platform/graphics/filters/FilterOperations.h \ + Source/WebCore/platform/graphics/filters/LightSource.cpp \ + Source/WebCore/platform/graphics/filters/LightSource.h \ + Source/WebCore/platform/graphics/filters/PointLightSource.cpp \ + Source/WebCore/platform/graphics/filters/PointLightSource.h \ + Source/WebCore/platform/graphics/filters/SourceAlpha.cpp \ + Source/WebCore/platform/graphics/filters/SourceAlpha.h \ + Source/WebCore/platform/graphics/filters/SourceGraphic.cpp \ + Source/WebCore/platform/graphics/filters/SourceGraphic.h \ + Source/WebCore/platform/graphics/filters/SpotLightSource.cpp \ + Source/WebCore/platform/graphics/filters/SpotLightSource.h \ + Source/WebCore/platform/graphics/filters/arm/NEONHelpers.h \ + Source/WebCore/platform/graphics/filters/arm/FEBlendNEON.h \ + Source/WebCore/platform/graphics/filters/arm/FECompositeArithmeticNEON.h \ + Source/WebCore/platform/graphics/filters/arm/FEGaussianBlurNEON.h \ + Source/WebCore/platform/graphics/filters/arm/FELightingNEON.cpp \ + Source/WebCore/platform/graphics/filters/arm/FELightingNEON.h \ + Source/WebCore/platform/graphics/FloatPoint3D.cpp \ + Source/WebCore/platform/graphics/FloatPoint3D.h \ + Source/WebCore/platform/graphics/FloatPoint.cpp \ + Source/WebCore/platform/graphics/FloatPoint.h \ + Source/WebCore/platform/graphics/FloatQuad.cpp \ + Source/WebCore/platform/graphics/FloatQuad.h \ + Source/WebCore/platform/graphics/FloatRect.cpp \ + Source/WebCore/platform/graphics/FloatRect.h \ + Source/WebCore/platform/graphics/FloatSize.cpp \ + Source/WebCore/platform/graphics/FloatSize.h \ + Source/WebCore/platform/graphics/FontBaseline.h \ + Source/WebCore/platform/graphics/FontCache.cpp \ + Source/WebCore/platform/graphics/FontCache.h \ + Source/WebCore/platform/graphics/Font.cpp \ + Source/WebCore/platform/graphics/FontData.cpp \ + Source/WebCore/platform/graphics/FontData.h \ + Source/WebCore/platform/graphics/FontDescription.cpp \ + Source/WebCore/platform/graphics/FontDescription.h \ + Source/WebCore/platform/graphics/FontFallbackList.cpp \ + Source/WebCore/platform/graphics/FontFallbackList.h \ + Source/WebCore/platform/graphics/FontFamily.cpp \ + Source/WebCore/platform/graphics/FontFamily.h \ + Source/WebCore/platform/graphics/FontFastPath.cpp \ + Source/WebCore/platform/graphics/FontFeatureSettings.cpp \ + Source/WebCore/platform/graphics/FontFeatureSettings.h \ + Source/WebCore/platform/graphics/Font.h \ + Source/WebCore/platform/graphics/FontMetrics.h \ + Source/WebCore/platform/graphics/FontOrientation.h \ + Source/WebCore/platform/graphics/FontPlatformData.h \ + Source/WebCore/platform/graphics/FontRenderingMode.h \ + Source/WebCore/platform/graphics/FontSelector.h \ + Source/WebCore/platform/graphics/FontSmoothingMode.h \ + Source/WebCore/platform/graphics/FontTraitsMask.h \ + Source/WebCore/platform/graphics/FontWidthVariant.h \ + Source/WebCore/platform/graphics/FractionalLayoutBoxExtent.cpp \ + Source/WebCore/platform/graphics/FractionalLayoutBoxExtent.h \ + Source/WebCore/platform/graphics/FractionalLayoutPoint.h \ + Source/WebCore/platform/graphics/FractionalLayoutRect.cpp \ + Source/WebCore/platform/graphics/FractionalLayoutRect.h \ + Source/WebCore/platform/graphics/FractionalLayoutSize.h \ + Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp \ + Source/WebCore/platform/graphics/GeneratorGeneratedImage.h \ + Source/WebCore/platform/graphics/GeneratedImage.h \ + Source/WebCore/platform/graphics/Generator.h \ + Source/WebCore/platform/graphics/Glyph.h \ + Source/WebCore/platform/graphics/GlyphBuffer.h \ + Source/WebCore/platform/graphics/GlyphMetricsMap.h \ + Source/WebCore/platform/graphics/GlyphPage.h \ + Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp \ + Source/WebCore/platform/graphics/GlyphPageTreeNode.h \ + Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp \ + Source/WebCore/platform/graphics/gpu/DrawingBuffer.h \ + Source/WebCore/platform/graphics/Gradient.cpp \ + Source/WebCore/platform/graphics/Gradient.h \ + Source/WebCore/platform/graphics/GraphicsContext.cpp \ + Source/WebCore/platform/graphics/GraphicsContext.h \ + Source/WebCore/platform/graphics/GraphicsContext3D.cpp \ + Source/WebCore/platform/graphics/GraphicsContext3D.h \ + Source/WebCore/platform/graphics/GraphicsLayer.h \ + Source/WebCore/platform/graphics/GraphicsLayer.cpp \ + Source/WebCore/platform/graphics/GraphicsLayerClient.h \ + Source/WebCore/platform/graphics/GraphicsTypes.cpp \ + Source/WebCore/platform/graphics/GraphicsTypes.h \ + Source/WebCore/platform/graphics/GraphicsTypes3D.h \ + Source/WebCore/platform/graphics/Icon.h \ + Source/WebCore/platform/graphics/ImageBuffer.cpp \ + Source/WebCore/platform/graphics/ImageBuffer.h \ + Source/WebCore/platform/graphics/ImageBufferData.h \ + Source/WebCore/platform/graphics/Image.cpp \ + Source/WebCore/platform/graphics/Image.h \ + Source/WebCore/platform/graphics/ImageObserver.h \ + Source/WebCore/platform/graphics/ImageOrientation.cpp \ + Source/WebCore/platform/graphics/ImageOrientation.h \ + Source/WebCore/platform/graphics/ImageSource.cpp \ + Source/WebCore/platform/graphics/ImageSource.h \ + Source/WebCore/platform/graphics/IntPoint.h \ + Source/WebCore/platform/graphics/IntPointHash.h \ + Source/WebCore/platform/graphics/IntRect.cpp \ + Source/WebCore/platform/graphics/IntRect.h \ + Source/WebCore/platform/graphics/IntSize.h \ + Source/WebCore/platform/graphics/IntSizeHash.h \ + Source/WebCore/platform/graphics/MediaPlayer.cpp \ + Source/WebCore/platform/graphics/MediaPlayer.h \ + Source/WebCore/platform/graphics/MediaPlayerPrivate.h \ + Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp \ + Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h \ + Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp \ + Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.h \ + Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp \ + Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp \ + Source/WebCore/platform/graphics/OpenGLShims.cpp \ + Source/WebCore/platform/graphics/OpenGLShims.h \ + Source/WebCore/platform/graphics/opentype/OpenTypeVerticalData.h \ + Source/WebCore/platform/graphics/Path.cpp \ + Source/WebCore/platform/graphics/Path.h \ + Source/WebCore/platform/graphics/PathTraversalState.cpp \ + Source/WebCore/platform/graphics/PathTraversalState.h \ + Source/WebCore/platform/graphics/Pattern.cpp \ + Source/WebCore/platform/graphics/Pattern.h \ + Source/WebCore/platform/graphics/PlatformLayer.h \ + Source/WebCore/platform/graphics/Region.cpp \ + Source/WebCore/platform/graphics/Region.h \ + Source/WebCore/platform/graphics/RoundedRect.cpp \ + Source/WebCore/platform/graphics/RoundedRect.h \ + Source/WebCore/platform/graphics/SegmentedFontData.cpp \ + Source/WebCore/platform/graphics/SegmentedFontData.h \ + Source/WebCore/platform/graphics/ShadowBlur.cpp \ + Source/WebCore/platform/graphics/ShadowBlur.h \ + Source/WebCore/platform/graphics/SimpleFontData.cpp \ + Source/WebCore/platform/graphics/SimpleFontData.h \ + Source/WebCore/platform/graphics/StringTruncator.cpp \ + Source/WebCore/platform/graphics/StringTruncator.h \ + Source/WebCore/platform/graphics/StrokeStyleApplier.h \ + Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp \ + Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h \ + Source/WebCore/platform/graphics/SVGGlyph.cpp \ + Source/WebCore/platform/graphics/SVGGlyph.h \ + Source/WebCore/platform/graphics/TextRenderingMode.h \ + Source/WebCore/platform/graphics/TextRun.cpp \ + Source/WebCore/platform/graphics/TextRun.h \ + Source/WebCore/platform/graphics/TiledBacking.h \ + Source/WebCore/platform/graphics/transforms/AffineTransform.cpp \ + Source/WebCore/platform/graphics/transforms/AffineTransform.h \ + Source/WebCore/platform/graphics/transforms/IdentityTransformOperation.h \ + Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.cpp \ + Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h \ + Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp \ + Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.h \ + Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.cpp \ + Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.h \ + Source/WebCore/platform/graphics/transforms/RotateTransformOperation.cpp \ + Source/WebCore/platform/graphics/transforms/RotateTransformOperation.h \ + Source/WebCore/platform/graphics/transforms/ScaleTransformOperation.cpp \ + Source/WebCore/platform/graphics/transforms/ScaleTransformOperation.h \ + Source/WebCore/platform/graphics/transforms/SkewTransformOperation.cpp \ + Source/WebCore/platform/graphics/transforms/SkewTransformOperation.h \ + Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp \ + Source/WebCore/platform/graphics/transforms/TransformationMatrix.h \ + Source/WebCore/platform/graphics/transforms/TransformOperation.h \ + Source/WebCore/platform/graphics/transforms/TransformOperations.cpp \ + Source/WebCore/platform/graphics/transforms/TransformOperations.h \ + Source/WebCore/platform/graphics/transforms/TransformState.cpp \ + Source/WebCore/platform/graphics/transforms/TransformState.h \ + Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.cpp \ + Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h \ + Source/WebCore/platform/graphics/TypesettingFeatures.h \ + Source/WebCore/platform/graphics/UnitBezier.h \ + Source/WebCore/platform/graphics/WidthIterator.cpp \ + Source/WebCore/platform/graphics/WidthIterator.h \ + Source/WebCore/platform/graphics/WindRule.h \ + Source/WebCore/platform/graphics/WOFFFileFormat.cpp \ + Source/WebCore/platform/graphics/WOFFFileFormat.h \ + Source/WebCore/platform/gtk/ErrorsGtk.cpp \ + Source/WebCore/platform/gtk/ErrorsGtk.h \ + Source/WebCore/platform/gtk/GamepadsGtk.cpp \ + Source/WebCore/platform/gtk/KURLGtk.cpp \ + Source/WebCore/platform/gtk/LanguageGtk.cpp \ + Source/WebCore/platform/gtk/LoggingGtk.cpp \ + Source/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp \ + Source/WebCore/platform/gtk/SharedBufferGtk.cpp \ + Source/WebCore/platform/gtk/TemporaryLinkStubs.cpp \ + Source/WebCore/platform/HostWindow.h \ + Source/WebCore/platform/KillRing.h \ + Source/WebCore/platform/KillRingNone.cpp \ + Source/WebCore/platform/KURL.cpp \ + Source/WebCore/platform/KURL.h \ + Source/WebCore/platform/KURLHash.h \ + Source/WebCore/platform/KURLWTFURL.cpp \ + Source/WebCore/platform/KURLWTFURLImpl.h \ + Source/WebCore/platform/Language.cpp \ + Source/WebCore/platform/Language.h \ + Source/WebCore/platform/LengthBox.cpp \ + Source/WebCore/platform/LengthBox.h \ + Source/WebCore/platform/Length.cpp \ + Source/WebCore/platform/Length.h \ + Source/WebCore/platform/LengthSize.h \ + Source/WebCore/platform/leveldb/LevelDBComparator.h \ + Source/WebCore/platform/leveldb/LevelDBDatabase.cpp \ + Source/WebCore/platform/leveldb/LevelDBDatabase.h \ + Source/WebCore/platform/leveldb/LevelDBIterator.h \ + Source/WebCore/platform/leveldb/LevelDBSlice.h \ + Source/WebCore/platform/leveldb/LevelDBTransaction.h \ + Source/WebCore/platform/leveldb/LevelDBTransaction.cpp \ + Source/WebCore/platform/leveldb/LevelDBWriteBatch.h \ + Source/WebCore/platform/leveldb/LevelDBWriteBatch.cpp \ + Source/WebCore/platform/LinkHash.cpp \ + Source/WebCore/platform/LinkHash.h \ + Source/WebCore/platform/LocalizedStrings.h \ + Source/WebCore/platform/Logging.cpp \ + Source/WebCore/platform/Logging.h \ + Source/WebCore/platform/MIMETypeRegistry.cpp \ + Source/WebCore/platform/MIMETypeRegistry.h \ + Source/WebCore/platform/MemoryPressureHandler.cpp \ + Source/WebCore/platform/MemoryPressureHandler.h \ + Source/WebCore/platform/MemoryUsageSupport.cpp \ + Source/WebCore/platform/MemoryUsageSupport.h \ + Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp \ + Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h \ + Source/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp \ + Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h \ + Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp \ + Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp \ + Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h \ + Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp \ + Source/WebCore/platform/image-decoders/gif/GIFImageReader.h \ + Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp \ + Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h \ + Source/WebCore/platform/image-decoders/ImageDecoder.cpp \ + Source/WebCore/platform/image-decoders/ImageDecoder.h \ + Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \ + Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h \ + Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp \ + Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h \ + Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp \ + Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h \ + Source/WebCore/platform/LayoutTestSupport.cpp \ + Source/WebCore/platform/LayoutTestSupport.h \ + Source/WebCore/platform/linux/GamepadDeviceLinux.cpp \ + Source/WebCore/platform/linux/GamepadDeviceLinux.h \ + Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp \ + Source/WebCore/platform/mediastream/IceCandidateDescriptor.h \ + Source/WebCore/platform/mediastream/IceOptions.cpp \ + Source/WebCore/platform/mediastream/IceOptions.h \ + Source/WebCore/platform/mediastream/MediaHints.cpp \ + Source/WebCore/platform/mediastream/MediaHints.h \ + Source/WebCore/platform/mediastream/MediaStreamCenter.cpp \ + Source/WebCore/platform/mediastream/MediaStreamCenter.h \ + Source/WebCore/platform/mediastream/MediaStreamComponent.h \ + Source/WebCore/platform/mediastream/MediaStreamDescriptor.h \ + Source/WebCore/platform/mediastream/MediaStreamSource.cpp \ + Source/WebCore/platform/mediastream/MediaStreamSource.h \ + Source/WebCore/platform/mediastream/MediaStreamSourcesQueryClient.h \ + Source/WebCore/platform/mediastream/PeerConnection00Handler.cpp \ + Source/WebCore/platform/mediastream/PeerConnection00Handler.h \ + Source/WebCore/platform/mediastream/PeerConnection00HandlerClient.h \ + Source/WebCore/platform/mediastream/RTCConfiguration.h \ + Source/WebCore/platform/mediastream/RTCIceCandidateDescriptor.cpp \ + Source/WebCore/platform/mediastream/RTCIceCandidateDescriptor.h \ + Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h \ + Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp \ + Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h \ + Source/WebCore/platform/mediastream/RTCPeerConnectionHandlerClient.h \ + Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.cpp \ + Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h \ + Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.cpp \ + Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h \ + Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp \ + Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h \ + Source/WebCore/platform/mock/DeviceMotionClientMock.cpp \ + Source/WebCore/platform/mock/DeviceMotionClientMock.h \ + Source/WebCore/platform/mock/DeviceOrientationClientMock.cpp \ + Source/WebCore/platform/mock/DeviceOrientationClientMock.h \ + Source/WebCore/platform/mock/GeolocationClientMock.cpp \ + Source/WebCore/platform/mock/GeolocationClientMock.h \ + Source/WebCore/platform/mock/ScrollbarThemeMock.cpp \ + Source/WebCore/platform/mock/ScrollbarThemeMock.h \ + Source/WebCore/platform/network/AuthenticationChallengeBase.cpp \ + Source/WebCore/platform/network/AuthenticationChallengeBase.h \ + Source/WebCore/platform/network/AuthenticationClient.h \ + Source/WebCore/platform/network/BlobData.cpp \ + Source/WebCore/platform/network/BlobData.h \ + Source/WebCore/platform/network/BlobRegistry.h \ + Source/WebCore/platform/network/BlobRegistryImpl.cpp \ + Source/WebCore/platform/network/BlobRegistryImpl.h \ + Source/WebCore/platform/network/BlobResourceHandle.cpp \ + Source/WebCore/platform/network/BlobResourceHandle.h \ + Source/WebCore/platform/network/BlobStorageData.h \ + Source/WebCore/platform/network/ContentTypeParser.cpp \ + Source/WebCore/platform/network/ContentTypeParser.h \ + Source/WebCore/platform/network/CookieStorage.h \ + Source/WebCore/platform/network/Credential.cpp \ + Source/WebCore/platform/network/Credential.h \ + Source/WebCore/platform/network/CredentialStorage.cpp \ + Source/WebCore/platform/network/CredentialStorage.h \ + Source/WebCore/platform/network/DNS.h \ + Source/WebCore/platform/network/DNSResolveQueue.cpp \ + Source/WebCore/platform/network/DNSResolveQueue.h \ + Source/WebCore/platform/network/FormDataBuilder.cpp \ + Source/WebCore/platform/network/FormDataBuilder.h \ + Source/WebCore/platform/network/FormData.cpp \ + Source/WebCore/platform/network/FormData.h \ + Source/WebCore/platform/network/HTTPHeaderMap.cpp \ + Source/WebCore/platform/network/HTTPHeaderMap.h \ + Source/WebCore/platform/network/HTTPParsers.cpp \ + Source/WebCore/platform/network/HTTPParsers.h \ + Source/WebCore/platform/network/HTTPRequest.cpp \ + Source/WebCore/platform/network/HTTPRequest.h \ + Source/WebCore/platform/network/HTTPValidation.cpp \ + Source/WebCore/platform/network/HTTPValidation.h \ + Source/WebCore/platform/network/MIMEHeader.cpp \ + Source/WebCore/platform/network/MIMEHeader.h \ + Source/WebCore/platform/network/NetworkingContext.h \ + Source/WebCore/platform/network/ProxyServer.cpp \ + Source/WebCore/platform/network/ProxyServer.h \ + Source/WebCore/platform/network/NetworkStateNotifier.cpp \ + Source/WebCore/platform/network/NetworkStateNotifier.h \ + Source/WebCore/platform/network/ProtectionSpaceHash.h \ + Source/WebCore/platform/network/ProtectionSpace.cpp \ + Source/WebCore/platform/network/ProtectionSpace.h \ + Source/WebCore/platform/network/ResourceErrorBase.cpp \ + Source/WebCore/platform/network/ResourceErrorBase.h \ + Source/WebCore/platform/network/ResourceHandleClient.h \ + Source/WebCore/platform/network/ResourceHandle.cpp \ + Source/WebCore/platform/network/ResourceHandle.h \ + Source/WebCore/platform/network/ResourceHandleInternal.h \ + Source/WebCore/platform/network/ResourceLoadInfo.h \ + Source/WebCore/platform/network/ResourceLoadPriority.h \ + Source/WebCore/platform/network/ResourceLoadTiming.cpp \ + Source/WebCore/platform/network/ResourceLoadTiming.h \ + Source/WebCore/platform/network/ResourceRequestBase.cpp \ + Source/WebCore/platform/network/ResourceRequestBase.h \ + Source/WebCore/platform/network/ResourceResponseBase.cpp \ + Source/WebCore/platform/network/ResourceResponseBase.h \ + Source/WebCore/platform/network/SocketStreamErrorBase.cpp \ + Source/WebCore/platform/network/SocketStreamErrorBase.h \ + Source/WebCore/platform/network/SocketStreamHandleBase.cpp \ + Source/WebCore/platform/network/SocketStreamHandleBase.h \ + Source/WebCore/platform/network/SocketStreamHandleClient.h \ + Source/WebCore/platform/network/soup/AuthenticationChallenge.h \ + Source/WebCore/platform/network/soup/CookieJarSoup.cpp \ + Source/WebCore/platform/network/soup/CookieJarSoup.h \ + Source/WebCore/platform/network/soup/CookieStorageSoup.cpp \ + Source/WebCore/platform/network/soup/CredentialStorageSoup.cpp \ + Source/WebCore/platform/network/soup/DNSSoup.cpp \ + Source/WebCore/platform/network/soup/GOwnPtrSoup.cpp \ + Source/WebCore/platform/network/soup/GOwnPtrSoup.h \ + Source/WebCore/platform/network/soup/ProxyServerSoup.cpp \ + Source/WebCore/platform/network/soup/ResourceError.h \ + Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp \ + Source/WebCore/platform/network/soup/ResourceRequest.h \ + Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp \ + Source/WebCore/platform/network/soup/ResourceResponse.h \ + Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp \ + Source/WebCore/platform/network/soup/SocketStreamError.h \ + Source/WebCore/platform/network/soup/SocketStreamHandle.h \ + Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp \ + Source/WebCore/platform/network/soup/SoupURIUtils.cpp \ + Source/WebCore/platform/network/soup/SoupURIUtils.h \ + Source/WebCore/platform/NotImplemented.h \ + Source/WebCore/platform/Pasteboard.h \ + Source/WebCore/platform/PasteboardStrategy.h \ + Source/WebCore/platform/PlatformEvent.cpp \ + Source/WebCore/platform/PlatformEvent.h \ + Source/WebCore/platform/PlatformExportMacros.h \ + Source/WebCore/platform/PlatformGestureCurve.h \ + Source/WebCore/platform/PlatformGestureEvent.h \ + Source/WebCore/platform/PlatformKeyboardEvent.h \ + Source/WebCore/platform/PlatformMenuDescription.h \ + Source/WebCore/platform/PlatformMouseEvent.h \ + Source/WebCore/platform/PlatformPasteboard.h \ + Source/WebCore/platform/PlatformScreen.h \ + Source/WebCore/platform/PlatformStrategies.cpp \ + Source/WebCore/platform/PlatformStrategies.h \ + Source/WebCore/platform/PlatformWheelEvent.h \ + Source/WebCore/platform/PODArena.h \ + Source/WebCore/platform/PODFreeListArena.h \ + Source/WebCore/platform/PODInterval.h \ + Source/WebCore/platform/PODIntervalTree.h \ + Source/WebCore/platform/PODRedBlackTree.h \ + Source/WebCore/platform/PopupMenuClient.h \ + Source/WebCore/platform/PopupMenu.h \ + Source/WebCore/platform/PopupMenuStyle.h \ + Source/WebCore/platform/PrerenderHandle.h \ + Source/WebCore/platform/PurgeableBuffer.h \ + Source/WebCore/platform/PurgePriority.h \ + Source/WebCore/platform/RefCountedSupplement.h \ + Source/WebCore/platform/ReferrerPolicy.h \ + Source/WebCore/platform/RunLoop.cpp \ + Source/WebCore/platform/RunLoop.h \ + Source/WebCore/platform/RuntimeApplicationChecks.cpp \ + Source/WebCore/platform/RuntimeApplicationChecks.h \ + Source/WebCore/platform/SchemeRegistry.cpp \ + Source/WebCore/platform/SchemeRegistry.h \ + Source/WebCore/platform/ScrollAnimator.cpp \ + Source/WebCore/platform/ScrollAnimator.h \ + Source/WebCore/platform/ScrollAnimatorNone.cpp \ + Source/WebCore/platform/ScrollAnimatorNone.h \ + Source/WebCore/platform/ScrollableArea.cpp \ + Source/WebCore/platform/ScrollableArea.h \ + Source/WebCore/platform/Scrollbar.cpp \ + Source/WebCore/platform/Scrollbar.h \ + Source/WebCore/platform/ScrollbarThemeClient.h \ + Source/WebCore/platform/ScrollbarThemeComposite.cpp \ + Source/WebCore/platform/ScrollbarThemeComposite.h \ + Source/WebCore/platform/ScrollbarTheme.cpp \ + Source/WebCore/platform/ScrollbarTheme.h \ + Source/WebCore/platform/ScrollTypes.h \ + Source/WebCore/platform/ScrollView.cpp \ + Source/WebCore/platform/ScrollView.h \ + Source/WebCore/platform/SearchPopupMenu.h \ + Source/WebCore/platform/SecureTextInput.h \ + Source/WebCore/platform/SharedBuffer.cpp \ + Source/WebCore/platform/SharedBuffer.h \ + Source/WebCore/platform/SharedBufferChunkReader.cpp \ + Source/WebCore/platform/SharedBufferChunkReader.h \ + Source/WebCore/platform/SharedTimer.h \ + Source/WebCore/platform/Sound.h \ + Source/WebCore/platform/sql/SQLiteAuthorizer.cpp \ + Source/WebCore/platform/sql/SQLiteDatabase.cpp \ + Source/WebCore/platform/sql/SQLiteDatabase.h \ + Source/WebCore/platform/sql/SQLiteFileSystem.cpp \ + Source/WebCore/platform/sql/SQLiteFileSystem.h \ + Source/WebCore/platform/sql/SQLiteStatement.cpp \ + Source/WebCore/platform/sql/SQLiteStatement.h \ + Source/WebCore/platform/sql/SQLiteTransaction.cpp \ + Source/WebCore/platform/sql/SQLiteTransaction.h \ + Source/WebCore/platform/sql/SQLValue.cpp \ + Source/WebCore/platform/sql/SQLValue.h \ + Source/WebCore/platform/SSLKeyGenerator.h \ + Source/WebCore/platform/StatsCounter.h \ + Source/WebCore/platform/SuddenTermination.h \ + Source/WebCore/platform/Supplementable.h \ + Source/WebCore/platform/SystemTime.h \ + Source/WebCore/platform/text/gtk/TextCheckerEnchant.h \ + Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp \ + Source/WebCore/platform/text/BidiContext.cpp \ + Source/WebCore/platform/text/BidiContext.h \ + Source/WebCore/platform/text/BidiResolver.h \ + Source/WebCore/platform/text/BidiRunList.h \ + Source/WebCore/platform/text/DateTimeFormat.cpp \ + Source/WebCore/platform/text/DateTimeFormat.h \ + Source/WebCore/platform/text/DecodeEscapeSequences.h \ + Source/WebCore/platform/text/Hyphenation.cpp \ + Source/WebCore/platform/text/Hyphenation.h \ + Source/WebCore/platform/text/LineBreakIteratorPoolICU.h \ + Source/WebCore/platform/text/LineEnding.cpp \ + Source/WebCore/platform/text/LineEnding.h \ + Source/WebCore/platform/text/LocaleToScriptMapping.h \ + Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp \ + Source/WebCore/platform/text/LocalizedDate.h \ + Source/WebCore/platform/text/LocalizedDateNone.cpp \ + Source/WebCore/platform/text/LocalizedNumber.h \ + Source/WebCore/platform/text/LocalizedNumberNone.cpp \ + Source/WebCore/platform/text/ParserUtilities.h \ + Source/WebCore/platform/text/PlatformString.h \ + Source/WebCore/platform/text/QuotedPrintable.cpp \ + Source/WebCore/platform/text/QuotedPrintable.h \ + Source/WebCore/platform/text/RegularExpression.cpp \ + Source/WebCore/platform/text/RegularExpression.h \ + Source/WebCore/platform/text/SegmentedString.cpp \ + Source/WebCore/platform/text/SegmentedString.h \ + Source/WebCore/platform/text/String.cpp \ + Source/WebCore/platform/text/StringWithDirection.h \ + Source/WebCore/platform/text/SuffixTree.h \ + Source/WebCore/platform/text/TextBoundaries.cpp \ + Source/WebCore/platform/text/TextBoundaries.h \ + Source/WebCore/platform/text/TextBreakIterator.h \ + Source/WebCore/platform/text/TextCheckerClient.h \ + Source/WebCore/platform/text/TextChecking.h \ + Source/WebCore/platform/text/TextCodec.cpp \ + Source/WebCore/platform/text/TextCodec.h \ + Source/WebCore/platform/text/TextCodecASCIIFastPath.h \ + Source/WebCore/platform/text/TextCodecLatin1.cpp \ + Source/WebCore/platform/text/TextCodecLatin1.h \ + Source/WebCore/platform/text/TextCodecUserDefined.cpp \ + Source/WebCore/platform/text/TextCodecUserDefined.h \ + Source/WebCore/platform/text/TextCodecUTF16.cpp \ + Source/WebCore/platform/text/TextCodecUTF16.h \ + Source/WebCore/platform/text/TextCodecUTF8.cpp \ + Source/WebCore/platform/text/TextCodecUTF8.h \ + Source/WebCore/platform/text/TextDirection.h \ + Source/WebCore/platform/text/TextEncoding.cpp \ + Source/WebCore/platform/text/TextEncodingDetector.h \ + Source/WebCore/platform/text/TextEncodingDetectorNone.cpp \ + Source/WebCore/platform/text/TextEncoding.h \ + Source/WebCore/platform/text/TextEncodingRegistry.cpp \ + Source/WebCore/platform/text/TextEncodingRegistry.h \ + Source/WebCore/platform/text/TextOrientation.h \ + Source/WebCore/platform/text/TextStream.cpp \ + Source/WebCore/platform/text/TextStream.h \ + Source/WebCore/platform/text/transcoder/FontTranscoder.cpp \ + Source/WebCore/platform/text/transcoder/FontTranscoder.h \ + Source/WebCore/platform/text/UnicodeBidi.h \ + Source/WebCore/platform/text/UnicodeRange.cpp \ + Source/WebCore/platform/text/UnicodeRange.h \ + Source/WebCore/platform/TouchpadFlingPlatformGestureCurve.cpp \ + Source/WebCore/platform/TouchpadFlingPlatformGestureCurve.h \ + Source/WebCore/platform/ThemeTypes.h \ + Source/WebCore/platform/ThreadCheck.h \ + Source/WebCore/platform/ThreadGlobalData.cpp \ + Source/WebCore/platform/ThreadGlobalData.h \ + Source/WebCore/platform/ThreadTimers.cpp \ + Source/WebCore/platform/ThreadTimers.h \ + Source/WebCore/platform/Timer.cpp \ + Source/WebCore/platform/Timer.h \ + Source/WebCore/platform/TreeShared.h \ + Source/WebCore/platform/UUID.cpp \ + Source/WebCore/platform/UUID.h \ + Source/WebCore/platform/VisitedLinkStrategy.h \ + Source/WebCore/platform/VisitedLinks.cpp \ + Source/WebCore/platform/VisitedLinks.h \ + Source/WebCore/platform/Widget.cpp \ + Source/WebCore/platform/Widget.h \ + Source/WebCore/platform/WindowsKeyboardCodes.h + # WebCore files that use GTK/GDK or any other dependency that requires GTK+. webcoregtk_sources += \ Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp \ diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp index c9d9f01fa..8110c24c1 100644 --- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp +++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp @@ -490,8 +490,7 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer RefPtr<IDBDatabaseBackendImpl> database = this; OwnPtr<ScriptExecutionContext::Task> intVersionTask = createCallbackTask(&IDBDatabaseBackendImpl::setIntVersionInternal, database, requestedVersion, callbacks, transaction); - // FIXME: Make this reset the integer version as well. - OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version); + OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetIntVersion, database, m_intVersion); if (!transaction->scheduleTask(intVersionTask.release(), resetVersionOnAbortTask.release())) { // FIXME: Remove one of the following lines. ASSERT_NOT_REACHED(); @@ -624,6 +623,11 @@ void IDBDatabaseBackendImpl::resetVersion(ScriptExecutionContext*, PassRefPtr<ID database->m_version = version; } +void IDBDatabaseBackendImpl::resetIntVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t oldVersion) +{ + database->m_intVersion = oldVersion; +} + } // namespace WebCore diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h index 1a6feba4f..7f31cb04e 100644 --- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h +++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h @@ -93,6 +93,7 @@ private: static void removeObjectStoreFromMap(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>); static void addObjectStoreToMap(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>); static void resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version); + static void resetIntVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, int64_t intVersion); RefPtr<IDBBackingStore> m_backingStore; int64_t m_id; diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp index 5771235f7..c96b32565 100644 --- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp +++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp @@ -160,6 +160,9 @@ void IDBRequest::abort() if (m_readyState == DONE) return; + // Enqueued events may be the only reference to this object. + RefPtr<IDBRequest> self(this); + EventQueue* eventQueue = scriptExecutionContext()->eventQueue(); for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get()); diff --git a/Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl b/Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl index ea946a496..cf7ee1f83 100644 --- a/Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl +++ b/Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl @@ -34,7 +34,9 @@ module window { attribute [V8EnabledAtRuntime] PeerConnection00Constructor webkitPeerConnection00; attribute [V8EnabledAtRuntime] RTCPeerConnectionConstructor webkitRTCPeerConnection; attribute SessionDescriptionConstructor SessionDescription; + attribute RTCSessionDescriptionConstructor RTCSessionDescription; attribute IceCandidateConstructor IceCandidate; + attribute RTCIceCandidateConstructor RTCIceCandidate; attribute MediaStreamEventConstructor MediaStreamEvent; }; diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp b/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp new file mode 100644 index 000000000..0f9d41ca2 --- /dev/null +++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if ENABLE(MEDIA_STREAM) + +#include "RTCIceCandidate.h" + +#include "Dictionary.h" +#include "ExceptionCode.h" +#include "InspectorValues.h" +#include "RTCIceCandidateDescriptor.h" + +namespace WebCore { + +PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary, ExceptionCode& ec) +{ + String candidate; + bool ok = dictionary.get("candidate", candidate); + if (!ok || !candidate.length()) { + ec = TYPE_MISMATCH_ERR; + return 0; + } + + String sdpMid; + dictionary.get("sdpMid", sdpMid); + + unsigned short sdpMLineIndex = 0; + dictionary.get("sdpMLineIndex", sdpMLineIndex); + + return adoptRef(new RTCIceCandidate(RTCIceCandidateDescriptor::create(candidate, sdpMid, sdpMLineIndex))); +} + +PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(PassRefPtr<RTCIceCandidateDescriptor> descriptor) +{ + return adoptRef(new RTCIceCandidate(descriptor)); +} + +RTCIceCandidate::RTCIceCandidate(PassRefPtr<RTCIceCandidateDescriptor> descriptor) + : m_descriptor(descriptor) +{ +} + +RTCIceCandidate::~RTCIceCandidate() +{ +} + +const String& RTCIceCandidate::candidate() +{ + return m_descriptor->candidate(); +} + +const String& RTCIceCandidate::sdpMid() +{ + return m_descriptor->sdpMid(); +} + +unsigned short RTCIceCandidate::sdpMLineIndex() +{ + return m_descriptor->sdpMLineIndex(); +} + +RTCIceCandidateDescriptor* RTCIceCandidate::descriptor() +{ + return m_descriptor.get(); +} + +} // namespace WebCore + +#endif // ENABLE(MEDIA_STREAM) diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h new file mode 100644 index 000000000..4a204145a --- /dev/null +++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RTCIceCandidate_h +#define RTCIceCandidate_h + +#if ENABLE(MEDIA_STREAM) + +#include "ExceptionBase.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> +#include <wtf/RefPtr.h> +#include <wtf/text/WTFString.h> + +namespace WebCore { + +class Dictionary; +class RTCIceCandidateDescriptor; + +class RTCIceCandidate : public RefCounted<RTCIceCandidate> { +public: + static PassRefPtr<RTCIceCandidate> create(const Dictionary&, ExceptionCode&); + static PassRefPtr<RTCIceCandidate> create(PassRefPtr<RTCIceCandidateDescriptor>); + virtual ~RTCIceCandidate(); + + const String& candidate(); + const String& sdpMid(); + unsigned short sdpMLineIndex(); + + RTCIceCandidateDescriptor* descriptor(); + +private: + explicit RTCIceCandidate(PassRefPtr<RTCIceCandidateDescriptor>); + + RefPtr<RTCIceCandidateDescriptor> m_descriptor; +}; + +} // namespace WebCore + +#endif // ENABLE(MEDIA_STREAM) + +#endif // RTCIceCandidate_h diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl b/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl new file mode 100644 index 000000000..460db03f4 --- /dev/null +++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +module mediastream { + + interface [ + Conditional=MEDIA_STREAM, + Constructor(in Dictionary dictionary), + ConstructorRaisesException + ] RTCIceCandidate { + readonly attribute DOMString candidate; + readonly attribute DOMString sdpMid; + readonly attribute unsigned short sdpMLineIndex; + }; + +} diff --git a/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp b/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp new file mode 100644 index 000000000..677949124 --- /dev/null +++ b/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if ENABLE(MEDIA_STREAM) + +#include "RTCSessionDescription.h" + +#include "Dictionary.h" +#include "ExceptionCode.h" +#include "RTCSessionDescriptionDescriptor.h" + +namespace WebCore { + +static bool verifyType(const String& type) +{ + return type == "offer" || type == "pranswer" || type == "answer"; +} + +PassRefPtr<RTCSessionDescription> RTCSessionDescription::create(const Dictionary& dictionary, ExceptionCode& ec) +{ + String type; + bool ok = dictionary.get("type", type); + if (!ok || !verifyType(type)) { + ec = TYPE_MISMATCH_ERR; + return 0; + } + + String sdp; + ok = dictionary.get("sdp", sdp); + if (!ok || !sdp.length()) { + ec = TYPE_MISMATCH_ERR; + return 0; + } + + return adoptRef(new RTCSessionDescription(RTCSessionDescriptionDescriptor::create(type, sdp))); +} + +PassRefPtr<RTCSessionDescription> RTCSessionDescription::create(PassRefPtr<RTCSessionDescriptionDescriptor> descriptor) +{ + ASSERT(descriptor); + return adoptRef(new RTCSessionDescription(descriptor)); +} + +RTCSessionDescription::RTCSessionDescription(PassRefPtr<RTCSessionDescriptionDescriptor> descriptor) + : m_descriptor(descriptor) +{ +} + +RTCSessionDescription::~RTCSessionDescription() +{ +} + +const String& RTCSessionDescription::type() +{ + return m_descriptor->type(); +} + +void RTCSessionDescription::setType(const String& type, ExceptionCode& ec) +{ + if (verifyType(type)) + m_descriptor->setType(type); + else + ec = TYPE_MISMATCH_ERR; +} + +const String& RTCSessionDescription::sdp() +{ + return m_descriptor->sdp(); +} + +void RTCSessionDescription::setSdp(const String& sdp, ExceptionCode& ec) +{ + m_descriptor->setSdp(sdp); +} + +RTCSessionDescriptionDescriptor* RTCSessionDescription::descriptor() +{ + return m_descriptor.get(); +} + +} // namespace WebCore + +#endif // ENABLE(MEDIA_STREAM) diff --git a/Source/WebCore/Modules/mediastream/RTCSessionDescription.h b/Source/WebCore/Modules/mediastream/RTCSessionDescription.h new file mode 100644 index 000000000..4597069ce --- /dev/null +++ b/Source/WebCore/Modules/mediastream/RTCSessionDescription.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RTCSessionDescription_h +#define RTCSessionDescription_h + +#if ENABLE(MEDIA_STREAM) + +#include "ExceptionBase.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> +#include <wtf/text/WTFString.h> + +namespace WebCore { + +class Dictionary; +class RTCSessionDescriptionDescriptor; + +class RTCSessionDescription : public RefCounted<RTCSessionDescription> { +public: + static PassRefPtr<RTCSessionDescription> create(const Dictionary&, ExceptionCode&); + static PassRefPtr<RTCSessionDescription> create(PassRefPtr<RTCSessionDescriptionDescriptor>); + virtual ~RTCSessionDescription(); + + const String& type(); + void setType(const String&, ExceptionCode&); + + const String& sdp(); + void setSdp(const String&, ExceptionCode&); + + RTCSessionDescriptionDescriptor* descriptor(); + +private: + explicit RTCSessionDescription(PassRefPtr<RTCSessionDescriptionDescriptor>); + + RefPtr<RTCSessionDescriptionDescriptor> m_descriptor; +}; + +} // namespace WebCore + +#endif // ENABLE(MEDIA_STREAM) + +#endif // RTCSessionDescription_h diff --git a/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl b/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl new file mode 100644 index 000000000..e84dea2eb --- /dev/null +++ b/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +module mediastream { + + interface [ + Conditional=MEDIA_STREAM, + Constructor(in Dictionary dictionary), + ConstructorRaisesException + ] RTCSessionDescription { + attribute DOMString type + setter raises(DOMException); + attribute DOMString sdp + setter raises(DOMException); + }; + +} diff --git a/Source/WebCore/Modules/webdatabase/WorkerContextWebDatabase.cpp b/Source/WebCore/Modules/webdatabase/WorkerContextWebDatabase.cpp index 95efa5a9a..899b7053e 100644 --- a/Source/WebCore/Modules/webdatabase/WorkerContextWebDatabase.cpp +++ b/Source/WebCore/Modules/webdatabase/WorkerContextWebDatabase.cpp @@ -43,7 +43,7 @@ namespace WebCore { PassRefPtr<Database> WorkerContextWebDatabase::openDatabase(WorkerContext* context, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec) { - if (!context->securityOrigin()->canAccessDatabase() || !AbstractDatabase::isAvailable()) { + if (!context->securityOrigin()->canAccessDatabase(context->topOrigin()) || !AbstractDatabase::isAvailable()) { ec = SECURITY_ERR; return 0; } @@ -53,7 +53,7 @@ PassRefPtr<Database> WorkerContextWebDatabase::openDatabase(WorkerContext* conte PassRefPtr<DatabaseSync> WorkerContextWebDatabase::openDatabaseSync(WorkerContext* context, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec) { - if (!context->securityOrigin()->canAccessDatabase() || !AbstractDatabase::isAvailable()) { + if (!context->securityOrigin()->canAccessDatabase(context->topOrigin()) || !AbstractDatabase::isAvailable()) { ec = SECURITY_ERR; return 0; } diff --git a/Source/WebCore/PlatformEfl.cmake b/Source/WebCore/PlatformEfl.cmake index 8de7bb49a..25c35d57c 100644 --- a/Source/WebCore/PlatformEfl.cmake +++ b/Source/WebCore/PlatformEfl.cmake @@ -155,6 +155,7 @@ IF (WTF_USE_CAIRO) "${WEBCORE_DIR}/platform/graphics/freetype" "${WEBCORE_DIR}/platform/graphics/harfbuzz/" "${WEBCORE_DIR}/platform/graphics/harfbuzz/ng" + ${HARFBUZZ_INCLUDE_DIRS} ) LIST(APPEND WebCore_SOURCES platform/graphics/WOFFFileFormat.cpp diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri index bf94372bc..8b0db217d 100644 --- a/Source/WebCore/Target.pri +++ b/Source/WebCore/Target.pri @@ -1118,6 +1118,7 @@ SOURCES += \ rendering/RenderFileUploadControl.cpp \ rendering/RenderFlexibleBox.cpp \ rendering/RenderFlowThread.cpp \ + rendering/RenderFlowThreadContainer.cpp \ rendering/RenderFrame.cpp \ rendering/RenderFrameBase.cpp \ rendering/RenderFrameSet.cpp \ @@ -1173,6 +1174,7 @@ SOURCES += \ rendering/RenderTextControlMultiLine.cpp \ rendering/RenderTextControlSingleLine.cpp \ rendering/RenderTextFragment.cpp \ + rendering/RenderTextTrackCue.cpp \ rendering/RenderTheme.cpp \ rendering/RenderTreeAsText.cpp \ rendering/RenderView.cpp \ @@ -2284,6 +2286,7 @@ HEADERS += \ rendering/mathml/RenderMathMLSquareRoot.h \ rendering/mathml/RenderMathMLSubSup.h \ rendering/mathml/RenderMathMLUnderOver.h \ + rendering/Pagination.h \ rendering/PaintInfo.h \ rendering/PaintPhase.h \ rendering/PointerEventsHitRules.h \ @@ -2794,10 +2797,8 @@ contains(DEFINES, WTF_USE_LIBXML2=1) { } contains(DEFINES, ENABLE_SMOOTH_SCROLLING=1) { - win32-*|wince* { - HEADERS += platform/ScrollAnimatorNone.h - SOURCES += platform/ScrollAnimatorNone.cpp - } + HEADERS += platform/ScrollAnimatorNone.h + SOURCES += platform/ScrollAnimatorNone.cpp } win32-*|wince* { diff --git a/Source/WebCore/UseV8.cmake b/Source/WebCore/UseV8.cmake index 3def256e9..91ce8352e 100755 --- a/Source/WebCore/UseV8.cmake +++ b/Source/WebCore/UseV8.cmake @@ -39,6 +39,7 @@ LIST(APPEND WebCore_SOURCES bindings/v8/ScriptGCEvent.cpp bindings/v8/ScriptInstance.cpp bindings/v8/ScriptObject.cpp + bindings/v8/ScriptRunner.cpp bindings/v8/ScriptScope.cpp bindings/v8/ScriptSourceCode.cpp bindings/v8/ScriptState.cpp diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in index 16d04a380..770dd858c 100644 --- a/Source/WebCore/WebCore.exp.in +++ b/Source/WebCore/WebCore.exp.in @@ -293,7 +293,6 @@ __ZN7WebCore14ScrollableArea6scrollENS_15ScrollDirectionENS_17ScrollGranularityE __ZN7WebCore14ScrollableAreaC2Ev __ZN7WebCore14ScrollableAreaD2Ev __ZN7WebCore14ScrollbarTheme5themeEv -__ZN7WebCore14SecurityOrigin12isolatedCopyEv __ZN7WebCore14SecurityOrigin16createFromStringERKN3WTF6StringE __ZN7WebCore14SecurityOrigin28createFromDatabaseIdentifierERKN3WTF6StringE __ZN7WebCore14SecurityOrigin6createERKN3WTF6StringES4_i @@ -662,7 +661,7 @@ __ZN7WebCore4Page11PageClientsC1Ev __ZN7WebCore4Page11PageClientsD1Ev __ZN7WebCore4Page12setGroupNameERKN3WTF6StringE __ZN7WebCore4Page13rangeOfStringERKN3WTF6StringEPNS_5RangeEj -__ZN7WebCore4Page13setPaginationERKNS0_10PaginationE +__ZN7WebCore4Page13setPaginationERKNS_10PaginationE __ZN7WebCore4Page14setMediaVolumeEf __ZN7WebCore4Page15addSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE __ZN7WebCore4Page15didMoveOnscreenEv @@ -1174,6 +1173,7 @@ __ZNK7WebCore14ScrollableArea23mouseEnteredContentAreaEv __ZNK7WebCore14ScrollableArea23mouseMovedInContentAreaEv __ZNK7WebCore14SecurityOrigin10canDisplayERKNS_4KURLE __ZNK7WebCore14SecurityOrigin11toRawStringEv +__ZNK7WebCore14SecurityOrigin12isolatedCopyEv __ZNK7WebCore14SecurityOrigin18databaseIdentifierEv __ZNK7WebCore14SecurityOrigin5equalEPKS0_ __ZNK7WebCore14SecurityOrigin8toStringEv diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi index b6022e340..8fc578686 100644 --- a/Source/WebCore/WebCore.gypi +++ b/Source/WebCore/WebCore.gypi @@ -455,8 +455,12 @@ 'platform/mediastream/PeerConnection00Handler.h', 'platform/mediastream/PeerConnection00HandlerClient.h', 'platform/mediastream/RTCConfiguration.h', + 'platform/mediastream/RTCIceCandidateDescriptor.cpp', + 'platform/mediastream/RTCIceCandidateDescriptor.h', 'platform/mediastream/RTCPeerConnectionHandler.h', 'platform/mediastream/RTCPeerConnectionHandlerClient.h', + 'platform/mediastream/RTCSessionDescriptionDescriptor.cpp', + 'platform/mediastream/RTCSessionDescriptionDescriptor.h', 'platform/mediastream/SessionDescriptionDescriptor.cpp', 'platform/mediastream/SessionDescriptionDescriptor.h', 'platform/mediastream/chromium/MediaStreamCenterChromium.cpp', @@ -548,6 +552,7 @@ 'rendering/LayoutTypes.h', 'rendering/LayoutRepainter.h', 'rendering/OverlapTestRequestClient.h', + 'rendering/Pagination.h', 'rendering/PaintInfo.h', 'rendering/PaintPhase.h', 'rendering/RenderBR.h', @@ -556,6 +561,7 @@ 'rendering/RenderBoxModelObject.h', 'rendering/RenderEmbeddedObject.h', 'rendering/RenderFlowThread.h', + 'rendering/RenderFlowThreadContainer.h', 'rendering/RenderImage.h', 'rendering/RenderImageResource.h', 'rendering/RenderImageResourceStyleImage.h', @@ -853,7 +859,9 @@ 'Modules/mediastream/NavigatorUserMediaErrorCallback.idl', 'Modules/mediastream/NavigatorUserMediaSuccessCallback.idl', 'Modules/mediastream/PeerConnection00.idl', + 'Modules/mediastream/RTCIceCandidate.idl', 'Modules/mediastream/RTCPeerConnection.idl', + 'Modules/mediastream/RTCSessionDescription.idl', 'Modules/mediastream/SessionDescription.idl', 'Modules/notifications/DOMWindowNotifications.idl', 'Modules/notifications/Notification.idl', @@ -1589,8 +1597,12 @@ 'Modules/mediastream/NavigatorUserMediaSuccessCallback.h', 'Modules/mediastream/PeerConnection00.cpp', 'Modules/mediastream/PeerConnection00.h', + 'Modules/mediastream/RTCIceCandidate.cpp', + 'Modules/mediastream/RTCIceCandidate.h', 'Modules/mediastream/RTCPeerConnection.cpp', 'Modules/mediastream/RTCPeerConnection.h', + 'Modules/mediastream/RTCSessionDescription.cpp', + 'Modules/mediastream/RTCSessionDescription.h', 'Modules/mediastream/SessionDescription.cpp', 'Modules/mediastream/SessionDescription.h', 'Modules/mediastream/UserMediaClient.h', @@ -2228,6 +2240,8 @@ 'bindings/v8/ScriptProfileNode.h', 'bindings/v8/ScriptProfiler.cpp', 'bindings/v8/ScriptProfiler.h', + 'bindings/v8/ScriptRunner.cpp', + 'bindings/v8/ScriptRunner.h', 'bindings/v8/ScriptScope.cpp', 'bindings/v8/ScriptScope.h', 'bindings/v8/ScriptSourceCode.cpp', @@ -3664,8 +3678,6 @@ 'platform/graphics/chromium/IconChromiumAndroid.cpp', 'platform/graphics/chromium/ImageBufferDataSkia.h', 'platform/graphics/chromium/ImageChromium.cpp', - 'platform/graphics/chromium/LinkHighlight.cpp', - 'platform/graphics/chromium/LinkHighlight.h', 'platform/graphics/chromium/MediaPlayerPrivateChromium.h', 'platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp', 'platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.h', @@ -4712,6 +4724,8 @@ 'rendering/RenderFlexibleBox.h', 'rendering/RenderFlowThread.cpp', 'rendering/RenderFlowThread.h', + 'rendering/RenderFlowThreadContainer.cpp', + 'rendering/RenderFlowThreadContainer.h', 'rendering/RenderFrame.cpp', 'rendering/RenderFrame.h', 'rendering/RenderFrameBase.cpp', @@ -4821,6 +4835,8 @@ 'rendering/RenderTextControlSingleLine.h', 'rendering/RenderTextFragment.cpp', 'rendering/RenderTextFragment.h', + 'rendering/RenderTextTrackCue.cpp', + 'rendering/RenderTextTrackCue.h', 'rendering/RenderTheme.cpp', 'rendering/RenderTheme.h', 'rendering/RenderThemeChromiumAndroid.cpp', @@ -6322,8 +6338,6 @@ 'inspector/front-end/KeyboardShortcut.js', 'inspector/front-end/Linkifier.js', 'inspector/front-end/NativeBreakpointsSidebarPane.js', - 'inspector/front-end/NavigatorOverlayController.js', - 'inspector/front-end/NavigatorView.js', 'inspector/front-end/NetworkManager.js', 'inspector/front-end/NetworkLog.js', 'inspector/front-end/NetworkRequest.js', @@ -6381,6 +6395,7 @@ 'inspector/front-end/Toolbar.js', 'inspector/front-end/treeoutline.js', 'inspector/front-end/UISourceCode.js', + 'inspector/front-end/UIString.js', 'inspector/front-end/UIUtils.js', 'inspector/front-end/UserAgentSupport.js', 'inspector/front-end/UserMetrics.js', @@ -6462,6 +6477,8 @@ 'inspector/front-end/CallStackSidebarPane.js', 'inspector/front-end/FilteredItemSelectionDialog.js', 'inspector/front-end/JavaScriptSourceFrame.js', + 'inspector/front-end/NavigatorOverlayController.js', + 'inspector/front-end/NavigatorView.js', 'inspector/front-end/RevisionHistoryView.js', 'inspector/front-end/ScopeChainSidebarPane.js', 'inspector/front-end/ScriptsNavigator.js', diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj index 46a2cbd7a..90561a7aa 100755 --- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj +++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj @@ -39695,6 +39695,14 @@ > </File> <File + RelativePath="..\rendering\RenderFlowThreadContainer.cpp" + > + </File> + <File + RelativePath="..\rendering\RenderFlowThreadContainer.h" + > + </File> + <File RelativePath="..\rendering\svg\RenderForeignObject.cpp" > <FileConfiguration @@ -43763,6 +43771,62 @@ > </File> <File + RelativePath="..\rendering\RenderTextTrackCue.cpp" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release_Cairo_CFLite|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug_All|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Production|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\rendering\RenderTextTrackCue.h" + > + </File> + <File RelativePath="..\rendering\RenderTheme.cpp" > <FileConfiguration @@ -76498,6 +76562,10 @@ > </File> <File + RelativePath="..\inspector\front-end\UIString.js" + > + </File> + <File RelativePath="..\inspector\front-end\UIUtils.js" > </File> diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj index 309c21f65..d95f65847 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj @@ -1700,6 +1700,8 @@ 5DFE8F560D16477B0076E937 /* ScheduledAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */; }; 5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378BB0D15F64200B793D6 /* ScheduledAction.h */; }; 5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */; }; + 603EA36015DD1D7000E150E6 /* RenderFlowThreadContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 603EA35E15DD1D7000E150E6 /* RenderFlowThreadContainer.cpp */; }; + 603EA36115DD1D7000E150E6 /* RenderFlowThreadContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 603EA35F15DD1D7000E150E6 /* RenderFlowThreadContainer.h */; }; 626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */; }; 626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 626CDE0D1140424C001E5A68 /* SpatialNavigation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 628D214C12131ED10055DCFC /* NetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 628D214B12131ED10055DCFC /* NetworkingContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -2944,6 +2946,8 @@ 86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */; }; 86BE340415058CB200CE0FD8 /* PerformanceEntryList.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */; }; 86D982F7125C154000AD9E3D /* DocumentTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D982F6125C154000AD9E3D /* DocumentTiming.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 86FF886115DE3D0700BD6B28 /* RenderTextTrackCue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86FF885E15DE3B8200BD6B28 /* RenderTextTrackCue.cpp */; }; + 86FF886215DE3D0700BD6B28 /* RenderTextTrackCue.h in Headers */ = {isa = PBXBuildFile; fileRef = 86FF885F15DE3B8200BD6B28 /* RenderTextTrackCue.h */; }; 890AE0E11256A07900F5968C /* DirectoryReaderBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 890AE0E01256A07900F5968C /* DirectoryReaderBase.h */; }; 8931DE5B14C44C44000DC9D2 /* JSBlobCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */; }; 893C47A71238908B002B3D86 /* FileCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47A51238908B002B3D86 /* FileCallback.h */; }; @@ -3243,6 +3247,7 @@ 9363B62C0F8E8FE000803810 /* HistoryPropertyList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9363B62A0F8E8FE000803810 /* HistoryPropertyList.cpp */; }; 9363B62D0F8E8FE000803810 /* HistoryPropertyList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9363B62B0F8E8FE000803810 /* HistoryPropertyList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */; }; + 9377ABA015DEFEEF0031FD04 /* Pagination.h in Headers */ = {isa = PBXBuildFile; fileRef = 9377AB9F15DEFEEF0031FD04 /* Pagination.h */; settings = {ATTRIBUTES = (Private, ); }; }; 93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */; }; 93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */ = {isa = PBXBuildFile; fileRef = 93799EF70BF2743600D0F230 /* RenderWordBreak.h */; }; 9380F47309A11AB4001FDB34 /* Widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9380F47109A11AB4001FDB34 /* Widget.cpp */; }; @@ -8844,6 +8849,8 @@ 5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformSourceLibxslt.cpp; sourceTree = "<group>"; }; 5DC87EEF11716DF2001C0E6D /* EmptyProtocolDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyProtocolDefinitions.h; sourceTree = "<group>"; }; 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTarget.h; sourceTree = "<group>"; }; + 603EA35E15DD1D7000E150E6 /* RenderFlowThreadContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFlowThreadContainer.cpp; sourceTree = "<group>"; }; + 603EA35F15DD1D7000E150E6 /* RenderFlowThreadContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderFlowThreadContainer.h; sourceTree = "<group>"; }; 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpatialNavigation.cpp; sourceTree = "<group>"; }; 626CDE0D1140424C001E5A68 /* SpatialNavigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpatialNavigation.h; sourceTree = "<group>"; }; 628D214B12131ED10055DCFC /* NetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkingContext.h; sourceTree = "<group>"; }; @@ -10080,6 +10087,8 @@ 86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEntryList.h; sourceTree = "<group>"; }; 86BE33FF15058CB200CE0FD8 /* PerformanceEntryList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceEntryList.idl; sourceTree = "<group>"; }; 86D982F6125C154000AD9E3D /* DocumentTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentTiming.h; sourceTree = "<group>"; }; + 86FF885E15DE3B8200BD6B28 /* RenderTextTrackCue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextTrackCue.cpp; sourceTree = "<group>"; }; + 86FF885F15DE3B8200BD6B28 /* RenderTextTrackCue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTextTrackCue.h; sourceTree = "<group>"; }; 890AE0E01256A07900F5968C /* DirectoryReaderBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryReaderBase.h; path = Modules/filesystem/DirectoryReaderBase.h; sourceTree = "<group>"; }; 8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobCustom.cpp; sourceTree = "<group>"; }; 893C47A51238908B002B3D86 /* FileCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileCallback.h; path = Modules/filesystem/FileCallback.h; sourceTree = "<group>"; }; @@ -10390,6 +10399,7 @@ 9363B62B0F8E8FE000803810 /* HistoryPropertyList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryPropertyList.h; sourceTree = "<group>"; }; 936DD03A09CEAC270056AE8C /* Range.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Range.idl; sourceTree = "<group>"; }; 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "textAreaResizeCorner@2x.png"; sourceTree = "<group>"; }; + 9377AB9F15DEFEEF0031FD04 /* Pagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pagination.h; sourceTree = "<group>"; }; 93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderWordBreak.cpp; sourceTree = "<group>"; }; 93799EF70BF2743600D0F230 /* RenderWordBreak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderWordBreak.h; sourceTree = "<group>"; }; 9380F47109A11AB4001FDB34 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Widget.cpp; sourceTree = "<group>"; }; @@ -21264,6 +21274,7 @@ 2D9066050BE141D400956998 /* LayoutState.h */, BACF290013B2A0D500781F90 /* LayoutTypes.h */, 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */, + 9377AB9F15DEFEEF0031FD04 /* Pagination.h */, 0885067D11DA045B00182B98 /* PaintInfo.h */, 0885067E11DA045B00182B98 /* PaintPhase.h */, B2B1F7140D00CAA8004AEA64 /* PointerEventsHitRules.cpp */, @@ -21302,6 +21313,8 @@ 53C8298C13D8D92700DE2DEB /* RenderFlexibleBox.h */, 508CCA4E13CF106B003151F3 /* RenderFlowThread.cpp */, 508CCA4D13CF106B003151F3 /* RenderFlowThread.h */, + 603EA35E15DD1D7000E150E6 /* RenderFlowThreadContainer.cpp */, + 603EA35F15DD1D7000E150E6 /* RenderFlowThreadContainer.h */, A871DECC0A1530C700B12A68 /* RenderFrame.cpp */, A871DECB0A1530C700B12A68 /* RenderFrame.h */, 0FD3080C117CF7E700A791F7 /* RenderFrameBase.cpp */, @@ -21422,6 +21435,8 @@ 083DAEA50F01A7FB00342754 /* RenderTextControlSingleLine.h */, BCEA484E097D93020094C9E4 /* RenderTextFragment.cpp */, BCEA484F097D93020094C9E4 /* RenderTextFragment.h */, + 86FF885E15DE3B8200BD6B28 /* RenderTextTrackCue.cpp */, + 86FF885F15DE3B8200BD6B28 /* RenderTextTrackCue.h */, BCEA484A097D93020094C9E4 /* RenderTheme.cpp */, BCEA484B097D93020094C9E4 /* RenderTheme.h */, BCEA4848097D93020094C9E4 /* RenderThemeMac.h */, @@ -24561,6 +24576,7 @@ 066C77310AB603FD00238CC4 /* RenderFileUploadControl.h in Headers */, 53C8298E13D8D92700DE2DEB /* RenderFlexibleBox.h in Headers */, 508CCA4F13CF106B003151F3 /* RenderFlowThread.h in Headers */, + 603EA36115DD1D7000E150E6 /* RenderFlowThreadContainer.h in Headers */, A871DED30A1530C700B12A68 /* RenderFrame.h in Headers */, 0FD3080F117CF7E700A791F7 /* RenderFrameBase.h in Headers */, A871DED10A1530C700B12A68 /* RenderFrameSet.h in Headers */, @@ -24665,6 +24681,7 @@ 083DAEA70F01A7FB00342754 /* RenderTextControlMultiLine.h in Headers */, 083DAEA90F01A7FB00342754 /* RenderTextControlSingleLine.h in Headers */, BCEA488E097D93020094C9E4 /* RenderTextFragment.h in Headers */, + 86FF886215DE3D0700BD6B28 /* RenderTextTrackCue.h in Headers */, BCEA488A097D93020094C9E4 /* RenderTheme.h in Headers */, BCEA4887097D93020094C9E4 /* RenderThemeMac.h in Headers */, 93F1998C08245E59001E9ABC /* RenderTreeAsText.h in Headers */, @@ -25427,6 +25444,7 @@ E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */, 977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */, FD537353137B651800008DCE /* ZeroPole.h in Headers */, + 9377ABA015DEFEEF0031FD04 /* Pagination.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -27797,6 +27815,7 @@ 066C77300AB603FD00238CC4 /* RenderFileUploadControl.cpp in Sources */, 53C8298D13D8D92700DE2DEB /* RenderFlexibleBox.cpp in Sources */, 508CCA5013CF106B003151F3 /* RenderFlowThread.cpp in Sources */, + 603EA36015DD1D7000E150E6 /* RenderFlowThreadContainer.cpp in Sources */, A871DED40A1530C700B12A68 /* RenderFrame.cpp in Sources */, 0FD3080E117CF7E700A791F7 /* RenderFrameBase.cpp in Sources */, A871DED20A1530C700B12A68 /* RenderFrameSet.cpp in Sources */, @@ -27868,6 +27887,7 @@ 083DAEA60F01A7FB00342754 /* RenderTextControlMultiLine.cpp in Sources */, 083DAEA80F01A7FB00342754 /* RenderTextControlSingleLine.cpp in Sources */, BCEA488D097D93020094C9E4 /* RenderTextFragment.cpp in Sources */, + 86FF886115DE3D0700BD6B28 /* RenderTextTrackCue.cpp in Sources */, BCEA4889097D93020094C9E4 /* RenderTheme.cpp in Sources */, BCEA4888097D93020094C9E4 /* RenderThemeMac.mm in Sources */, 93F19AD508245E59001E9ABC /* RenderTreeAsText.cpp in Sources */, diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp index d38af5045..fa7410700 100644 --- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp @@ -250,7 +250,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole() if (node()->isTextNode()) return StaticTextRole; if (node()->hasTagName(buttonTag)) - return ariaHasPopup() ? PopUpButtonRole : ButtonRole; + return buttonRoleType(); if (node()->hasTagName(inputTag)) { HTMLInputElement* input = static_cast<HTMLInputElement*>(node()); if (input->isCheckbox()) @@ -258,7 +258,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole() if (input->isRadioButton()) return RadioButtonRole; if (input->isTextButton()) - return ariaHasPopup() ? PopUpButtonRole : ButtonRole; + return buttonRoleType(); return TextFieldRole; } if (node()->hasTagName(selectTag)) { @@ -336,9 +336,9 @@ AccessibilityRole AccessibilityNodeObject::determineAriaRoleAttribute() const // ARIA states if an item can get focus, it should not be presentational. if (role == PresentationalRole && canSetFocusAttribute()) return UnknownRole; - - if (role == ButtonRole && ariaHasPopup()) - role = PopUpButtonRole; + + if (role == ButtonRole) + role = buttonRoleType(); if (role == TextAreaRole && !ariaIsMultiline()) role = TextFieldRole; diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp index 737cc6bd1..f867ec3ee 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityObject.cpp @@ -1734,5 +1734,24 @@ void AccessibilityObject::scrollToGlobalPoint(const IntPoint& globalPoint) const } } } - + +bool AccessibilityObject::ariaPressedIsPresent() const +{ + return !getAttribute(aria_pressedAttr).isEmpty(); +} + +AccessibilityRole AccessibilityObject::buttonRoleType() const +{ + // If aria-pressed is present, then it should be exposed as a toggle button. + // http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed + if (ariaPressedIsPresent()) + return ToggleButtonRole; + if (ariaHasPopup()) + return PopUpButtonRole; + // We don't contemplate RadioButtonRole, as it depends on the input + // type. + + return ButtonRole; +} + } // namespace WebCore diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h index 1e36a2ca7..ea77ae48b 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.h +++ b/Source/WebCore/accessibility/AccessibilityObject.h @@ -187,6 +187,7 @@ enum AccessibilityRole { TreeGridRole, TreeItemRole, TextFieldRole, + ToggleButtonRole, ToolbarRole, UnknownRole, UserInterfaceTooltipRole, @@ -451,6 +452,7 @@ public: virtual bool supportsARIAFlowTo() const { return false; } virtual void ariaFlowToElements(AccessibilityChildrenVector&) const { } virtual bool ariaHasPopup() const { return false; } + virtual bool ariaPressedIsPresent() const; bool ariaIsMultiline() const; virtual const AtomicString& invalidStatus() const; bool supportsARIAExpanded() const; @@ -715,6 +717,7 @@ protected: static bool isAccessibilityObjectSearchMatch(AccessibilityObject*, AccessibilitySearchCriteria*); static bool isAccessibilityTextSearchMatch(AccessibilityObject*, AccessibilitySearchCriteria*); static bool objectMatchesSearchCriteriaWithResultLimit(AccessibilityObject*, AccessibilitySearchCriteria*, AccessibilityChildrenVector&); + virtual AccessibilityRole buttonRoleType() const; #if PLATFORM(GTK) bool allowsTextRanges() const; diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp index 5b63998e2..7fa5d3bb6 100644 --- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp @@ -1688,7 +1688,7 @@ bool AccessibilityRenderObject::ariaHasPopup() const { return elementAttributeValue(aria_haspopupAttr); } - + bool AccessibilityRenderObject::supportsARIAFlowTo() const { return !getAttribute(aria_flowtoAttr).isEmpty(); @@ -3143,7 +3143,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole() if (m_renderer->isListMarker()) return ListMarkerRole; if (node && node->hasTagName(buttonTag)) - return ariaHasPopup() ? PopUpButtonRole : ButtonRole; + return buttonRoleType(); if (m_renderer->isText()) return StaticTextRole; if (cssBox && cssBox->isImage()) { @@ -3170,7 +3170,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole() if (input->isRadioButton()) return RadioButtonRole; if (input->isTextButton()) - return ariaHasPopup() ? PopUpButtonRole : ButtonRole; + return buttonRoleType(); } if (isFileUploadButton()) diff --git a/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp b/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp index c8df36474..691d32e34 100644 --- a/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp +++ b/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp @@ -33,6 +33,7 @@ #include "AccessibilityObject.h" #include "Document.h" +#include "Font.h" #include "FrameView.h" #include <wtf/gobject/GOwnPtr.h> #include "HostWindow.h" diff --git a/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp index 4876aaf2a..f7f9f6ee8 100644 --- a/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp +++ b/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp @@ -430,6 +430,8 @@ static AtkRole atkRole(AccessibilityRole role) return ATK_ROLE_UNKNOWN; case ButtonRole: return ATK_ROLE_PUSH_BUTTON; + case ToggleButtonRole: + return ATK_ROLE_TOGGLE_BUTTON; case RadioButtonRole: return ATK_ROLE_RADIO_BUTTON; case CheckBoxRole: diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm index 7a9d4bb7c..6f5e75161 100644 --- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm +++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm @@ -45,6 +45,7 @@ #import "Chrome.h" #import "ColorMac.h" #import "ContextMenuController.h" +#import "Font.h" #import "Frame.h" #import "FrameLoaderClient.h" #import "FrameSelection.h" @@ -1576,7 +1577,8 @@ static const AccessibilityRoleMap& createAccessibilityRoleMap() { DivRole, NSAccessibilityGroupRole }, { FormRole, NSAccessibilityGroupRole }, { SpinButtonRole, NSAccessibilityIncrementorRole }, - { FooterRole, NSAccessibilityGroupRole } + { FooterRole, NSAccessibilityGroupRole }, + { ToggleButtonRole, NSAccessibilityButtonRole } }; AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap; diff --git a/Source/WebCore/bindings/js/JSMessagePortCustom.cpp b/Source/WebCore/bindings/js/JSMessagePortCustom.cpp index f44bbb7b4..7a439d360 100644 --- a/Source/WebCore/bindings/js/JSMessagePortCustom.cpp +++ b/Source/WebCore/bindings/js/JSMessagePortCustom.cpp @@ -90,15 +90,20 @@ void fillMessagePortArray(JSC::ExecState* exec, JSC::JSValue value, MessagePortA return; // Validation of non-null objects, per HTML5 spec 10.3.3. if (value.isUndefinedOrNull()) { - setDOMException(exec, DATA_CLONE_ERR); + setDOMException(exec, INVALID_STATE_ERR); return; } // Validation of Objects implementing an interface, per WebIDL spec 4.1.15. RefPtr<MessagePort> port = toMessagePort(value); - if (port) + if (port) { + // Check for duplicate ports. + if (portArray.contains(port)) { + setDOMException(exec, INVALID_STATE_ERR); + return; + } portArray.append(port.release()); - else { + } else { RefPtr<ArrayBuffer> arrayBuffer = toArrayBuffer(value); if (arrayBuffer) arrayBuffers.append(arrayBuffer); diff --git a/Source/WebCore/bindings/js/JSUndoManagerCustom.cpp b/Source/WebCore/bindings/js/JSUndoManagerCustom.cpp index 94cc0b60f..8fc09c511 100644 --- a/Source/WebCore/bindings/js/JSUndoManagerCustom.cpp +++ b/Source/WebCore/bindings/js/JSUndoManagerCustom.cpp @@ -38,6 +38,12 @@ JSValue JSUndoManager::transact(ExecState*) return jsUndefined(); } +JSValue JSUndoManager::item(ExecState*) +{ + // FIXME: implement JSC bindings + return jsUndefined(); +} + } #endif diff --git a/Source/WebCore/bindings/objc/DOM.mm b/Source/WebCore/bindings/objc/DOM.mm index abc529892..5c77da5c2 100644 --- a/Source/WebCore/bindings/objc/DOM.mm +++ b/Source/WebCore/bindings/objc/DOM.mm @@ -34,6 +34,7 @@ #import "DOMNodeInternal.h" #import "DOMPrivate.h" #import "DOMRangeInternal.h" +#import "Font.h" #import "Frame.h" #import "HTMLElement.h" #import "HTMLNames.h" diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm index 300a365be..5969d2d47 100644 --- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm +++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm @@ -3352,24 +3352,23 @@ END END } - my $proxyInit; + AddToImplIncludes("Frame.h"); + my $frame = "0"; if (IsNodeSubType($dataNode)) { - AddToImplIncludes("Frame.h"); - $proxyInit = "impl->document()->frame() ? impl->document()->frame()->script()->proxy() : 0"; # DocumentType nodes are the only nodes that may have a NULL document. if ($interfaceName eq "DocumentType") { - $proxyInit = "impl->document() ? ($proxyInit) : 0"; + $frame = "impl->document() ? impl->document()->frame() : 0"; + } else { + $frame = "impl->document()->frame()"; } - } else { - $proxyInit = "0"; } push(@implContent, <<END); - V8Proxy* proxy = $proxyInit; + Frame* frame = $frame; END if (IsSubType($dataNode, "Document")) { push(@implContent, <<END); - if (proxy && proxy->windowShell()->context().IsEmpty() && proxy->windowShell()->initContextIfNeeded()) { + if (frame && frame->script()->windowShell()->context().IsEmpty() && frame->script()->windowShell()->initContextIfNeeded()) { // initContextIfNeeded may have created a wrapper for the object, retry from the start. return ${className}::wrap(impl.get(), isolate); } @@ -3383,8 +3382,8 @@ END AddToImplIncludes("Frame.h"); push(@implContent, <<END); if (impl->frame()) { - proxy = impl->frame()->script()->proxy(); - proxy->windowShell()->initContextIfNeeded(); + frame = impl->frame(); + frame->script()->windowShell()->initContextIfNeeded(); } END } @@ -3394,10 +3393,10 @@ END // Enter the node's context and create the wrapper in that context. v8::Handle<v8::Context> context; - if (proxy && !proxy->matchesCurrentContext()) { + if (frame && !frame->script()->matchesCurrentContext()) { // For performance, we enter the context only if the currently running context // is different from the context that we are about to enter. - context = proxy->context(); + context = frame->script()->currentWorldContext(); if (!context.IsEmpty()) context->Enter(); } @@ -3405,7 +3404,7 @@ END } push(@implContent, <<END); - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); END if (IsNodeSubType($dataNode) || IsVisibleAcrossOrigins($dataNode)) { push(@implContent, <<END); @@ -3815,7 +3814,7 @@ sub JSValueToNative } if ($type eq "XPathNSResolver") { - return "V8DOMWrapper::getXPathNSResolver($value)"; + return "toXPathNSResolver($value)"; } my $arrayType = $codeGenerator->GetArrayType($type); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp index d033908e8..c93730d3a 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp @@ -24,6 +24,7 @@ #include "BindingState.h" #include "ContextFeatures.h" #include "ExceptionCode.h" +#include "Frame.h" #include "RuntimeEnabledFeatures.h" #include "V8ArrayBufferView.h" #include "V8ArrayBufferViewCustom.h" @@ -151,8 +152,8 @@ v8::Handle<v8::Object> V8Float64Array::wrapSlow(PassRefPtr<Float64Array> impl, v { v8::Handle<v8::Object> wrapper; ASSERT(static_cast<void*>(static_cast<ArrayBufferView*>(impl.get())) == static_cast<void*>(impl.get())); - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp index 653eb1e42..23872e961 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp @@ -180,22 +180,22 @@ bool V8TestActiveDOMObject::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestActiveDOMObject::wrapSlow(PassRefPtr<TestActiveDOMObject> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; + Frame* frame = 0; if (impl->frame()) { - proxy = impl->frame()->script()->proxy(); - proxy->windowShell()->initContextIfNeeded(); + frame = impl->frame(); + frame->script()->windowShell()->initContextIfNeeded(); } // Enter the node's context and create the wrapper in that context. v8::Handle<v8::Context> context; - if (proxy && !proxy->matchesCurrentContext()) { + if (frame && !frame->script()->matchesCurrentContext()) { // For performance, we enter the context only if the currently running context // is different from the context that we are about to enter. - context = proxy->context(); + context = frame->script()->currentWorldContext(); if (!context.IsEmpty()) context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); // Exit the node's context if it was entered. if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp index 0f9e64ac7..e568d57ae 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp @@ -24,6 +24,7 @@ #include "BindingState.h" #include "ContextFeatures.h" #include "ExceptionCode.h" +#include "Frame.h" #include "RuntimeEnabledFeatures.h" #include "V8Binding.h" #include "V8DOMWrapper.h" @@ -113,8 +114,8 @@ bool V8TestCustomNamedGetter::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestCustomNamedGetter::wrapSlow(PassRefPtr<TestCustomNamedGetter> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp index 32e13aa03..dacbd1d8d 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp @@ -24,6 +24,7 @@ #include "BindingState.h" #include "ContextFeatures.h" #include "Dictionary.h" +#include "Frame.h" #include "RuntimeEnabledFeatures.h" #include "V8Binding.h" #include "V8DOMWrapper.h" @@ -150,8 +151,8 @@ bool V8TestEventConstructor::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestEventConstructor::wrapSlow(PassRefPtr<TestEventConstructor> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp index 427f1d533..b10b607a9 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp @@ -24,6 +24,7 @@ #include "BindingState.h" #include "ContextFeatures.h" #include "ExceptionCode.h" +#include "Frame.h" #include "RuntimeEnabledFeatures.h" #include "V8Binding.h" #include "V8Collection.h" @@ -174,8 +175,8 @@ bool V8TestEventTarget::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestEventTarget::wrapSlow(PassRefPtr<TestEventTarget> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp index 99eb522fa..ffb49fd4b 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp @@ -23,6 +23,7 @@ #include "BindingState.h" #include "ContextFeatures.h" +#include "Frame.h" #include "RuntimeEnabledFeatures.h" #include "V8Binding.h" #include "V8DOMWrapper.h" @@ -104,8 +105,8 @@ bool V8TestException::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestException::wrapSlow(PassRefPtr<TestException> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp index 96cfd7a79..d4b8161af 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp @@ -26,6 +26,7 @@ #include "BindingState.h" #include "ContextFeatures.h" #include "ExceptionCode.h" +#include "Frame.h" #include "RuntimeEnabledFeatures.h" #include "TestSupplemental.h" #include "V8Binding.h" @@ -347,8 +348,8 @@ ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> objec v8::Handle<v8::Object> V8TestInterface::wrapSlow(PassRefPtr<TestInterface> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp index 2ede10bda..ab66706d6 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp @@ -24,6 +24,7 @@ #include "BindingState.h" #include "ContextFeatures.h" #include "ExceptionCode.h" +#include "Frame.h" #include "MediaQueryListListener.h" #include "RuntimeEnabledFeatures.h" #include "V8Binding.h" @@ -113,8 +114,8 @@ bool V8TestMediaQueryListListener::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(PassRefPtr<TestMediaQueryListListener> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp index 29892806b..d37f46dc0 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp @@ -158,8 +158,8 @@ ActiveDOMObject* V8TestNamedConstructor::toActiveDOMObject(v8::Handle<v8::Object v8::Handle<v8::Object> V8TestNamedConstructor::wrapSlow(PassRefPtr<TestNamedConstructor> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp index c2a109f05..9a3cef794 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp @@ -114,18 +114,18 @@ v8::Handle<v8::Object> V8TestNode::wrapSlow(PassRefPtr<TestNode> impl, v8::Isola { v8::Handle<v8::Object> wrapper; ASSERT(static_cast<void*>(static_cast<Node*>(impl.get())) == static_cast<void*>(impl.get())); - V8Proxy* proxy = impl->document()->frame() ? impl->document()->frame()->script()->proxy() : 0; + Frame* frame = impl->document()->frame(); // Enter the node's context and create the wrapper in that context. v8::Handle<v8::Context> context; - if (proxy && !proxy->matchesCurrentContext()) { + if (frame && !frame->script()->matchesCurrentContext()) { // For performance, we enter the context only if the currently running context // is different from the context that we are about to enter. - context = proxy->context(); + context = frame->script()->currentWorldContext(); if (!context.IsEmpty()) context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); // Exit the node's context if it was entered. if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp index a8b18c832..3f0b324f0 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp @@ -26,6 +26,7 @@ #include "DOMStringList.h" #include "Dictionary.h" #include "ExceptionCode.h" +#include "Frame.h" #include "HTMLNames.h" #include "IDBBindingUtilities.h" #include "IDBKey.h" @@ -2320,8 +2321,8 @@ void V8TestObj::installPerContextProperties(v8::Handle<v8::Object> instance, Tes v8::Handle<v8::Object> V8TestObj::wrapSlow(PassRefPtr<TestObj> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; installPerContextProperties(wrapper, impl.get()); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp index 0f7b87b12..45ace2076 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp @@ -26,6 +26,7 @@ #include "BindingState.h" #include "ContextFeatures.h" #include "ExceptionCode.h" +#include "Frame.h" #include "MessagePort.h" #include "RuntimeEnabledFeatures.h" #include "SerializedScriptValue.h" @@ -296,8 +297,8 @@ bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> val v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(PassRefPtr<TestSerializedScriptValueInterface> impl, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - V8Proxy* proxy = 0; - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get()); + Frame* frame = 0; + wrapper = V8DOMWrapper::instantiateV8Object(frame, &info, impl.get()); if (UNLIKELY(wrapper.IsEmpty())) return wrapper; v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate); diff --git a/Source/WebCore/bindings/v8/DOMTransaction.cpp b/Source/WebCore/bindings/v8/DOMTransaction.cpp index d6e36ad1b..225e5abb6 100644 --- a/Source/WebCore/bindings/v8/DOMTransaction.cpp +++ b/Source/WebCore/bindings/v8/DOMTransaction.cpp @@ -96,17 +96,29 @@ void DOMTransaction::reapply() m_undoManager->registerUndoStep(this); } -v8::Handle<v8::Function> DOMTransaction::getFunction(const char* propertyName) +v8::Handle<v8::Value> DOMTransaction::data() { v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(toV8(this)); if (wrapper.IsEmpty()) - return v8::Handle<v8::Function>(); + return v8::Handle<v8::Value>(); + return wrapper->GetHiddenValue(V8HiddenPropertyName::domTransactionData()); +} - v8::Local<v8::Value> data = wrapper->GetHiddenValue(V8HiddenPropertyName::domTransactionData()); - if (data.IsEmpty() || !data->IsObject()) - return v8::Handle<v8::Function>(); +void DOMTransaction::setData(v8::Handle<v8::Value> newData) +{ + v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(toV8(this)); + if (wrapper.IsEmpty()) + return; + wrapper->SetHiddenValue(V8HiddenPropertyName::domTransactionData(), newData); +} - v8::Local<v8::Value> function = v8::Local<v8::Object>::Cast(data)->Get(v8::String::NewSymbol(propertyName)); +v8::Handle<v8::Function> DOMTransaction::getFunction(const char* propertyName) +{ + v8::Handle<v8::Value> dictionary = data(); + if (dictionary.IsEmpty() || !dictionary->IsObject()) + return v8::Handle<v8::Function>(); + + v8::Local<v8::Value> function = v8::Handle<v8::Object>::Cast(dictionary)->Get(v8::String::NewSymbol(propertyName)); if (function.IsEmpty() || !function->IsFunction()) return v8::Handle<v8::Function>(); diff --git a/Source/WebCore/bindings/v8/DOMTransaction.h b/Source/WebCore/bindings/v8/DOMTransaction.h index 88fb30db8..96a1f1d2e 100644 --- a/Source/WebCore/bindings/v8/DOMTransaction.h +++ b/Source/WebCore/bindings/v8/DOMTransaction.h @@ -47,6 +47,9 @@ public: virtual EditAction editingAction() const OVERRIDE { return EditActionUnspecified; } virtual bool isDOMTransaction() const OVERRIDE { return true; } + v8::Handle<v8::Value> data(); + void setData(v8::Handle<v8::Value>); + UndoManager* undoManager() const { return m_undoManager; } void setUndoManager(UndoManager* undoManager) { m_undoManager = undoManager; } diff --git a/Source/WebCore/bindings/v8/NPV8Object.cpp b/Source/WebCore/bindings/v8/NPV8Object.cpp index af7d99e7e..a32b44ea5 100644 --- a/Source/WebCore/bindings/v8/NPV8Object.cpp +++ b/Source/WebCore/bindings/v8/NPV8Object.cpp @@ -39,7 +39,6 @@ #include "V8Binding.h" #include "V8GCController.h" #include "V8NPUtils.h" -#include "V8Proxy.h" #include "WrapperTypeInfo.h" #include "npruntime_impl.h" #include "npruntime_priv.h" @@ -69,15 +68,6 @@ static v8::Local<v8::Context> toV8Context(NPP npp, NPObject* npObject) return ScriptController::mainWorldContext(object->rootObject->frame()); } -static V8Proxy* toV8Proxy(NPObject* npObject) -{ - V8NPObject* object = reinterpret_cast<V8NPObject*>(npObject); - Frame* frame = object->rootObject->frame(); - if (!frame) - return 0; - return frame->script()->proxy(); -} - static V8NPObjectMap* staticV8NPObjectMap() { DEFINE_STATIC_LOCAL(V8NPObjectMap, v8npObjectMap, ()); @@ -335,9 +325,6 @@ bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri if (context.IsEmpty()) return false; - V8Proxy* proxy = toV8Proxy(npObject); - ASSERT(proxy); - v8::Context::Scope scope(context); ExceptionCatcher exceptionCatcher; @@ -346,10 +333,14 @@ bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri if (!popupsAllowed) filename = "npscript"; + V8NPObject* v8NpObject = reinterpret_cast<V8NPObject*>(npObject); + Frame* frame = v8NpObject->rootObject->frame(); + ASSERT(frame); + String script = String::fromUTF8(npScript->UTF8Characters, npScript->UTF8Length); UserGestureIndicator gestureIndicator(popupsAllowed ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture); - v8::Local<v8::Value> v8result = proxy->evaluate(ScriptSourceCode(script, KURL(ParsedURLString, filename)), 0); + v8::Local<v8::Value> v8result = frame->script()->compileAndRunScript(ScriptSourceCode(script, KURL(ParsedURLString, filename))); if (v8result.IsEmpty()) return false; diff --git a/Source/WebCore/bindings/v8/OwnHandle.h b/Source/WebCore/bindings/v8/OwnHandle.h index 17c551cd6..668f5d414 100644 --- a/Source/WebCore/bindings/v8/OwnHandle.h +++ b/Source/WebCore/bindings/v8/OwnHandle.h @@ -35,45 +35,41 @@ namespace WebCore { - template<typename T> - class OwnHandle { - public: - OwnHandle() { } - explicit OwnHandle(v8::Handle<T> handle) : m_handle(v8::Persistent<T>::New(handle)) { } - ~OwnHandle() { clear(); } +template<typename T> +class OwnHandle { +public: + OwnHandle() { } - v8::Handle<T> get() const { return m_handle; } - void set(v8::Handle<T> handle) { clear(); m_handle = v8::Persistent<T>::New(handle); } + explicit OwnHandle(v8::Handle<T> handle) + : m_handle(v8::Persistent<T>::New(handle)) + { + } - // Note: This is clear in the OwnPtr sense, not the v8::Handle sense. - void clear() - { - if (m_handle.IsEmpty()) - return; - if (m_handle.IsWeak()) - m_handle.ClearWeak(); - m_handle.Dispose(); - m_handle.Clear(); - } + ~OwnHandle() + { + clear(); + } - // Make the underlying handle weak. The client doesn't get a callback, - // we just make the handle empty. - void makeWeak() - { - if (m_handle.IsEmpty()) - return; - m_handle.MakeWeak(this, &OwnHandle<T>::weakCallback); - } + v8::Handle<T> get() const { return m_handle; } - private: - static void weakCallback(v8::Persistent<v8::Value> object, void* ownHandle) - { - OwnHandle<T>* handle = static_cast<OwnHandle<T>*>(ownHandle); - handle->clear(); - } + void set(v8::Handle<T> handle) + { + clear(); + m_handle = v8::Persistent<T>::New(handle); + } - v8::Persistent<T> m_handle; - }; + // Note: This is clear in the OwnPtr sense, not the v8::Handle sense. + void clear() + { + if (m_handle.IsEmpty()) + return; + m_handle.Dispose(); + m_handle.Clear(); + } + +private: + v8::Persistent<T> m_handle; +}; } // namespace WebCore diff --git a/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp b/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp index 04169fc3d..b4857b453 100755 --- a/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp +++ b/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp @@ -39,7 +39,6 @@ #include "ScriptDebugListener.h" #include "V8Binding.h" #include "V8DOMWindow.h" -#include "V8Proxy.h" #include "V8RecursionScope.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> diff --git a/Source/WebCore/bindings/v8/ScheduledAction.cpp b/Source/WebCore/bindings/v8/ScheduledAction.cpp index d56f677a0..2a5f89d2d 100644 --- a/Source/WebCore/bindings/v8/ScheduledAction.cpp +++ b/Source/WebCore/bindings/v8/ScheduledAction.cpp @@ -42,7 +42,6 @@ #include "ScriptController.h" #include "V8Binding.h" -#include "V8Proxy.h" #include "V8RecursionScope.h" #include "WorkerContext.h" #include "WorkerContextExecutionProxy.h" @@ -132,7 +131,7 @@ void ScheduledAction::execute(ScriptController* script) if (!m_function.IsEmpty() && m_function->IsFunction()) script->callFunction(v8::Persistent<v8::Function>::Cast(m_function), v8Context->Global(), m_argc, m_argv); else - script->proxy()->evaluate(m_code, 0); + script->compileAndRunScript(m_code); // The 'proxy' may be invalid at this point since JS could have released the owning Frame. } diff --git a/Source/WebCore/bindings/v8/ScriptController.cpp b/Source/WebCore/bindings/v8/ScriptController.cpp index 9955ca907..1fb36b374 100644 --- a/Source/WebCore/bindings/v8/ScriptController.cpp +++ b/Source/WebCore/bindings/v8/ScriptController.cpp @@ -50,6 +50,7 @@ #include "PlatformSupport.h" #include "ScriptCallStack.h" #include "ScriptCallStackFactory.h" +#include "ScriptRunner.h" #include "ScriptSourceCode.h" #include "ScriptableDocumentParser.h" #include "SecurityOrigin.h" @@ -62,7 +63,6 @@ #include "V8HTMLEmbedElement.h" #include "V8IsolatedContext.h" #include "V8NPObject.h" -#include "V8Proxy.h" #include "V8RecursionScope.h" #include "Widget.h" #include <wtf/StdLibExtras.h> @@ -154,12 +154,12 @@ void ScriptController::clearScriptObjects() void ScriptController::resetIsolatedWorlds() { - for (IsolatedWorldMap::iterator iter = m_proxy->isolatedWorlds().begin(); - iter != m_proxy->isolatedWorlds().end(); ++iter) { + for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); + iter != m_isolatedWorlds.end(); ++iter) { iter->second->destroy(); } - m_proxy->isolatedWorlds().clear(); - m_proxy->isolatedWorldSecurityOrigins().clear(); + m_isolatedWorlds.clear(); + m_isolatedWorldSecurityOrigins.clear(); } void ScriptController::clearForClose() @@ -198,12 +198,6 @@ v8::Local<v8::Value> ScriptController::callFunction(v8::Handle<v8::Function> fun return ScriptController::callFunctionWithInstrumentation(m_frame ? m_frame->document() : 0, function, receiver, argc, args); } -static v8::Local<v8::Value> handleMaxRecursionDepthExceeded() -{ - throwError(RangeError, "Maximum call stack size exceeded."); - return v8::Local<v8::Value>(); -} - static inline void resourceInfo(const v8::Handle<v8::Function> function, String& resourceName, int& lineNumber) { v8::ScriptOrigin origin = function->GetScriptOrigin(); @@ -262,6 +256,73 @@ ScriptValue ScriptController::callFunctionEvenIfScriptDisabled(v8::Handle<v8::Fu return ScriptValue(callFunction(function, receiver, argc, argv)); } +v8::Local<v8::Value> ScriptController::compileAndRunScript(const ScriptSourceCode& source) +{ + ASSERT(v8::Context::InContext()); + + V8GCController::checkMemoryUsage(); + + InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, source.url().isNull() ? String() : source.url().string(), source.startLine()); + + v8::Local<v8::Value> result; + { + // Isolate exceptions that occur when compiling and executing + // the code. These exceptions should not interfere with + // javascript code we might evaluate from C++ when returning + // from here. + v8::TryCatch tryCatch; + tryCatch.SetVerbose(true); + + // Compile the script. + v8::Local<v8::String> code = v8ExternalString(source.source()); +#if PLATFORM(CHROMIUM) + TRACE_EVENT_BEGIN0("v8", "v8.compile"); +#endif + OwnPtr<v8::ScriptData> scriptData = ScriptSourceCode::precompileScript(code, source.cachedScript()); + + // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at + // 1, whereas v8 starts at 0. + v8::Handle<v8::Script> script = ScriptSourceCode::compileScript(code, source.url(), source.startPosition(), scriptData.get()); +#if PLATFORM(CHROMIUM) + TRACE_EVENT_END0("v8", "v8.compile"); + TRACE_EVENT0("v8", "v8.run"); +#endif + + // Keep Frame (and therefore ScriptController) alive. + RefPtr<Frame> protect(m_frame); + result = ScriptRunner::runCompiledScript(script, m_frame->document()); + } + + InspectorInstrumentation::didEvaluateScript(cookie); + + return result; +} + +ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode) +{ + String sourceURL = sourceCode.url(); + const String* savedSourceURL = m_sourceURL; + m_sourceURL = &sourceURL; + + v8::HandleScope handleScope; + v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(m_frame); + if (v8Context.IsEmpty()) + return ScriptValue(); + + v8::Context::Scope scope(v8Context); + + RefPtr<Frame> protect(m_frame); + + v8::Local<v8::Value> object = compileAndRunScript(sourceCode); + + m_sourceURL = savedSourceURL; + + if (object.IsEmpty()) + return ScriptValue(); + + return ScriptValue(object); +} + void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources, Vector<ScriptValue>* results) { evaluateInIsolatedWorld(worldID, sources, 0, results); @@ -280,8 +341,8 @@ void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<Sc v8::HandleScope evaluateHandleScope; V8IsolatedContext* isolatedContext = 0; if (worldID > 0) { - IsolatedWorldMap::iterator iter = m_proxy->isolatedWorlds().find(worldID); - if (iter != m_proxy->isolatedWorlds().end()) + IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(worldID); + if (iter != m_isolatedWorlds.end()) isolatedContext = iter->second; else { isolatedContext = new V8IsolatedContext(m_frame, extensionGroup, worldID); @@ -291,11 +352,11 @@ void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<Sc } // FIXME: We should change this to using window shells to match JSC. - m_proxy->isolatedWorlds().set(worldID, isolatedContext); + m_isolatedWorlds.set(worldID, isolatedContext); } - IsolatedWorldSecurityOriginMap::iterator securityOriginIter = m_proxy->isolatedWorldSecurityOrigins().find(worldID); - if (securityOriginIter != m_proxy->isolatedWorldSecurityOrigins().end()) + IsolatedWorldSecurityOriginMap::iterator securityOriginIter = m_isolatedWorldSecurityOrigins.find(worldID); + if (securityOriginIter != m_isolatedWorldSecurityOrigins.end()) isolatedContext->setSecurityOrigin(securityOriginIter->second); } else { isolatedContext = new V8IsolatedContext(m_frame, extensionGroup, worldID); @@ -310,7 +371,7 @@ void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<Sc v8::Local<v8::Array> resultArray = v8::Array::New(sources.size()); for (size_t i = 0; i < sources.size(); ++i) { - v8::Local<v8::Value> evaluationResult = m_proxy->evaluate(sources[i], 0); + v8::Local<v8::Value> evaluationResult = compileAndRunScript(sources[i]); if (evaluationResult.IsEmpty()) evaluationResult = v8::Local<v8::Value>::New(v8::Undefined()); resultArray->Set(i, evaluationResult); @@ -331,38 +392,12 @@ void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<Sc void ScriptController::setIsolatedWorldSecurityOrigin(int worldID, PassRefPtr<SecurityOrigin> securityOrigin) { ASSERT(worldID); - m_proxy->isolatedWorldSecurityOrigins().set(worldID, securityOrigin); - IsolatedWorldMap::iterator iter = m_proxy->isolatedWorlds().find(worldID); - if (iter != m_proxy->isolatedWorlds().end()) + m_isolatedWorldSecurityOrigins.set(worldID, securityOrigin); + IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(worldID); + if (iter != m_isolatedWorlds.end()) iter->second->setSecurityOrigin(securityOrigin); } -// Evaluate a script file in the environment of this proxy. -ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode) -{ - String sourceURL = sourceCode.url(); - const String* savedSourceURL = m_sourceURL; - m_sourceURL = &sourceURL; - - v8::HandleScope handleScope; - v8::Handle<v8::Context> v8Context = ScriptController::mainWorldContext(m_proxy->frame()); - if (v8Context.IsEmpty()) - return ScriptValue(); - - v8::Context::Scope scope(v8Context); - - RefPtr<Frame> protect(m_frame); - - v8::Local<v8::Value> object = m_proxy->evaluate(sourceCode, 0); - - m_sourceURL = savedSourceURL; - - if (object.IsEmpty()) - return ScriptValue(); - - return ScriptValue(object); -} - TextPosition ScriptController::eventHandlerPosition() const { ScriptableDocumentParser* parser = m_frame->document()->scriptableDocumentParser(); @@ -373,7 +408,17 @@ TextPosition ScriptController::eventHandlerPosition() const void ScriptController::finishedWithEvent(Event* event) { - m_proxy->finishedWithEvent(event); +} + +v8::Local<v8::Context> ScriptController::currentWorldContext() +{ + if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) { + RefPtr<SharedPersistent<v8::Context> > context = isolatedContext->sharedContext(); + if (m_frame != toFrameIfNotDetached(context->get())) + return v8::Local<v8::Context>(); + return v8::Local<v8::Context>::New(context->get()); + } + return mainWorldContext(); } v8::Local<v8::Context> ScriptController::mainWorldContext() @@ -390,6 +435,24 @@ v8::Local<v8::Context> ScriptController::mainWorldContext(Frame* frame) return frame->script()->mainWorldContext(); } +bool ScriptController::matchesCurrentContext() +{ + // This method is equivalent to 'return v8::Context::GetCurrent() == contextForCurrentWorld()', + // but is written without using contextForCurrentWorld(). + // Given that this method is used by a hot call path of DOM object constructor, + // we want to avoid the overhead of contextForCurrentWorld() creating Local<Context> every time. + v8::Handle<v8::Context> context; + if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) { + context = isolatedContext->sharedContext()->get(); + if (m_frame != toFrameIfNotDetached(context)) + return false; + } else { + windowShell()->initContextIfNeeded(); + context = windowShell()->context(); + } + return context == v8::Context::GetCurrent(); +} + // Create a V8 object with an interceptor of NPObjectPropertyGetter. void ScriptController::bindToWindowObject(Frame* frame, const String& key, NPObject* object) { @@ -598,7 +661,7 @@ void ScriptController::setCaptureCallStackForUncaughtExceptions(bool value) void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, SecurityOrigin*> >& result) { v8::HandleScope handleScope; - for (IsolatedWorldMap::iterator it = m_proxy->isolatedWorlds().begin(); it != m_proxy->isolatedWorlds().end(); ++it) { + for (IsolatedWorldMap::iterator it = m_isolatedWorlds.begin(); it != m_isolatedWorlds.end(); ++it) { V8IsolatedContext* isolatedContext = it->second; if (!isolatedContext->securityOrigin()) continue; diff --git a/Source/WebCore/bindings/v8/ScriptController.h b/Source/WebCore/bindings/v8/ScriptController.h index d67836030..ca59838ac 100644 --- a/Source/WebCore/bindings/v8/ScriptController.h +++ b/Source/WebCore/bindings/v8/ScriptController.h @@ -88,7 +88,10 @@ public: // This function must be called from the main thread. It is safe to call it repeatedly. static void initializeThreading(); - // Evaluate a script file in the environment of this proxy. + v8::Local<v8::Value> compileAndRunScript(const ScriptSourceCode&); + + // Evaluate JavaScript in the main world. + // The caller must hold an execution context. ScriptValue evaluate(const ScriptSourceCode&); // Evaluate JavaScript in a new isolated world. The script gets its own @@ -154,10 +157,13 @@ public: // V8Proxy::retrieveFrameForEnteredContext() for more information. static Frame* retrieveFrameForCurrentContext(); - // Returns V8 Context of a frame. If none exists, creates - // a new context. It is potentially slow and consumes memory. + // Returns V8 Context. If none exists, creates a new context. + // It is potentially slow and consumes memory. static v8::Local<v8::Context> mainWorldContext(Frame*); v8::Local<v8::Context> mainWorldContext(); + v8::Local<v8::Context> currentWorldContext(); + + bool matchesCurrentContext(); // Pass command-line flags to the JS engine. static void setFlags(const char* string, int length); @@ -212,6 +218,13 @@ private: // For the moment, we have one of these. Soon we will have one per DOMWrapperWorld. RefPtr<V8DOMWindowShell> m_windowShell; + // The isolated worlds we are tracking for this frame. We hold them alive + // here so that they can be used again by future calls to + // evaluateInIsolatedWorld(). + IsolatedWorldMap m_isolatedWorlds; + + IsolatedWorldSecurityOriginMap m_isolatedWorldSecurityOrigins; + bool m_paused; OwnPtr<V8Proxy> m_proxy; diff --git a/Source/WebCore/bindings/v8/ScriptInstance.cpp b/Source/WebCore/bindings/v8/ScriptInstance.cpp index 645b1daf2..1f407d0f5 100644 --- a/Source/WebCore/bindings/v8/ScriptInstance.cpp +++ b/Source/WebCore/bindings/v8/ScriptInstance.cpp @@ -31,9 +31,7 @@ #include "config.h" #include "ScriptInstance.h" -#ifndef NDEBUG -#include "V8Proxy.h" -#endif +#include "V8GCController.h" #include <wtf/Assertions.h> namespace WebCore { diff --git a/Source/WebCore/bindings/v8/ScriptObject.cpp b/Source/WebCore/bindings/v8/ScriptObject.cpp index 0266df48e..8154d9705 100644 --- a/Source/WebCore/bindings/v8/ScriptObject.cpp +++ b/Source/WebCore/bindings/v8/ScriptObject.cpp @@ -39,7 +39,6 @@ #include "V8Binding.h" #include "V8InjectedScriptHost.h" #include "V8InspectorFrontendHost.h" -#include "V8Proxy.h" #include <v8.h> diff --git a/Source/WebCore/bindings/v8/ScriptRunner.cpp b/Source/WebCore/bindings/v8/ScriptRunner.cpp new file mode 100644 index 000000000..04f8ea304 --- /dev/null +++ b/Source/WebCore/bindings/v8/ScriptRunner.cpp @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "ScriptRunner.h" + +#include "ScriptExecutionContext.h" +#include "V8Binding.h" +#include "V8GCController.h" +#include "V8RecursionScope.h" + +namespace WebCore { + +v8::Local<v8::Value> ScriptRunner::runCompiledScript(v8::Handle<v8::Script> script, ScriptExecutionContext* context) +{ + if (script.IsEmpty()) + return v8::Local<v8::Value>(); + + V8GCController::checkMemoryUsage(); + if (V8RecursionScope::recursionLevel() >= kMaxRecursionDepth) + return handleMaxRecursionDepthExceeded(); + + if (handleOutOfMemory()) + ASSERT(script.IsEmpty()); + + // Run the script and keep track of the current recursion depth. + v8::Local<v8::Value> result; + v8::TryCatch tryCatch; + tryCatch.SetVerbose(true); + { + V8RecursionScope recursionScope(context); + result = script->Run(); + } + + if (handleOutOfMemory()) + ASSERT(result.IsEmpty()); + + // Handle V8 internal error situation. + if (tryCatch.HasCaught()) { + ASSERT(result.IsEmpty()); + return v8::Local<v8::Value>(); + } + + if (result.IsEmpty()) + return v8::Local<v8::Value>(); + + crashIfV8IsDead(); + return result; +} + +} // namespace WebCore diff --git a/Source/WebCore/bindings/v8/ScriptRunner.h b/Source/WebCore/bindings/v8/ScriptRunner.h new file mode 100644 index 000000000..381576cdd --- /dev/null +++ b/Source/WebCore/bindings/v8/ScriptRunner.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ScriptRunner_h +#define ScriptRunner_h + +#include <v8.h> + +namespace WebCore { + +class ScriptExecutionContext; + +class ScriptRunner { +public: + static v8::Local<v8::Value> runCompiledScript(v8::Handle<v8::Script>, ScriptExecutionContext*); +}; + +} // namespace WebCore + +#endif // ScriptRunner_h diff --git a/Source/WebCore/bindings/v8/ScriptSourceCode.cpp b/Source/WebCore/bindings/v8/ScriptSourceCode.cpp index a478e6817..efff63e17 100644 --- a/Source/WebCore/bindings/v8/ScriptSourceCode.cpp +++ b/Source/WebCore/bindings/v8/ScriptSourceCode.cpp @@ -26,10 +26,34 @@ #include "config.h" #include "ScriptSourceCode.h" +#include "CachedMetadata.h" +#include "CachedScript.h" #include "V8Binding.h" namespace WebCore { +PassOwnPtr<v8::ScriptData> ScriptSourceCode::precompileScript(v8::Handle<v8::String> code, CachedScript* cachedScript) +{ + // A pseudo-randomly chosen ID used to store and retrieve V8 ScriptData from + // the CachedScript. If the format changes, this ID should be changed too. + static const unsigned dataTypeID = 0xECC13BD7; + + // Very small scripts are not worth the effort to preparse. + static const int minPreparseLength = 1024; + + if (!cachedScript || code->Length() < minPreparseLength) + return nullptr; + + CachedMetadata* cachedMetadata = cachedScript->cachedMetadata(dataTypeID); + if (cachedMetadata) + return adoptPtr(v8::ScriptData::New(cachedMetadata->data(), cachedMetadata->size())); + + OwnPtr<v8::ScriptData> scriptData = adoptPtr(v8::ScriptData::PreCompile(code)); + cachedScript->setCachedMetadata(dataTypeID, scriptData->Data(), scriptData->Length()); + + return scriptData.release(); +} + v8::Handle<v8::Script> ScriptSourceCode::compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition& scriptStartPosition, v8::ScriptData* scriptData) { v8::Handle<v8::String> name = v8String(fileName); diff --git a/Source/WebCore/bindings/v8/ScriptSourceCode.h b/Source/WebCore/bindings/v8/ScriptSourceCode.h index a6543ca81..32f855da7 100644 --- a/Source/WebCore/bindings/v8/ScriptSourceCode.h +++ b/Source/WebCore/bindings/v8/ScriptSourceCode.h @@ -36,6 +36,7 @@ #include "KURL.h" #include "PlatformString.h" #include <v8.h> +#include <wtf/PassOwnPtr.h> #include <wtf/text/TextPosition.h> namespace WebCore { @@ -73,6 +74,7 @@ public: int startLine() const { return m_startPosition.m_line.oneBasedInt(); } const TextPosition& startPosition() const { return m_startPosition; } + static PassOwnPtr<v8::ScriptData> precompileScript(v8::Handle<v8::String>, CachedScript*); static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String>, const String&, const TextPosition&, v8::ScriptData* = 0); private: diff --git a/Source/WebCore/bindings/v8/SerializedScriptValue.cpp b/Source/WebCore/bindings/v8/SerializedScriptValue.cpp index 83bb8f0b3..a9b39ce11 100644 --- a/Source/WebCore/bindings/v8/SerializedScriptValue.cpp +++ b/Source/WebCore/bindings/v8/SerializedScriptValue.cpp @@ -54,7 +54,6 @@ #include "V8Int32Array.h" #include "V8Int8Array.h" #include "V8MessagePort.h" -#include "V8Proxy.h" #include "V8Uint16Array.h" #include "V8Uint32Array.h" #include "V8Uint8Array.h" diff --git a/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp b/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp index bc47766f9..04f399163 100644 --- a/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp +++ b/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp @@ -41,7 +41,6 @@ #include "V8Event.h" #include "V8EventListenerList.h" #include "V8HiddenPropertyName.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WorkerContext.h" #include "WorkerContextExecutionProxy.h" diff --git a/Source/WebCore/bindings/v8/V8Binding.cpp b/Source/WebCore/bindings/v8/V8Binding.cpp index 83f126cb9..bf57f8286 100644 --- a/Source/WebCore/bindings/v8/V8Binding.cpp +++ b/Source/WebCore/bindings/v8/V8Binding.cpp @@ -43,8 +43,10 @@ #include "V8DOMWindow.h" #include "V8Element.h" #include "V8ObjectConstructor.h" +#include "V8XPathNSResolver.h" #include "WorkerContext.h" #include "WorkerContextExecutionProxy.h" +#include "XPathNSResolver.h" #include <wtf/MathExtras.h> #include <wtf/MainThread.h> @@ -240,6 +242,16 @@ PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value> value) return ret.release(); } +PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> value) +{ + RefPtr<XPathNSResolver> resolver; + if (V8XPathNSResolver::HasInstance(value)) + resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(value)); + else if (value->IsObject()) + resolver = V8CustomXPathNSResolver::create(value->ToObject()); + return resolver; +} + DOMWindow* toDOMWindow(v8::Handle<v8::Context> context) { v8::Handle<v8::Object> global = context->Global(); @@ -307,6 +319,12 @@ bool handleOutOfMemory() return true; } +v8::Local<v8::Value> handleMaxRecursionDepthExceeded() +{ + throwError(RangeError, "Maximum call stack size exceeded."); + return v8::Local<v8::Value>(); +} + void crashIfV8IsDead() { if (v8::V8::IsDead()) { diff --git a/Source/WebCore/bindings/v8/V8Binding.h b/Source/WebCore/bindings/v8/V8Binding.h index 5bb4c0154..2333cede0 100644 --- a/Source/WebCore/bindings/v8/V8Binding.h +++ b/Source/WebCore/bindings/v8/V8Binding.h @@ -40,7 +40,6 @@ #include "V8HiddenPropertyName.h" #include "V8ObjectConstructor.h" #include "V8PerIsolateData.h" -#include "V8Proxy.h" #include "V8StringResource.h" #include "V8ThrowException.h" #include "V8ValueCache.h" @@ -51,6 +50,10 @@ namespace WebCore { class DOMStringList; + class ScriptExecutionContext; + class WorldContextHandle; + + const int kMaxRecursionDepth = 22; // Schedule a DOM exception to be thrown, if the exception code is different // from zero. @@ -348,6 +351,7 @@ namespace WebCore { v8::Persistent<v8::FunctionTemplate> createRawTemplate(); PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value>); + PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>); // Returns the window object associated with a context. DOMWindow* toDOMWindow(v8::Handle<v8::Context>); @@ -365,6 +369,7 @@ namespace WebCore { // If the current context causes out of memory, JavaScript setting // is disabled and it returns true. bool handleOutOfMemory(); + v8::Local<v8::Value> handleMaxRecursionDepthExceeded(); void crashIfV8IsDead(); diff --git a/Source/WebCore/bindings/v8/V8BindingMacros.h b/Source/WebCore/bindings/v8/V8BindingMacros.h index 0e3802244..f4cab8b85 100644 --- a/Source/WebCore/bindings/v8/V8BindingMacros.h +++ b/Source/WebCore/bindings/v8/V8BindingMacros.h @@ -33,6 +33,12 @@ namespace WebCore { +#if defined(ENABLE_DOM_STATS_COUNTERS) && PLATFORM(CHROMIUM) +#define INC_STATS(name) StatsCounter::incrementStatsCounter(name) +#else +#define INC_STATS(name) +#endif + enum ParameterDefaultPolicy { DefaultIsUndefined, DefaultIsNullString diff --git a/Source/WebCore/bindings/v8/V8Collection.h b/Source/WebCore/bindings/v8/V8Collection.h index 281f8ec62..5dff6e7f0 100644 --- a/Source/WebCore/bindings/v8/V8Collection.h +++ b/Source/WebCore/bindings/v8/V8Collection.h @@ -35,7 +35,6 @@ #include "HTMLSelectElement.h" #include "V8Binding.h" #include "V8Node.h" -#include "V8Proxy.h" #include <v8.h> namespace WebCore { diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp index 80204668f..3e6a78e24 100644 --- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp +++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp @@ -61,7 +61,6 @@ #include "V8Location.h" #include "V8ObjectConstructor.h" #include "V8PerContextData.h" -#include "V8Proxy.h" #include "WorkerContextExecutionProxy.h" #include <algorithm> diff --git a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp index 31ff31da3..f51b67bbe 100644 --- a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp +++ b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp @@ -52,15 +52,12 @@ #include "V8NodeList.h" #include "V8ObjectConstructor.h" #include "V8PerContextData.h" -#include "V8Proxy.h" #include "V8StyleSheet.h" #include "V8WorkerContextEventListener.h" -#include "V8XPathNSResolver.h" #include "WebGLContextAttributes.h" #include "WebGLUniformLocation.h" #include "WorkerContextExecutionProxy.h" #include "WrapperTypeInfo.h" -#include "XPathNSResolver.h" #include <algorithm> #include <utility> #include <v8-debug.h> @@ -110,12 +107,6 @@ v8::Local<v8::Function> V8DOMWrapper::constructorForType(WrapperTypeInfo* type, } #endif -V8PerContextData* V8DOMWrapper::perContextData(V8Proxy* proxy) -{ - V8DOMWindowShell* shell = proxy->windowShell(); - return shell ? shell->perContextData() : 0; -} - #if ENABLE(WORKERS) V8PerContextData* V8DOMWrapper::perContextData(WorkerContext*) { @@ -135,7 +126,7 @@ void V8DOMWrapper::setNamedHiddenWindowReference(Frame* frame, const char* name, // Get DOMWindow if (!frame) return; // Object might be detached from window - v8::Handle<v8::Context> context = V8Proxy::context(frame); + v8::Handle<v8::Context> context = frame->script()->currentWorldContext(); if (context.IsEmpty()) return; @@ -166,23 +157,19 @@ PassRefPtr<NodeFilter> V8DOMWrapper::wrapNativeNodeFilter(v8::Handle<v8::Value> return NodeFilter::create(V8NodeFilterCondition::create(filter)); } -v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo* type, void* impl) +v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(Frame* frame, WrapperTypeInfo* type, void* impl) { #if ENABLE(WORKERS) WorkerContext* workerContext = 0; #endif - V8PerContextData* contextData = 0; - V8IsolatedContext* isolatedContext; - if (UNLIKELY(!!(isolatedContext = V8IsolatedContext::getEntered()))) { - contextData = isolatedContext->perContextData(); - } else if (!proxy) { + if (!frame) { v8::Handle<v8::Context> context = v8::Context::GetCurrent(); if (!context.IsEmpty()) { v8::Handle<v8::Object> globalPrototype = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype()); if (isWrapperOfType(globalPrototype, &V8DOMWindow::info)) { - Frame* frame = V8DOMWindow::toNative(globalPrototype)->frame(); - if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) - proxy = frame->script()->proxy(); + Frame* globalFrame = V8DOMWindow::toNative(globalPrototype)->frame(); + if (globalFrame && globalFrame->script()->canExecuteScripts(NotAboutToExecuteScript)) + frame = globalFrame; } #if ENABLE(WORKERS) else if (isWrapperOfType(globalPrototype, &V8WorkerContext::info)) @@ -191,23 +178,21 @@ v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperT } } - v8::Local<v8::Object> instance; - if (!contextData) { - if (proxy) - contextData = perContextData(proxy); + V8PerContextData* contextData = 0; + if (frame) + contextData = perContextDataForCurrentWorld(frame); #if ENABLE(WORKERS) - else if (workerContext) - contextData = perContextData(workerContext); + else if (workerContext) + contextData = perContextData(workerContext); #endif - } + v8::Local<v8::Object> instance; if (contextData) instance = contextData->createWrapperFromCache(type); else { v8::Local<v8::Function> function = type->getTemplate()->GetFunction(); instance = V8ObjectConstructor::newInstance(function); } - if (!instance.IsEmpty()) { // Avoid setting the DOM wrapper for failed allocations. setDOMWrapper(instance, type, impl); @@ -293,16 +278,4 @@ PassRefPtr<EventListener> V8DOMWrapper::getEventListener(v8::Local<v8::Value> va #endif } -// XPath-related utilities -RefPtr<XPathNSResolver> V8DOMWrapper::getXPathNSResolver(v8::Handle<v8::Value> value, V8Proxy* proxy) -{ - RefPtr<XPathNSResolver> resolver; - if (V8XPathNSResolver::HasInstance(value)) - resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(value)); - else if (value->IsObject()) - resolver = V8CustomXPathNSResolver::create(value->ToObject()); - return resolver; -} - - } // namespace WebCore diff --git a/Source/WebCore/bindings/v8/V8DOMWrapper.h b/Source/WebCore/bindings/v8/V8DOMWrapper.h index d9e8059e4..f66e89e49 100644 --- a/Source/WebCore/bindings/v8/V8DOMWrapper.h +++ b/Source/WebCore/bindings/v8/V8DOMWrapper.h @@ -93,9 +93,6 @@ namespace WebCore { static PassRefPtr<EventListener> getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup); - // XPath-related utilities - static RefPtr<XPathNSResolver> getXPathNSResolver(v8::Handle<v8::Value> value, V8Proxy* proxy = 0); - // Wrap JS node filter in C++. static PassRefPtr<NodeFilter> wrapNativeNodeFilter(v8::Handle<v8::Value>); @@ -125,7 +122,7 @@ namespace WebCore { static void setNamedHiddenReference(v8::Handle<v8::Object> parent, const char* name, v8::Handle<v8::Value> child); static void setNamedHiddenWindowReference(Frame*, const char*, v8::Handle<v8::Value>); - static v8::Local<v8::Object> instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo*, void* impl); + static v8::Local<v8::Object> instantiateV8Object(Frame*, WrapperTypeInfo*, void*); static v8::Handle<v8::Object> getCachedWrapper(Node* node) { @@ -148,7 +145,6 @@ namespace WebCore { return domNodeMap.get(node); } private: - static V8PerContextData* perContextData(V8Proxy*); #if ENABLE(WORKERS) static V8PerContextData* perContextData(WorkerContext*); #endif diff --git a/Source/WebCore/bindings/v8/V8EventListener.cpp b/Source/WebCore/bindings/v8/V8EventListener.cpp index a5eb85e83..e872b17e8 100644 --- a/Source/WebCore/bindings/v8/V8EventListener.cpp +++ b/Source/WebCore/bindings/v8/V8EventListener.cpp @@ -37,7 +37,6 @@ #include "Document.h" #include "Frame.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/V8GCController.cpp b/Source/WebCore/bindings/v8/V8GCController.cpp index 42380ca2a..2a882dc76 100644 --- a/Source/WebCore/bindings/v8/V8GCController.cpp +++ b/Source/WebCore/bindings/v8/V8GCController.cpp @@ -42,6 +42,7 @@ #include "PlatformSupport.h" #include "RetainedDOMInfo.h" #include "RetainedObjectInfo.h" +#include "V8AbstractEventListener.h" #include "V8Binding.h" #include "V8CSSRule.h" #include "V8CSSRuleList.h" diff --git a/Source/WebCore/bindings/v8/V8LazyEventListener.cpp b/Source/WebCore/bindings/v8/V8LazyEventListener.cpp index 91f782888..d548b1607 100644 --- a/Source/WebCore/bindings/v8/V8LazyEventListener.cpp +++ b/Source/WebCore/bindings/v8/V8LazyEventListener.cpp @@ -43,7 +43,6 @@ #include "V8HTMLFormElement.h" #include "V8HiddenPropertyName.h" #include "V8Node.h" -#include "V8Proxy.h" #include "V8RecursionScope.h" #include "WorldContextHandle.h" diff --git a/Source/WebCore/bindings/v8/V8NPObject.cpp b/Source/WebCore/bindings/v8/V8NPObject.cpp index 7bc073b83..a5b3d1deb 100644 --- a/Source/WebCore/bindings/v8/V8NPObject.cpp +++ b/Source/WebCore/bindings/v8/V8NPObject.cpp @@ -41,7 +41,6 @@ #include "V8HTMLObjectElement.h" #include "V8NPUtils.h" #include "V8ObjectConstructor.h" -#include "V8Proxy.h" #include "npruntime_impl.h" #include "npruntime_priv.h" #include <wtf/OwnArrayPtr.h> diff --git a/Source/WebCore/bindings/v8/V8NPUtils.cpp b/Source/WebCore/bindings/v8/V8NPUtils.cpp index 13cd55ef6..dfd751e32 100644 --- a/Source/WebCore/bindings/v8/V8NPUtils.cpp +++ b/Source/WebCore/bindings/v8/V8NPUtils.cpp @@ -39,7 +39,6 @@ #include "NPV8Object.h" #include "V8Binding.h" #include "V8NPObject.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/V8Proxy.cpp b/Source/WebCore/bindings/v8/V8Proxy.cpp index 0c025c176..ed36d8675 100644 --- a/Source/WebCore/bindings/v8/V8Proxy.cpp +++ b/Source/WebCore/bindings/v8/V8Proxy.cpp @@ -45,6 +45,7 @@ #include "PlatformSupport.h" #include "ScriptCallStack.h" #include "ScriptCallStackFactory.h" +#include "ScriptRunner.h" #include "ScriptSourceCode.h" #include "SecurityOrigin.h" #include "Settings.h" @@ -77,13 +78,6 @@ namespace WebCore { -// FIXME: This will be soon removed when we move runScript() to ScriptController. -static v8::Local<v8::Value> handleMaxRecursionDepthExceeded() -{ - throwError(RangeError, "Maximum call stack size exceeded."); - return v8::Local<v8::Value>(); -} - V8Proxy::V8Proxy(Frame* frame) : m_frame(frame) { @@ -94,158 +88,9 @@ V8Proxy::~V8Proxy() windowShell()->destroyGlobal(); } -PassOwnPtr<v8::ScriptData> V8Proxy::precompileScript(v8::Handle<v8::String> code, CachedScript* cachedScript) -{ - // A pseudo-randomly chosen ID used to store and retrieve V8 ScriptData from - // the CachedScript. If the format changes, this ID should be changed too. - static const unsigned dataTypeID = 0xECC13BD7; - - // Very small scripts are not worth the effort to preparse. - static const int minPreparseLength = 1024; - - if (!cachedScript || code->Length() < minPreparseLength) - return nullptr; - - CachedMetadata* cachedMetadata = cachedScript->cachedMetadata(dataTypeID); - if (cachedMetadata) - return adoptPtr(v8::ScriptData::New(cachedMetadata->data(), cachedMetadata->size())); - - OwnPtr<v8::ScriptData> scriptData = adoptPtr(v8::ScriptData::PreCompile(code)); - cachedScript->setCachedMetadata(dataTypeID, scriptData->Data(), scriptData->Length()); - - return scriptData.release(); -} - -v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* node) -{ - ASSERT(v8::Context::InContext()); - - V8GCController::checkMemoryUsage(); - - InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, source.url().isNull() ? String() : source.url().string(), source.startLine()); - - v8::Local<v8::Value> result; - { - // Isolate exceptions that occur when compiling and executing - // the code. These exceptions should not interfere with - // javascript code we might evaluate from C++ when returning - // from here. - v8::TryCatch tryCatch; - tryCatch.SetVerbose(true); - - // Compile the script. - v8::Local<v8::String> code = v8ExternalString(source.source()); -#if PLATFORM(CHROMIUM) - TRACE_EVENT_BEGIN0("v8", "v8.compile"); -#endif - OwnPtr<v8::ScriptData> scriptData = precompileScript(code, source.cachedScript()); - - // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at - // 1, whereas v8 starts at 0. - v8::Handle<v8::Script> script = ScriptSourceCode::compileScript(code, source.url(), source.startPosition(), scriptData.get()); -#if PLATFORM(CHROMIUM) - TRACE_EVENT_END0("v8", "v8.compile"); - TRACE_EVENT0("v8", "v8.run"); -#endif - result = runScript(script); - } - - InspectorInstrumentation::didEvaluateScript(cookie); - - return result; -} - -v8::Local<v8::Value> V8Proxy::runScript(v8::Handle<v8::Script> script) -{ - if (script.IsEmpty()) - return v8::Local<v8::Value>(); - - V8GCController::checkMemoryUsage(); - if (V8RecursionScope::recursionLevel() >= kMaxRecursionDepth) - return handleMaxRecursionDepthExceeded(); - - if (handleOutOfMemory()) - ASSERT(script.IsEmpty()); - - // Keep Frame (and therefore ScriptController and V8Proxy) alive. - RefPtr<Frame> protect(frame()); - - // Run the script and keep track of the current recursion depth. - v8::Local<v8::Value> result; - v8::TryCatch tryCatch; - tryCatch.SetVerbose(true); - { - V8RecursionScope recursionScope(frame()->document()); - result = script->Run(); - } - - if (handleOutOfMemory()) - ASSERT(result.IsEmpty()); - - // Handle V8 internal error situation (Out-of-memory). - if (tryCatch.HasCaught()) { - ASSERT(result.IsEmpty()); - return v8::Local<v8::Value>(); - } - - if (result.IsEmpty()) - return v8::Local<v8::Value>(); - - crashIfV8IsDead(); - return result; -} - V8DOMWindowShell* V8Proxy::windowShell() const { return frame()->script()->windowShell(); } -v8::Local<v8::Context> V8Proxy::context(Frame* frame) -{ - v8::Local<v8::Context> context = ScriptController::mainWorldContext(frame); - if (context.IsEmpty()) - return v8::Local<v8::Context>(); - - if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) { - context = v8::Local<v8::Context>::New(isolatedContext->context()); - if (frame != toFrameIfNotDetached(context)) - return v8::Local<v8::Context>(); - } - - return context; -} - -v8::Local<v8::Context> V8Proxy::context() -{ - if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) { - RefPtr<SharedPersistent<v8::Context> > context = isolatedContext->sharedContext(); - if (m_frame != toFrameIfNotDetached(context->get())) - return v8::Local<v8::Context>(); - return v8::Local<v8::Context>::New(context->get()); - } - return frame()->script()->mainWorldContext(); -} - -v8::Local<v8::Context> V8Proxy::isolatedWorldContext(int worldId) -{ - IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(worldId); - if (iter == m_isolatedWorlds.end()) - return v8::Local<v8::Context>(); - return v8::Local<v8::Context>::New(iter->second->context()); -} - -bool V8Proxy::matchesCurrentContext() -{ - v8::Handle<v8::Context> context; - if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) { - context = isolatedContext->sharedContext()->get(); - if (m_frame != toFrameIfNotDetached(context)) - return false; - } else { - windowShell()->initContextIfNeeded(); - context = windowShell()->context(); - } - return context == context->GetCurrent(); -} - } // namespace WebCore diff --git a/Source/WebCore/bindings/v8/V8Proxy.h b/Source/WebCore/bindings/v8/V8Proxy.h index a62a60862..07a7781e2 100644 --- a/Source/WebCore/bindings/v8/V8Proxy.h +++ b/Source/WebCore/bindings/v8/V8Proxy.h @@ -46,12 +46,6 @@ #include <wtf/Vector.h> #include <wtf/text/TextPosition.h> -#if defined(ENABLE_DOM_STATS_COUNTERS) && PLATFORM(CHROMIUM) -#define INC_STATS(name) StatsCounter::incrementStatsCounter(name) -#else -#define INC_STATS(name) -#endif - namespace WebCore { class CachedScript; @@ -67,8 +61,6 @@ namespace WebCore { class V8PerContextData; class WorldContextHandle; - const int kMaxRecursionDepth = 22; - // Note: although the pointer is raw, the instance is kept alive by a strong // reference to the v8 context it contains, which is not made weak until we // call world->destroy(). @@ -87,46 +79,12 @@ namespace WebCore { Frame* frame() const { return m_frame; } - void finishedWithEvent(Event*) { } - - // Evaluate a script file in the current execution environment. - // The caller must hold an execution context. - // If cannot evalute the script, it returns an error. - v8::Local<v8::Value> evaluate(const ScriptSourceCode&, Node*); - - // Run an already compiled script. - v8::Local<v8::Value> runScript(v8::Handle<v8::Script>); - - // Returns V8 Context of a frame. If none exists, creates - // a new context. It is potentially slow and consumes memory. - static v8::Local<v8::Context> context(Frame*); - - v8::Local<v8::Context> context(); - v8::Local<v8::Context> isolatedWorldContext(int worldId); - bool matchesCurrentContext(); - // FIXME: This should eventually take DOMWrapperWorld argument! // FIXME: This method will be soon removed, as all methods that access windowShell() // will be moved to ScriptController. V8DOMWindowShell* windowShell() const; - - // FIXME: Move m_isolatedWorlds to ScriptController and remove this getter. - IsolatedWorldMap& isolatedWorlds() { return m_isolatedWorlds; } - - // FIXME: Move m_isolatedWorldSecurityOrigins to ScriptController and remove this getter. - IsolatedWorldSecurityOriginMap& isolatedWorldSecurityOrigins() { return m_isolatedWorldSecurityOrigins; } - private: - PassOwnPtr<v8::ScriptData> precompileScript(v8::Handle<v8::String>, CachedScript*); - Frame* m_frame; - - // The isolated worlds we are tracking for this frame. We hold them alive - // here so that they can be used again by future calls to - // evaluateInIsolatedWorld(). - IsolatedWorldMap m_isolatedWorlds; - - IsolatedWorldSecurityOriginMap m_isolatedWorldSecurityOrigins; }; } diff --git a/Source/WebCore/bindings/v8/V8Utilities.cpp b/Source/WebCore/bindings/v8/V8Utilities.cpp index 4cfe531ea..0a45dddf0 100644 --- a/Source/WebCore/bindings/v8/V8Utilities.cpp +++ b/Source/WebCore/bindings/v8/V8Utilities.cpp @@ -41,7 +41,6 @@ #include "V8ArrayBuffer.h" #include "V8Binding.h" #include "V8MessagePort.h" -#include "V8Proxy.h" #include "WorkerContext.h" #include <v8.h> #include <wtf/ArrayBuffer.h> @@ -104,13 +103,19 @@ bool extractTransferables(v8::Local<v8::Value> value, MessagePortArray& ports, A v8::Local<v8::Value> transferrable = transferrables->Get(i); // Validation of non-null objects, per HTML5 spec 10.3.3. if (isUndefinedOrNull(transferrable)) { - setDOMException(DATA_CLONE_ERR, isolate); + setDOMException(INVALID_STATE_ERR, isolate); return false; } // Validation of Objects implementing an interface, per WebIDL spec 4.1.15. - if (V8MessagePort::HasInstance(transferrable)) - ports.append(V8MessagePort::toNative(v8::Handle<v8::Object>::Cast(transferrable))); - else if (V8ArrayBuffer::HasInstance(transferrable)) + if (V8MessagePort::HasInstance(transferrable)) { + RefPtr<MessagePort> port = V8MessagePort::toNative(v8::Handle<v8::Object>::Cast(transferrable)); + // Check for duplicate MessagePorts. + if (ports.contains(port)) { + setDOMException(INVALID_STATE_ERR, isolate); + return false; + } + ports.append(port.release()); + } else if (V8ArrayBuffer::HasInstance(transferrable)) arrayBuffers.append(V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(transferrable))); else { throwTypeError(); diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp index b0f051e8f..e7059fe69 100644 --- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp +++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp @@ -45,6 +45,7 @@ #include "V8DOMMap.h" #include "V8DOMWindowShell.h" #include "V8DedicatedWorkerContext.h" +#include "V8GCController.h" #include "V8ObjectConstructor.h" #include "V8PerContextData.h" #include "V8RecursionScope.h" diff --git a/Source/WebCore/bindings/v8/WorkerScriptController.cpp b/Source/WebCore/bindings/v8/WorkerScriptController.cpp index d67895129..917849666 100644 --- a/Source/WebCore/bindings/v8/WorkerScriptController.cpp +++ b/Source/WebCore/bindings/v8/WorkerScriptController.cpp @@ -39,7 +39,6 @@ #include "ScriptSourceCode.h" #include "ScriptValue.h" #include "V8DOMMap.h" -#include "V8Proxy.h" #include "V8WorkerContext.h" #include "WorkerContext.h" #include "WorkerContextExecutionProxy.h" diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp index 672c2ab9d..fb00a1ad7 100644 --- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp @@ -37,7 +37,6 @@ #include "ExceptionCode.h" #include "V8ArrayBuffer.h" #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h index 12be5b309..1ce2bebd1 100644 --- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h +++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h @@ -37,7 +37,6 @@ #include "V8ArrayBuffer.h" #include "V8ArrayBufferCustom.h" #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp b/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp index 0fd9506d7..0b024612e 100644 --- a/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp @@ -33,7 +33,6 @@ #include "ExceptionCode.h" #include "V8AudioBuffer.h" #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp index 13d0d2699..56b12dcdf 100644 --- a/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp @@ -35,7 +35,6 @@ #include "V8ArrayBuffer.h" #include "V8AudioBuffer.h" #include "V8Binding.h" -#include "V8Proxy.h" #include <wtf/ArrayBuffer.h> namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp index 6ebcc2d64..1112e5406 100644 --- a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp @@ -37,7 +37,6 @@ #include "V8Binding.h" #include "V8Blob.h" #include "V8File.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WebKitBlobBuilder.h" #include <wtf/RefPtr.h> diff --git a/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp index 007bd9ab7..dd0800fbb 100644 --- a/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp @@ -39,7 +39,6 @@ #include "EventTarget.h" #include "V8Binding.h" -#include "V8Proxy.h" #include <wtf/text/StringBuilder.h> #include <wtf/text/StringConcatenate.h> diff --git a/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp b/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp index a27fd01e7..4060096cb 100644 --- a/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp @@ -45,7 +45,6 @@ #include "V8HTMLImageElement.h" #include "V8HTMLVideoElement.h" #include "V8ImageData.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp index 875f64e68..06635228b 100644 --- a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp @@ -40,7 +40,6 @@ #include "V8Binding.h" #include "V8Node.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp index d8a9b1ff2..99d127d6b 100644 --- a/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp @@ -38,7 +38,6 @@ #include "ScriptCallStackFactory.h" #include "V8Binding.h" #include "V8MemoryInfo.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp b/Source/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp index 8289eb2b2..8238ad6b7 100644 --- a/Source/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8CoordinatesCustom.cpp @@ -28,7 +28,6 @@ #include "Coordinates.h" #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp b/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp index fb790b10a..b97f7d76b 100644 --- a/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp +++ b/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp @@ -36,7 +36,6 @@ #include "ScriptExecutionContext.h" #include "V8Callback.h" -#include "V8Proxy.h" #include "V8SQLError.h" #include "V8SQLTransaction.h" #include <wtf/Assertions.h> diff --git a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp index ae7e9072f..33be7e99d 100644 --- a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp @@ -35,7 +35,6 @@ #include "V8Binding.h" #include "V8Blob.h" #include "V8HTMLFormElement.h" -#include "V8Proxy.h" #include "V8Utilities.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp index b8aa4face..7280d91c5 100644 --- a/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp @@ -61,7 +61,6 @@ #include "V8HiddenPropertyName.h" #include "V8HTMLCollection.h" #include "V8Node.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WindowFeatures.h" #include <wtf/ArrayBuffer.h> @@ -121,7 +120,8 @@ v8::Handle<v8::Value> WindowSetTimeoutImpl(const v8::Arguments& args, bool singl } // params is passed to action, and released in action's destructor - OwnPtr<ScheduledAction> action = adoptPtr(new ScheduledAction(V8Proxy::context(imp->frame()), v8::Handle<v8::Function>::Cast(function), paramCount, params)); + ASSERT(imp->frame()); + OwnPtr<ScheduledAction> action = adoptPtr(new ScheduledAction(imp->frame()->script()->currentWorldContext(), v8::Handle<v8::Function>::Cast(function), paramCount, params)); // FIXME: We should use OwnArrayPtr for params. delete[] params; @@ -131,7 +131,8 @@ v8::Handle<v8::Value> WindowSetTimeoutImpl(const v8::Arguments& args, bool singl RefPtr<ScriptCallStack> callStack(createScriptCallStackForInspector()); if (imp->document() && !imp->document()->contentSecurityPolicy()->allowEval(callStack.release())) return v8Integer(0, args.GetIsolate()); - id = DOMTimer::install(scriptContext, adoptPtr(new ScheduledAction(V8Proxy::context(imp->frame()), functionString)), timeout, singleShot); + ASSERT(imp->frame()); + id = DOMTimer::install(scriptContext, adoptPtr(new ScheduledAction(imp->frame()->script()->currentWorldContext(), functionString)), timeout, singleShot); } // Try to do the idle notification before the timeout expires to get better @@ -154,7 +155,8 @@ v8::Handle<v8::Value> V8DOMWindow::eventAccessorGetter(v8::Local<v8::String> nam if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), frame)) return v8::Undefined(); - v8::Local<v8::Context> context = V8Proxy::context(frame); + ASSERT(frame); + v8::Local<v8::Context> context = frame->script()->currentWorldContext(); if (context.IsEmpty()) return v8::Undefined(); @@ -175,7 +177,8 @@ void V8DOMWindow::eventAccessorSetter(v8::Local<v8::String> name, v8::Local<v8:: if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), frame)) return; - v8::Local<v8::Context> context = V8Proxy::context(frame); + ASSERT(frame); + v8::Local<v8::Context> context = frame->script()->currentWorldContext(); if (context.IsEmpty()) return; @@ -402,7 +405,7 @@ private: inline void DialogHandler::dialogCreated(DOMWindow* dialogFrame) { - m_dialogContext = V8Proxy::context(dialogFrame->frame()); + m_dialogContext = dialogFrame->frame() ? dialogFrame->frame()->script()->currentWorldContext() : v8::Local<v8::Context>(); if (m_dialogContext.IsEmpty()) return; if (m_dialogArguments.IsEmpty()) @@ -621,7 +624,7 @@ v8::Handle<v8::Value> toV8(DOMWindow* window, v8::Isolate* isolate) } // Otherwise, return the global object associated with this frame. - v8::Handle<v8::Context> context = V8Proxy::context(frame); + v8::Handle<v8::Context> context = frame->script()->currentWorldContext(); if (context.IsEmpty()) return v8Undefined(); diff --git a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp index afb207c76..2f12a56b2 100755 --- a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp @@ -29,7 +29,6 @@ #include "V8ArrayBufferViewCustom.h" #include "V8Binding.h" #include "V8DataView.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp index 0cb6eca44..d2a24186b 100644 --- a/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp @@ -37,7 +37,6 @@ #include "DedicatedWorkerContext.h" #include "WorkerContextExecutionProxy.h" #include "V8Binding.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "V8WorkerContextEventListener.h" diff --git a/Source/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp index 610a34bdc..83ff773b7 100644 --- a/Source/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp @@ -30,7 +30,6 @@ #include "DeviceMotionData.h" #include "V8Binding.h" -#include "V8Proxy.h" #include <v8.h> diff --git a/Source/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp index 128302439..c6861bae9 100644 --- a/Source/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp @@ -30,7 +30,6 @@ #include "DeviceOrientationData.h" #include "V8Binding.h" -#include "V8Proxy.h" #include <v8.h> diff --git a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp index ce72b602a..3ef19f255 100644 --- a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp @@ -48,7 +48,6 @@ #include "V8HTMLDocument.h" #include "V8IsolatedContext.h" #include "V8Node.h" -#include "V8Proxy.h" #include "V8Touch.h" #include "V8TouchList.h" #if ENABLE(WEBGL) @@ -76,7 +75,7 @@ v8::Handle<v8::Value> V8Document::evaluateCallback(const v8::Arguments& args) if (V8Node::HasInstance(args[1])) contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])); - RefPtr<XPathNSResolver> resolver = V8DOMWrapper::getXPathNSResolver(args[2]); + RefPtr<XPathNSResolver> resolver = toXPathNSResolver(args[2]); if (!resolver && !args[2]->IsNull() && !args[2]->IsUndefined()) return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate()); diff --git a/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp index 7613a14b1..304aadd52 100644 --- a/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp @@ -30,7 +30,6 @@ #include "Location.h" #include "V8Binding.h" #include "V8Location.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8EntryCustom.cpp b/Source/WebCore/bindings/v8/custom/V8EntryCustom.cpp index a6179c2e5..ced418558 100644 --- a/Source/WebCore/bindings/v8/custom/V8EntryCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8EntryCustom.cpp @@ -39,7 +39,6 @@ #include "V8DirectoryEntry.h" #include "V8Entry.h" #include "V8FileEntry.h" -#include "V8Proxy.h" #include <wtf/RefPtr.h> namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8EntrySyncCustom.cpp b/Source/WebCore/bindings/v8/custom/V8EntrySyncCustom.cpp index c89e48979..c8cc3809a 100644 --- a/Source/WebCore/bindings/v8/custom/V8EntrySyncCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8EntrySyncCustom.cpp @@ -39,7 +39,6 @@ #include "V8DirectoryEntrySync.h" #include "V8EntrySync.h" #include "V8FileEntrySync.h" -#include "V8Proxy.h" #include <wtf/RefPtr.h> namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp b/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp index 9da52c74f..67f1a73e9 100644 --- a/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp @@ -39,7 +39,6 @@ #include "EventNames.h" #include "V8Binding.h" #include "V8Clipboard.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp index 6bcdc71c9..4fdf3adef 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp @@ -37,7 +37,6 @@ #include "V8NamedNodesCollection.h" #include "V8Node.h" #include "V8NodeList.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp index f9e36cb6b..5d268201e 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp @@ -40,7 +40,6 @@ #include "V8Binding.h" #include "V8CanvasRenderingContext2D.h" #include "V8Node.h" -#include "V8Proxy.h" #if ENABLE(WEBGL) #include "InspectorWebGLInstrumentation.h" #include "V8WebGLRenderingContext.h" diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp index eb0fd25d2..45f230e37 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp @@ -38,7 +38,6 @@ #include "V8NamedNodesCollection.h" #include "V8Node.h" #include "V8NodeList.h" -#include "V8Proxy.h" #include "V8RadioNodeList.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp index fb801a761..3f1cbc1ee 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp @@ -44,7 +44,6 @@ #include "V8HTMLCollection.h" #include "V8IsolatedContext.h" #include "V8Node.h" -#include "V8Proxy.h" #include "V8RecursionScope.h" #include <wtf/text/StringBuilder.h> #include <wtf/OwnArrayPtr.h> @@ -142,7 +141,7 @@ v8::Handle<v8::Value> V8HTMLDocument::openCallback(const v8::Arguments& args) if (args.Length() > 2) { if (RefPtr<Frame> frame = htmlDocument->frame()) { // Fetch the global object for the frame. - v8::Local<v8::Context> context = V8Proxy::context(frame.get()); + v8::Local<v8::Context> context = frame->script()->currentWorldContext(); // Bail out if we cannot get the context. if (context.IsEmpty()) return v8::Undefined(); diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp index c650649df..4033629ff 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp @@ -37,7 +37,6 @@ #include "V8NamedNodesCollection.h" #include "V8Node.h" #include "V8NodeList.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp index 649cb35a6..3cec8a7ff 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp @@ -35,7 +35,6 @@ #include "HTMLFrameElement.h" #include "HTMLNames.h" #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp index 0a9693aba..0d993775a 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp @@ -41,7 +41,6 @@ #include "V8Binding.h" #include "V8DOMWindow.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp index 81110b785..05cadeb67 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp @@ -39,7 +39,6 @@ #include "V8Binding.h" #include "V8Document.h" #include "V8HTMLImageElement.h" -#include "V8Proxy.h" #include <wtf/RefPtr.h> namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp index 63825a9b2..72148f026 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp @@ -34,7 +34,6 @@ #include "HTMLInputElement.h" #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLLinkElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLLinkElementCustom.cpp index 5a3c06fc6..97d4e7324 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLLinkElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLLinkElementCustom.cpp @@ -34,7 +34,6 @@ #include "HTMLLinkElement.h" #include "V8Binding.h" #include "V8DOMSettableTokenList.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp index ddb517202..bf195b3a1 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp @@ -30,7 +30,6 @@ #include "V8HTMLMediaElement.h" #include "V8MediaController.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp index 8ee991d67..215f71fcd 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp @@ -40,7 +40,6 @@ #include "V8HTMLOptionElement.h" #include "V8HTMLSelectElementCustom.h" #include "V8Node.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLOutputElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLOutputElementCustom.cpp index 4eeaef639..433da425b 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLOutputElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLOutputElementCustom.cpp @@ -34,7 +34,6 @@ #include "HTMLOutputElement.h" #include "V8Binding.h" #include "V8DOMSettableTokenList.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp index 406632574..a40ca22ca 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp @@ -37,7 +37,6 @@ #include "V8HTMLEmbedElement.h" #include "V8HTMLObjectElement.h" #include "V8NPObject.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp index 71473c56c..ca804a747 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp @@ -42,7 +42,6 @@ #include "V8NamedNodesCollection.h" #include "V8Node.h" #include "V8NodeList.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp index acdb74972..2198f0cac 100644 --- a/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp @@ -38,7 +38,6 @@ #include "V8Binding.h" #include "V8DOMWindow.h" #include "V8HiddenPropertyName.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp index 0fe290b3a..df9d14657 100644 --- a/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp @@ -40,6 +40,7 @@ #include "InspectorValues.h" #include "ScriptDebugServer.h" #include "ScriptValue.h" +#include "V8AbstractEventListener.h" #include "V8Binding.h" #include "V8Database.h" #include "V8Float32Array.h" @@ -52,7 +53,6 @@ #include "V8Int8Array.h" #include "V8NodeList.h" #include "V8Node.h" -#include "V8Proxy.h" #include "V8Storage.h" #include "V8Uint16Array.h" #include "V8Uint32Array.h" diff --git a/Source/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp b/Source/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp index 659fd8b28..95f82261d 100644 --- a/Source/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp @@ -40,7 +40,6 @@ #include "V8Binding.h" #include "V8MouseEvent.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp index 848a91656..bd002f7c5 100644 --- a/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp +++ b/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp @@ -37,7 +37,6 @@ #include "V8DOMWrapper.h" #include "V8Intent.h" #include "V8MessagePort.h" -#include "V8Proxy.h" #include <wtf/ArrayBuffer.h> namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp b/Source/WebCore/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp index 76b5eee31..c17770d4c 100644 --- a/Source/WebCore/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp @@ -34,7 +34,6 @@ #if ENABLE(JAVASCRIPT_DEBUGGER) #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp index df9f38527..361b4a5a5 100644 --- a/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp @@ -42,7 +42,6 @@ #include "V8DOMWindow.h" #include "V8EventListener.h" #include "V8Utilities.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp index ae355694d..2189aa906 100644 --- a/Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp +++ b/Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp @@ -36,7 +36,6 @@ #include "MessageChannel.h" #include "V8Binding.h" #include "V8MessagePort.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WorkerContext.h" #include "WorkerContextExecutionProxy.h" diff --git a/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp b/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp index 922abb153..9200d8ffa 100644 --- a/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp @@ -39,7 +39,6 @@ #include "V8Blob.h" #include "V8DOMWindow.h" #include "V8MessagePort.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp b/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp index 7fe8faae2..544c7bb2a 100644 --- a/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp @@ -36,7 +36,6 @@ #include "SerializedScriptValue.h" #include "V8Binding.h" #include "V8MessagePort.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WorkerContextExecutionProxy.h" diff --git a/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp b/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp index 7f3095d63..ee3e68022 100644 --- a/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8MutationCallbackCustom.cpp @@ -39,7 +39,6 @@ #include "V8Callback.h" #include "V8MutationObserver.h" #include "V8MutationRecord.h" -#include "V8Proxy.h" #include <wtf/Assertions.h> #include <wtf/GetPtr.h> #include <wtf/RefCounted.h> diff --git a/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp b/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp index 7c9e5250a..d1ce128d9 100644 --- a/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp @@ -39,7 +39,6 @@ #include "V8Binding.h" #include "V8DOMWrapper.h" #include "V8MutationCallback.h" -#include "V8Proxy.h" #include "V8Utilities.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp index 6bd2a05b1..667d16810 100644 --- a/Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp @@ -37,7 +37,6 @@ #include "V8Binding.h" #include "V8Element.h" #include "V8Node.h" -#include "V8Proxy.h" #include <wtf/RefPtr.h> diff --git a/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp index 3aba2f967..1cab8f12e 100644 --- a/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp @@ -51,7 +51,6 @@ #include "V8Node.h" #include "V8Notation.h" #include "V8ProcessingInstruction.h" -#include "V8Proxy.h" #include "V8Text.h" #include <wtf/RefPtr.h> diff --git a/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp index 595b484ed..e25c128d1 100644 --- a/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp @@ -35,7 +35,6 @@ #include "NodeList.h" #include "V8Binding.h" #include "V8Node.h" -#include "V8Proxy.h" #include <wtf/RefPtr.h> #include <wtf/StdLibExtras.h> diff --git a/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp index 7626a0b46..3a029d720 100644 --- a/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp @@ -40,7 +40,6 @@ #include "V8Binding.h" #include "V8EventListener.h" #include "V8Notification.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "V8VoidCallback.h" #include "WorkerContext.h" diff --git a/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp index ffc38aa72..7565ffe48 100644 --- a/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp @@ -30,7 +30,6 @@ #include "ExceptionCode.h" #include "V8NotificationPermissionCallback.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp b/Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp index 0abf0c043..842a5381f 100644 --- a/Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp @@ -36,7 +36,6 @@ #include "SerializedScriptValue.h" #include "V8HiddenPropertyName.h" #include "V8History.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp index a7c40419b..70911da12 100644 --- a/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp @@ -35,7 +35,6 @@ #include "SQLResultSetRowList.h" #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp index c6622eb43..1ce14c10d 100644 --- a/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp @@ -40,7 +40,6 @@ #include "V8Binding.h" #include "V8SQLStatementCallback.h" #include "V8SQLStatementErrorCallback.h" -#include "V8Proxy.h" #include <wtf/Vector.h> using namespace WTF; diff --git a/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp index f6e99d206..83cbf3936 100644 --- a/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp @@ -39,7 +39,6 @@ #include "SQLResultSet.h" #include "SQLValue.h" #include "V8Binding.h" -#include "V8Proxy.h" #include "V8SQLResultSet.h" #include <wtf/Vector.h> diff --git a/Source/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp index fa9925bda..797eaabf0 100644 --- a/Source/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp @@ -35,7 +35,6 @@ #include "Frame.h" #include "V8IsolatedContext.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp index 2963980b8..0cf56d842 100644 --- a/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8ScriptProfileCustom.cpp @@ -34,7 +34,6 @@ #include "ScriptProfile.h" #include "V8Binding.h" -#include "V8Proxy.h" #include <v8-profiler.h> diff --git a/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp index 845c92471..4f3cb8237 100644 --- a/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8ScriptProfileNodeCustom.cpp @@ -34,7 +34,6 @@ #include "ScriptProfileNode.h" #include "V8Binding.h" -#include "V8Proxy.h" #include <v8-profiler.h> diff --git a/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp b/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp index 5c4dc02d4..cd9fb1632 100644 --- a/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp @@ -33,7 +33,6 @@ #include "Storage.h" #include "V8Binding.h" -#include "V8Proxy.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8StyleSheetListCustom.cpp b/Source/WebCore/bindings/v8/custom/V8StyleSheetListCustom.cpp index c4e82bb08..904abd4ea 100644 --- a/Source/WebCore/bindings/v8/custom/V8StyleSheetListCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8StyleSheetListCustom.cpp @@ -34,7 +34,6 @@ #include "HTMLStyleElement.h" #include "StyleSheetList.h" #include "V8Binding.h" -#include "V8Proxy.h" #include "V8StyleSheet.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8TrackEventCustom.cpp b/Source/WebCore/bindings/v8/custom/V8TrackEventCustom.cpp index c7c517528..86aaf95ef 100644 --- a/Source/WebCore/bindings/v8/custom/V8TrackEventCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8TrackEventCustom.cpp @@ -36,7 +36,6 @@ #include "TrackBase.h" #include "TrackEvent.h" -#include "V8Proxy.h" #include "V8TextTrack.h" namespace WebCore { diff --git a/Source/WebCore/bindings/v8/custom/V8UndoManagerCustom.cpp b/Source/WebCore/bindings/v8/custom/V8UndoManagerCustom.cpp index c7088bb02..71be095a7 100644 --- a/Source/WebCore/bindings/v8/custom/V8UndoManagerCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8UndoManagerCustom.cpp @@ -31,7 +31,6 @@ #include "DOMTransaction.h" #include "ExceptionCode.h" #include "V8DOMTransaction.h" -#include "V8HiddenPropertyName.h" namespace WebCore { @@ -49,9 +48,7 @@ v8::Handle<v8::Value> V8UndoManager::transactCallback(const v8::Arguments& args) EXCEPTION_BLOCK(bool, merge, MAYBE_MISSING_PARAMETER(args, 1, DefaultIsUndefined)->BooleanValue()); RefPtr<DOMTransaction> transaction = DOMTransaction::create(WorldContextHandle(UseCurrentWorld)); - v8::Handle<v8::Object> transactionWrapper = v8::Handle<v8::Object>::Cast(toV8(transaction.get())); - - transactionWrapper->SetHiddenValue(V8HiddenPropertyName::domTransactionData(), dictionary); + transaction->setData(dictionary); ExceptionCode ec = 0; imp->transact(transaction, merge, ec); @@ -60,6 +57,37 @@ v8::Handle<v8::Value> V8UndoManager::transactCallback(const v8::Arguments& args) return v8Undefined(); } +v8::Handle<v8::Value> V8UndoManager::itemCallback(const v8::Arguments& args) +{ + INC_STATS("DOM.UndoManager.item"); + if (args.Length() < 1) + return throwNotEnoughArgumentsError(args.GetIsolate()); + UndoManager* imp = V8UndoManager::toNative(args.Holder()); + + EXCEPTION_BLOCK(unsigned, index, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))); + + if (index >= imp->length()) + return v8::Null(args.GetIsolate()); + + const UndoManagerEntry& entry = imp->item(index); + + v8::Handle<v8::Array> result = v8::Array::New(entry.size()); + v8::Isolate* isolate = args.GetIsolate(); + for (size_t index = 0; index < entry.size(); ++index) { + UndoStep* step = entry[index].get(); + if (step->isDOMTransaction()) + result->Set(v8Integer(index, isolate), static_cast<DOMTransaction*>(step)->data()); + else { + // FIXME: We shouldn't be creating new object each time we return. + // Object for the same native editing command should always be the same. + v8::Handle<v8::Object> object = v8::Object::New(); + object->Set(v8::String::NewSymbol("label"), v8::String::New("[Editing command]")); + result->Set(v8Integer(index, isolate), object); + } + } + return result; +} + } // namespace WebCore #endif // ENABLE(UNDO_MANAGER) diff --git a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp index 70d780d39..3657cfb1b 100644 --- a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp @@ -50,7 +50,6 @@ #include "V8OESStandardDerivatives.h" #include "V8OESTextureFloat.h" #include "V8OESVertexArrayObject.h" -#include "V8Proxy.h" #include "V8Uint16Array.h" #include "V8Uint32Array.h" #include "V8Uint8Array.h" diff --git a/Source/WebCore/bindings/v8/custom/V8WebKitAnimationCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebKitAnimationCustom.cpp index fcbf49d5a..3ec7d9917 100644 --- a/Source/WebCore/bindings/v8/custom/V8WebKitAnimationCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8WebKitAnimationCustom.cpp @@ -27,7 +27,6 @@ #include "V8WebKitAnimation.h" #include "V8Binding.h" -#include "V8Proxy.h" #include "WebKitAnimation.h" #include <v8.h> diff --git a/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp index de4022a8b..52b04a773 100644 --- a/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp +++ b/Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp @@ -33,7 +33,6 @@ #include "V8Binding.h" #include "V8DOMWrapper.h" -#include "V8Proxy.h" #include "WrapperTypeInfo.h" #include <wtf/MathExtras.h> diff --git a/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp index 3d44b5292..7411dac0d 100644 --- a/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp @@ -41,7 +41,6 @@ #include "V8ArrayBufferView.h" #include "V8Binding.h" #include "V8Blob.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WebSocket.h" #include "WebSocketChannel.h" diff --git a/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp index 57232578c..3a1da47b7 100644 --- a/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp @@ -37,7 +37,6 @@ #include "ExceptionCode.h" #include "ScheduledAction.h" #include "V8Binding.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "V8WorkerContextEventListener.h" #include "WebSocket.h" diff --git a/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp index 945c29ec0..1b4f29c3c 100644 --- a/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp @@ -40,7 +40,6 @@ #include "Frame.h" #include "SerializedScriptValue.h" #include "V8Binding.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WorkerContext.h" #include "WorkerContextExecutionProxy.h" diff --git a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp index 7bd673082..c0e9c5b92 100644 --- a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp +++ b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp @@ -36,7 +36,6 @@ #include "SecurityOrigin.h" #include "V8Binding.h" #include "V8IsolatedContext.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WorkerContext.h" #include "WorkerContextExecutionProxy.h" diff --git a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp index f89e3c97d..dbeb64432 100644 --- a/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp @@ -42,7 +42,6 @@ #include "V8DOMFormData.h" #include "V8Document.h" #include "V8HTMLDocument.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WorkerContext.h" #include "WorkerContextExecutionProxy.h" diff --git a/Source/WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp b/Source/WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp index 3dc9ef570..87228c9a2 100644 --- a/Source/WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8XSLTProcessorCustom.cpp @@ -42,7 +42,6 @@ #include "V8Document.h" #include "V8DocumentFragment.h" #include "V8Node.h" -#include "V8Proxy.h" #include "XSLTProcessor.h" #include <wtf/RefPtr.h> diff --git a/Source/WebCore/bridge/qt/qt_instance.cpp b/Source/WebCore/bridge/qt/qt_instance.cpp index d36cf1cdb..b9a34ac30 100644 --- a/Source/WebCore/bridge/qt/qt_instance.cpp +++ b/Source/WebCore/bridge/qt/qt_instance.cpp @@ -20,6 +20,7 @@ #include "config.h" #include "qt_instance.h" +#include "APICast.h" #include "Error.h" #include "JSDOMBinding.h" #include "JSDOMWindowBase.h" @@ -360,7 +361,6 @@ JSValue QtInstance::valueOf(ExecState* exec) const } // In qt_runtime.cpp -JSValue convertQVariantToValue(ExecState*, PassRefPtr<RootObject> root, const QVariant& variant); QVariant convertValueToQVariant(ExecState*, JSValue, QMetaType::Type hint, int *distance); QByteArray QtField::name() const @@ -394,7 +394,11 @@ JSValue QtField::valueFromInstance(ExecState* exec, const Instance* inst) const else if (m_type == DynamicProperty) val = obj->property(m_dynamicProperty); #endif - return convertQVariantToValue(exec, inst->rootObject(), val); + JSValueRef exception = 0; + JSValueRef jsValue = convertQVariantToValue(toRef(exec), inst->rootObject(), val, &exception); + if (exception) + return throwError(exec, toJS(exec, exception)); + return toJS(exec, jsValue); } QString msg = QString(QLatin1String("cannot access member `%1' of deleted QObject")).arg(QLatin1String(name())); return throwError(exec, createError(exec, msg.toLatin1().constData())); diff --git a/Source/WebCore/bridge/qt/qt_runtime.cpp b/Source/WebCore/bridge/qt/qt_runtime.cpp index 50f6db645..842f95d65 100644 --- a/Source/WebCore/bridge/qt/qt_runtime.cpp +++ b/Source/WebCore/bridge/qt/qt_runtime.cpp @@ -104,7 +104,7 @@ typedef enum { Object, Null, RTArray, - JSUint8ClampedArray + RTUint8ClampedArray } JSRealType; #if defined(QTWK_RUNTIME_CONVERSION_DEBUG) || defined(QTWK_RUNTIME_MATCH_DEBUG) @@ -162,7 +162,7 @@ static JSRealType valueRealType(ExecState* exec, JSValue val) else if (val.isNull()) return Null; else if (isJSUint8ClampedArray(val)) - return JSUint8ClampedArray; + return RTUint8ClampedArray; else if (val.isObject()) { JSObject *object = val.toObject(exec); if (object->inherits(&RuntimeArray::s_info)) // RuntimeArray 'inherits' from Array, but not in C++ @@ -264,7 +264,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type case QObj: hint = QMetaType::QObjectStar; break; - case JSUint8ClampedArray: + case RTUint8ClampedArray: hint = QMetaType::QByteArray; break; case Array: @@ -484,7 +484,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type } case QMetaType::QByteArray: { - if (type == JSUint8ClampedArray) { + if (type == RTUint8ClampedArray) { WTF::Uint8ClampedArray* arr = toUint8ClampedArray(value); ret = QVariant(QByteArray(reinterpret_cast<const char*>(arr->data()), arr->length())); dist = 0; @@ -775,7 +775,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type return convertValueToQVariant(exec, value, hint, distance, &visitedObjects, recursionLimit); } -JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& variant) +JSValueRef convertQVariantToValue(JSContextRef context, PassRefPtr<RootObject> root, const QVariant& variant, JSValueRef *exception) { // Variants with QObject * can be isNull but not a null pointer // An empty QString variant is also null @@ -786,13 +786,11 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con !QMetaType::typeFlags(type).testFlag(QMetaType::PointerToQObject) && type != QMetaType::VoidStar && type != QMetaType::QString) { - return jsNull(); + return JSValueMakeNull(context); } - JSLockHolder lock(exec); - if (type == QMetaType::Bool) - return jsBoolean(variant.toBool()); + return JSValueMakeBoolean(context, variant.toBool()); if (type == QMetaType::Int || type == QMetaType::UInt || @@ -804,7 +802,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con type == QMetaType::UShort || type == QMetaType::Float || type == QMetaType::Double) - return jsNumber(variant.toDouble()); + return JSValueMakeNumber(context, variant.toDouble()); if (type == QMetaType::QDateTime || type == QMetaType::QDate || @@ -824,59 +822,62 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con } // Dates specified this way are in local time (we convert DateTimes above) - GregorianDateTime dt; - dt.setYear(date.year()); - dt.setMonth(date.month() - 1); - dt.setMonthDay(date.day()); - dt.setHour(time.hour()); - dt.setMinute(time.minute()); - dt.setSecond(time.second()); - dt.setIsDST(-1); - double ms = gregorianDateTimeToMS(exec, dt, time.msec(), /*inputIsUTC*/ false); - - return DateInstance::create(exec, exec->lexicalGlobalObject()->dateStructure(), trunc(ms)); + const JSValueRef arguments[] = { + JSValueMakeNumber(context, date.year()), + JSValueMakeNumber(context, date.month() - 1), + JSValueMakeNumber(context, date.day()), + JSValueMakeNumber(context, time.hour()), + JSValueMakeNumber(context, time.minute()), + JSValueMakeNumber(context, time.second()), + JSValueMakeNumber(context, time.msec()) + }; + return JSObjectMakeDate(context, 7, arguments, exception); } if (type == QMetaType::QByteArray) { QByteArray qtByteArray = variant.value<QByteArray>(); WTF::RefPtr<WTF::Uint8ClampedArray> wtfByteArray = WTF::Uint8ClampedArray::createUninitialized(qtByteArray.length()); memcpy(wtfByteArray->data(), qtByteArray.constData(), qtByteArray.length()); - return toJS(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), wtfByteArray.get()); + ExecState* exec = toJS(context); + return toRef(exec, toJS(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), wtfByteArray.get())); } if (QMetaType::typeFlags(type).testFlag(QMetaType::PointerToQObject)) { QObject* obj = variant.value<QObject*>(); if (!obj) - return jsNull(); - return QtInstance::getQtInstance(obj, root, QtInstance::QtOwnership)->createRuntimeObject(exec); + return JSValueMakeNull(context); + ExecState* exec = toJS(context); + return toRef(exec, QtInstance::getQtInstance(obj, root, QtInstance::QtOwnership)->createRuntimeObject(exec)); } - if (QtPixmapInstance::canHandle(static_cast<QMetaType::Type>(variant.type()))) - return QtPixmapInstance::createPixmapRuntimeObject(exec, root, variant); + if (QtPixmapInstance::canHandle(static_cast<QMetaType::Type>(variant.type()))) { + ExecState* exec = toJS(context); + return toRef(exec, QtPixmapInstance::createPixmapRuntimeObject(exec, root, variant)); + } if (customRuntimeConversions()->contains(type)) { if (!root->globalObject()->inherits(&JSDOMWindow::s_info)) - return jsUndefined(); + return JSValueMakeUndefined(context); Document* document = (static_cast<JSDOMWindow*>(root->globalObject()))->impl()->document(); if (!document) - return jsUndefined(); - return customRuntimeConversions()->value(type).toJSValueFunc(exec, toJSDOMGlobalObject(document, exec), variant); + return JSValueMakeUndefined(context); + ExecState* exec = toJS(context); + return toRef(exec, customRuntimeConversions()->value(type).toJSValueFunc(exec, toJSDOMGlobalObject(document, exec), variant)); } if (type == QMetaType::QVariantMap) { // create a new object, and stuff properties into it - JSObject* ret = constructEmptyObject(exec); + JSObjectRef ret = JSObjectMake(context, 0, 0); QVariantMap map = variant.value<QVariantMap>(); QVariantMap::const_iterator i = map.constBegin(); while (i != map.constEnd()) { QString s = i.key(); - JSValue val = convertQVariantToValue(exec, root.get(), i.value()); - if (val) { - PutPropertySlot slot; - ret->methodTable()->put(ret, exec, Identifier(&exec->globalData(), reinterpret_cast_ptr<const UChar *>(s.constData()), s.length()), val, slot); - // ### error case? - } + JSStringRef propertyName = JSStringCreateWithCharacters(reinterpret_cast<const JSChar*>(s.constData()), s.length()); + JSValueRef propertyValue = convertQVariantToValue(context, root.get(), i.value(), /*ignored exception*/0); + if (propertyValue) + JSObjectSetProperty(context, ret, propertyName, propertyValue, kJSPropertyAttributeNone, /*ignored exception*/0); + JSStringRelease(propertyName); ++i; } @@ -885,31 +886,58 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, con // List types if (type == QMetaType::QVariantList) { + // ### TODO: Could use special array class that lazily converts. + // See https://bugs.webkit.org/show_bug.cgi?id=94691 QVariantList vl = variant.toList(); - qConvDebug() << "got a " << vl.count() << " length list:" << vl; - return RuntimeArray::create(exec, new QtArray<QVariant>(vl, QMetaType::Void, root)); + JSObjectRef array = JSObjectMakeArray(context, 0, 0, exception); + if (exception && *exception) + return array; + for (int i = 0; i < vl.count(); ++i) { + JSValueRef property = convertQVariantToValue(context, root.get(), vl.at(i), /*ignored exception*/0); + if (property) + JSObjectSetPropertyAtIndex(context, array, i, property, /*ignored exception*/0); + } + return array; } else if (type == QMetaType::QStringList) { QStringList sl = variant.value<QStringList>(); - return RuntimeArray::create(exec, new QtArray<QString>(sl, QMetaType::QString, root)); - } else if (type == (QMetaType::Type) qMetaTypeId<QObjectList>()) { - QObjectList ol= variant.value<QObjectList>(); - return RuntimeArray::create(exec, new QtArray<QObject*>(ol, QMetaType::QObjectStar, root)); - } else if (type == (QMetaType::Type)qMetaTypeId<QList<int> >()) { - QList<int> il= variant.value<QList<int> >(); - return RuntimeArray::create(exec, new QtArray<int>(il, QMetaType::Int, root)); + JSObjectRef array = JSObjectMakeArray(context, 0, 0, exception); + for (int i = 0; i < sl.count(); ++i) { + const QString& s = sl.at(i); + JSStringRef jsString = JSStringCreateWithCharacters(reinterpret_cast<const JSChar*>(s.constData()), s.length()); + JSObjectSetPropertyAtIndex(context, array, i, JSValueMakeString(context, jsString), /*ignored exception*/0); + JSStringRelease(jsString); + } + return array; + } else if (type == static_cast<QMetaType::Type>(qMetaTypeId<QObjectList>())) { + QObjectList ol = variant.value<QObjectList>(); + JSObjectRef array = JSObjectMakeArray(context, 0, 0, exception); + ExecState* exec = toJS(context); + for (int i = 0; i < ol.count(); ++i) { + JSValueRef jsObject = toRef(exec, QtInstance::getQtInstance(ol.at(i), root, QtInstance::QtOwnership)->createRuntimeObject(exec)); + JSObjectSetPropertyAtIndex(context, array, i, jsObject, /*ignored exception*/0); + } + return array; + } else if (type == static_cast<QMetaType::Type>(qMetaTypeId<QList<int> >())) { + QList<int> il = variant.value<QList<int> >(); + JSObjectRef array = JSObjectMakeArray(context, 0, 0, exception); + for (int i = 0; i < il.count(); ++i) + JSObjectSetPropertyAtIndex(context, array, i, JSValueMakeNumber(context, il.at(i)), /*ignored exception*/0); + return array; } if (type == (QMetaType::Type)qMetaTypeId<QVariant>()) { QVariant real = variant.value<QVariant>(); qConvDebug() << "real variant is:" << real; - return convertQVariantToValue(exec, root, real); + return convertQVariantToValue(context, root.get(), real, exception); } qConvDebug() << "fallback path for" << variant << variant.userType(); QString string = variant.toString(); - UString ustring((UChar*)string.utf16(), string.length()); - return jsString(exec, ustring); + JSStringRef jsstring = JSStringCreateWithCharacters(reinterpret_cast<const JSChar*>(string.constData()), string.length()); + JSValueRef value = JSValueMakeString(context, jsstring); + JSStringRelease(jsstring); + return value; } // Type conversion metadata (from QtScript originally) @@ -1333,7 +1361,7 @@ JSValueRef QtRuntimeMethod::call(JSContextRef context, JSObjectRef function, JSO return JSValueMakeUndefined(context); if (vargs.size() > 0 && vargs[0].isValid()) - return toRef(toJS(context), convertQVariantToValue(toJS(context), d->m_instance->rootObject(), vargs[0])); + return convertQVariantToValue(context, d->m_instance->rootObject(), vargs[0], exception); return JSValueMakeUndefined(context); } @@ -1649,7 +1677,7 @@ void QtConnectionObject::execute(void** argv) for (int i = 0; i < argc; i++) { int argType = method.parameterType(i); - args[i] = ::toRef(exec, convertQVariantToValue(exec, m_rootObject, QVariant(argType, argv[i+1]))); + args[i] = convertQVariantToValue(toRef(exec), m_rootObject, QVariant(argType, argv[i+1]), ignoredException); } JSObjectCallAsFunction(m_context, m_receiverFunction, m_receiver, argc, args.data(), 0); @@ -1701,7 +1729,7 @@ template <typename T> JSValue QtArray<T>::valueAt(ExecState *exec, unsigned int { if (index < m_length) { T val = m_list.at(index); - return convertQVariantToValue(exec, rootObject(), QVariant::fromValue(val)); + return convertQVariantToValue(toRef(exec), rootObject(), QVariant::fromValue(val)); } return jsUndefined(); diff --git a/Source/WebCore/bridge/qt/qt_runtime.h b/Source/WebCore/bridge/qt/qt_runtime.h index a91e4f513..ed0f4cfe2 100644 --- a/Source/WebCore/bridge/qt/qt_runtime.h +++ b/Source/WebCore/bridge/qt/qt_runtime.h @@ -157,7 +157,7 @@ typedef JSValue (*ConvertToJSValueFunction)(ExecState* exec, WebCore::JSDOMGloba void registerCustomType(int qtMetaTypeId, ConvertToVariantFunction, ConvertToJSValueFunction); QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance); -JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& variant); +JSValueRef convertQVariantToValue(JSContextRef, PassRefPtr<RootObject>, const QVariant&, JSValueRef* exception); void setException(JSContextRef, JSValueRef* exception, const QString& text); diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp index 902536762..fe10eb0f6 100644 --- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -53,6 +53,7 @@ #include "RenderStyle.h" #include "RenderView.h" #include "ShadowValue.h" +#include "StyleInheritedData.h" #include "StylePropertySet.h" #include "StylePropertyShorthand.h" #include "WebKitCSSTransformValue.h" diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp index ec0f1c204..18c4c0352 100644 --- a/Source/WebCore/css/CSSParser.cpp +++ b/Source/WebCore/css/CSSParser.cpp @@ -596,11 +596,14 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int if (valueID == CSSValueAuto || valueID == CSSValueNone || (valueID >= CSSValueInset && valueID <= CSSValueDouble)) return true; break; - case CSSPropertyOverflowX: - case CSSPropertyOverflowY: // visible | hidden | scroll | auto | marquee | overlay | inherit + case CSSPropertyOverflowX: // visible | hidden | scroll | auto | marquee | overlay | inherit if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitMarquee) return true; break; + case CSSPropertyOverflowY: // visible | hidden | scroll | auto | marquee | overlay | inherit | -webkit-paged-x | -webkit-paged-y + if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitMarquee || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY) + return true; + break; case CSSPropertyPageBreakAfter: // auto | always | avoid | left | right | inherit case CSSPropertyPageBreakBefore: case CSSPropertyWebkitColumnBreakAfter: @@ -1758,10 +1761,20 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) */ case CSSPropertyOverflow: { ShorthandScope scope(this, propId); - if (num != 1 || !parseValue(CSSPropertyOverflowX, important)) + if (num != 1 || !parseValue(CSSPropertyOverflowY, important)) return false; - CSSValue* value = m_parsedProperties->last().value(); - addProperty(CSSPropertyOverflowY, value, important); + + RefPtr<CSSValue> overflowXValue; + + // FIXME: -webkit-paged-x or -webkit-paged-y only apply to overflow-y. If this value has been + // set using the shorthand, then for now overflow-x will default to auto, but once we implement + // pagination controls, it should default to hidden. If the overflow-y value is anything but + // paged-x or paged-y, then overflow-x and overflow-y should have the same value. + if (id == CSSValueWebkitPagedX || id == CSSValueWebkitPagedY) + overflowXValue = cssValuePool().createIdentifierValue(CSSValueAuto); + else + overflowXValue = m_parsedProperties->last().value(); + addProperty(CSSPropertyOverflowX, overflowXValue.release(), important); return true; } diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp index 7d1ca2974..c433f2094 100644 --- a/Source/WebCore/css/CSSPrimitiveValue.cpp +++ b/Source/WebCore/css/CSSPrimitiveValue.cpp @@ -31,6 +31,7 @@ #include "Color.h" #include "Counter.h" #include "ExceptionCode.h" +#include "Font.h" #include "MemoryInstrumentation.h" #include "Node.h" #include "Pair.h" diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h index 14cef2595..c39a9c021 100644 --- a/Source/WebCore/css/CSSPrimitiveValueMappings.h +++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h @@ -1960,6 +1960,12 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflow e) case OOVERLAY: m_value.ident = CSSValueOverlay; break; + case OPAGEDX: + m_value.ident = CSSValueWebkitPagedX; + break; + case OPAGEDY: + m_value.ident = CSSValueWebkitPagedY; + break; } } @@ -1978,6 +1984,10 @@ template<> inline CSSPrimitiveValue::operator EOverflow() const return OMARQUEE; case CSSValueOverlay: return OOVERLAY; + case CSSValueWebkitPagedX: + return OPAGEDX; + case CSSValueWebkitPagedY: + return OPAGEDY; } ASSERT_NOT_REACHED(); diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in index 853c77fc9..8205cff46 100644 --- a/Source/WebCore/css/CSSValueKeywords.in +++ b/Source/WebCore/css/CSSValueKeywords.in @@ -964,3 +964,7 @@ from-image snap #endif +// overflow +-webkit-paged-x +-webkit-paged-y + diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp index ea5950e54..a7397aed3 100644 --- a/Source/WebCore/css/StyleResolver.cpp +++ b/Source/WebCore/css/StyleResolver.cpp @@ -96,6 +96,7 @@ #include "RenderScrollbarTheme.h" #include "RenderStyleConstants.h" #include "RenderTheme.h" +#include "RenderView.h" #include "RotateTransformOperation.h" #include "SVGDocumentExtensions.h" #include "SVGFontFaceElement.h" @@ -885,8 +886,7 @@ void StyleResolver::collectMatchingRules(RuleSet* rules, int& firstRuleIndex, in // then sort the buffer. if (m_element->hasID()) collectMatchingRulesForList(rules->idRules(m_element->idForStyleResolution().impl()), firstRuleIndex, lastRuleIndex, options); - if (m_element->hasClass()) { - ASSERT(m_styledElement); + if (m_styledElement && m_styledElement->hasClass()) { for (size_t i = 0; i < m_styledElement->classNames().size(); ++i) collectMatchingRulesForList(rules->classRules(m_styledElement->classNames()[i].impl()), firstRuleIndex, lastRuleIndex, options); } @@ -1600,6 +1600,46 @@ void StyleResolver::matchUARules(MatchResult& result) } } +static void setStylesForPaginationMode(Pagination::Mode paginationMode, RenderStyle* style) +{ + if (paginationMode == Pagination::Unpaginated) + return; + + switch (paginationMode) { + case Pagination::LeftToRightPaginated: + style->setColumnAxis(HorizontalColumnAxis); + if (style->isHorizontalWritingMode()) + style->setColumnProgression(style->isLeftToRightDirection() ? NormalColumnProgression : ReverseColumnProgression); + else + style->setColumnProgression(style->isFlippedBlocksWritingMode() ? ReverseColumnProgression : NormalColumnProgression); + break; + case Pagination::RightToLeftPaginated: + style->setColumnAxis(HorizontalColumnAxis); + if (style->isHorizontalWritingMode()) + style->setColumnProgression(style->isLeftToRightDirection() ? ReverseColumnProgression : NormalColumnProgression); + else + style->setColumnProgression(style->isFlippedBlocksWritingMode() ? NormalColumnProgression : ReverseColumnProgression); + break; + case Pagination::TopToBottomPaginated: + style->setColumnAxis(VerticalColumnAxis); + if (style->isHorizontalWritingMode()) + style->setColumnProgression(style->isFlippedBlocksWritingMode() ? ReverseColumnProgression : NormalColumnProgression); + else + style->setColumnProgression(style->isLeftToRightDirection() ? NormalColumnProgression : ReverseColumnProgression); + break; + case Pagination::BottomToTopPaginated: + style->setColumnAxis(VerticalColumnAxis); + if (style->isHorizontalWritingMode()) + style->setColumnProgression(style->isFlippedBlocksWritingMode() ? NormalColumnProgression : ReverseColumnProgression); + else + style->setColumnProgression(style->isLeftToRightDirection() ? ReverseColumnProgression : NormalColumnProgression); + break; + case Pagination::Unpaginated: + ASSERT_NOT_REACHED(); + break; + } +} + PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSFontSelector* fontSelector) { Frame* frame = document->frame(); @@ -1645,44 +1685,15 @@ PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSF } if (frame) { - if (Page* page = frame->page()) { - const Page::Pagination& pagination = page->pagination(); - if (pagination.mode != Page::Pagination::Unpaginated) { - switch (pagination.mode) { - case Page::Pagination::LeftToRightPaginated: - documentStyle->setColumnAxis(HorizontalColumnAxis); - if (documentStyle->isHorizontalWritingMode()) - documentStyle->setColumnProgression(documentStyle->isLeftToRightDirection() ? NormalColumnProgression : ReverseColumnProgression); - else - documentStyle->setColumnProgression(documentStyle->isFlippedBlocksWritingMode() ? ReverseColumnProgression : NormalColumnProgression); - break; - case Page::Pagination::RightToLeftPaginated: - documentStyle->setColumnAxis(HorizontalColumnAxis); - if (documentStyle->isHorizontalWritingMode()) - documentStyle->setColumnProgression(documentStyle->isLeftToRightDirection() ? ReverseColumnProgression : NormalColumnProgression); - else - documentStyle->setColumnProgression(documentStyle->isFlippedBlocksWritingMode() ? NormalColumnProgression : ReverseColumnProgression); - break; - case Page::Pagination::TopToBottomPaginated: - documentStyle->setColumnAxis(VerticalColumnAxis); - if (documentStyle->isHorizontalWritingMode()) - documentStyle->setColumnProgression(documentStyle->isFlippedBlocksWritingMode() ? ReverseColumnProgression : NormalColumnProgression); - else - documentStyle->setColumnProgression(documentStyle->isLeftToRightDirection() ? NormalColumnProgression : ReverseColumnProgression); - break; - case Page::Pagination::BottomToTopPaginated: - documentStyle->setColumnAxis(VerticalColumnAxis); - if (documentStyle->isHorizontalWritingMode()) - documentStyle->setColumnProgression(documentStyle->isFlippedBlocksWritingMode() ? NormalColumnProgression : ReverseColumnProgression); - else - documentStyle->setColumnProgression(documentStyle->isLeftToRightDirection() ? ReverseColumnProgression : NormalColumnProgression); - break; - case Page::Pagination::Unpaginated: - ASSERT_NOT_REACHED(); - break; - } - + if (FrameView* frameView = frame->view()) { + const Pagination& pagination = frameView->pagination(); + if (pagination.mode != Pagination::Unpaginated) { + setStylesForPaginationMode(pagination.mode, documentStyle.get()); documentStyle->setColumnGap(pagination.gap); + if (RenderView* view = document->renderView()) { + if (view->hasColumns()) + view->updateColumnInfoFromStyle(documentStyle.get()); + } } } } @@ -2206,11 +2217,20 @@ void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty style->setOverflowY(OMARQUEE); else if (style->overflowY() == OMARQUEE && style->overflowX() != OMARQUEE) style->setOverflowX(OMARQUEE); - else if (style->overflowX() == OVISIBLE && style->overflowY() != OVISIBLE) + else if (style->overflowX() == OVISIBLE && style->overflowY() != OVISIBLE) { + // FIXME: Once we implement pagination controls, overflow-x should default to hidden + // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, we'll let it + // default to auto so we can at least scroll through the pages. style->setOverflowX(OAUTO); - else if (style->overflowY() == OVISIBLE && style->overflowX() != OVISIBLE) + } else if (style->overflowY() == OVISIBLE && style->overflowX() != OVISIBLE) style->setOverflowY(OAUTO); + // Call setStylesForPaginationMode() if a pagination mode is set for any non-root elements. If these + // styles are specified on a root element, then they will be incorporated in + // StyleResolver::styleForDocument(). + if ((style->overflowY() == OPAGEDX || style->overflowY() == OPAGEDY) && !(e->hasTagName(htmlTag) || e->hasTagName(bodyTag))) + setStylesForPaginationMode(WebCore::paginationModeForRenderStyle(style), style); + // Table rows, sections and the table itself will support overflow:hidden and will ignore scroll/auto. // FIXME: Eventually table sections will support auto and scroll. if (style->display() == TABLE || style->display() == INLINE_TABLE diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h index 4e9fe9148..712085ba2 100644 --- a/Source/WebCore/css/StyleResolver.h +++ b/Source/WebCore/css/StyleResolver.h @@ -29,6 +29,7 @@ #include "MediaQueryExp.h" #include "RenderStyle.h" #include "SelectorChecker.h" +#include "StyleInheritedData.h" #include <wtf/HashMap.h> #include <wtf/HashSet.h> #include <wtf/RefPtr.h> diff --git a/Source/WebCore/css/mediaControls.css b/Source/WebCore/css/mediaControls.css index 9d8221e47..81b0e16b9 100644 --- a/Source/WebCore/css/mediaControls.css +++ b/Source/WebCore/css/mediaControls.css @@ -253,7 +253,4 @@ video::-webkit-media-text-track-future-nodes { video::-webkit-media-text-track-display { position: absolute; color: rgba(255, 255, 255, 1); - - top: 100%; - -webkit-transform: translate(0%, -100%); } diff --git a/Source/WebCore/dom/CharacterData.cpp b/Source/WebCore/dom/CharacterData.cpp index b613ab97c..8c930d8f2 100644 --- a/Source/WebCore/dom/CharacterData.cpp +++ b/Source/WebCore/dom/CharacterData.cpp @@ -32,6 +32,7 @@ #include "MutationRecord.h" #include "NodeRenderingContext.h" #include "RenderText.h" +#include "StyleInheritedData.h" #include "TextBreakIterator.h" #include "UndoManager.h" diff --git a/Source/WebCore/dom/ClassNodeList.cpp b/Source/WebCore/dom/ClassNodeList.cpp index c0ce6d2e0..a4d88ab35 100644 --- a/Source/WebCore/dom/ClassNodeList.cpp +++ b/Source/WebCore/dom/ClassNodeList.cpp @@ -54,8 +54,11 @@ bool ClassNodeList::nodeMatches(Element* testNode) const return false; if (!m_classNames.size()) return false; - ASSERT(testNode->isStyledElement()); - return static_cast<StyledElement*>(testNode)->classNames().containsAll(m_classNames); + // FIXME: DOM4 allows getElementsByClassName to return non StyledElement. + // https://bugs.webkit.org/show_bug.cgi?id=94718 + if (!testNode->isStyledElement()) + return false; + return testNode->classNames().containsAll(m_classNames); } } // namespace WebCore diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp index 743e12278..04bc20b0b 100644 --- a/Source/WebCore/dom/Element.cpp +++ b/Source/WebCore/dom/Element.cpp @@ -696,6 +696,8 @@ inline void Element::setAttributeInternal(size_t index, const QualifiedName& nam void Element::attributeChanged(const Attribute& attribute) { + parseAttribute(attribute); + document()->incDOMTreeVersion(); if (isIdAttributeName(attribute.name())) { @@ -747,6 +749,34 @@ void Element::attributeChanged(const Attribute& attribute) document()->axObjectCache()->postNotification(this, AXObjectCache::AXInvalidStatusChanged, true); } +void Element::parseAttribute(const Attribute& attribute) +{ + if (attribute.name() == classAttr) + classAttributeChanged(attribute.value()); +} + +void Element::classAttributeChanged(const AtomicString& newClassString) +{ + const UChar* characters = newClassString.characters(); + unsigned length = newClassString.length(); + unsigned i; + for (i = 0; i < length; ++i) { + if (isNotHTMLSpace(characters[i])) + break; + } + bool hasClass = i < length; + if (hasClass) { + const bool shouldFoldCase = document()->inQuirksMode(); + ensureAttributeData()->setClass(newClassString, shouldFoldCase); + } else if (attributeData()) + mutableAttributeData()->clearClass(); + + if (DOMTokenList* classList = optionalClassList()) + static_cast<ClassList*>(classList)->reset(newClassString); + + setNeedsStyleRecalc(); +} + // Returns true is the given attribute is an event handler. // We consider an event handler any attribute that begins with "on". // It is a simple solution that has the advantage of not requiring any diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h index 97a16f636..f79227e9e 100644 --- a/Source/WebCore/dom/Element.h +++ b/Source/WebCore/dom/Element.h @@ -246,6 +246,7 @@ public: // This method is called whenever an attribute is added, changed or removed. virtual void attributeChanged(const Attribute&); + virtual void parseAttribute(const Attribute&); // Only called by the parser immediately after element construction. void parserSetAttributes(const Vector<Attribute>&, FragmentScriptingPermission); @@ -428,6 +429,7 @@ public: bool hasID() const; bool hasClass() const; + const SpaceSplitString& classNames() const; IntSize savedLayerScrollOffset() const; void setSavedLayerScrollOffset(const IntSize&); @@ -461,6 +463,11 @@ protected: PassRefPtr<HTMLCollection> ensureCachedHTMLCollection(CollectionType); HTMLCollection* cachedHTMLCollection(CollectionType); + // classAttributeChanged() exists to share code between + // parseAttribute (called via setAttribute()) and + // svgAttributeChanged (called when element.className.baseValue is set) + void classAttributeChanged(const AtomicString& newClassString); + private: void updateInvalidAttributes() const; @@ -687,6 +694,13 @@ inline void Element::setIdAttribute(const AtomicString& value) setAttribute(document()->idAttributeName(), value); } +inline const SpaceSplitString& Element::classNames() const +{ + ASSERT(hasClass()); + ASSERT(attributeData()); + return attributeData()->classNames(); +} + inline size_t Element::attributeCount() const { ASSERT(attributeData()); diff --git a/Source/WebCore/dom/ElementRareData.h b/Source/WebCore/dom/ElementRareData.h index 07394ebd1..b75a0bda9 100644 --- a/Source/WebCore/dom/ElementRareData.h +++ b/Source/WebCore/dom/ElementRareData.h @@ -29,6 +29,7 @@ #include "HTMLCollection.h" #include "NamedNodeMap.h" #include "NodeRareData.h" +#include "StyleInheritedData.h" #include <wtf/OwnPtr.h> namespace WebCore { diff --git a/Source/WebCore/dom/MessagePort.cpp b/Source/WebCore/dom/MessagePort.cpp index ab4dcdc0d..50d4b16e3 100644 --- a/Source/WebCore/dom/MessagePort.cpp +++ b/Source/WebCore/dom/MessagePort.cpp @@ -83,7 +83,7 @@ void MessagePort::postMessage(PassRefPtr<SerializedScriptValue> message, const M for (unsigned int i = 0; i < ports->size(); ++i) { MessagePort* dataPort = (*ports)[i].get(); if (dataPort == this || m_entangledChannel->isConnectedTo(dataPort)) { - ec = DATA_CLONE_ERR; + ec = INVALID_STATE_ERR; return; } } diff --git a/Source/WebCore/dom/NodeRenderingContext.cpp b/Source/WebCore/dom/NodeRenderingContext.cpp index c8e23502d..21f1c3f89 100644 --- a/Source/WebCore/dom/NodeRenderingContext.cpp +++ b/Source/WebCore/dom/NodeRenderingContext.cpp @@ -40,6 +40,7 @@ #include "RenderObject.h" #include "RenderView.h" #include "ShadowRoot.h" +#include "StyleInheritedData.h" #if ENABLE(SVG) #include "SVGNames.h" diff --git a/Source/WebCore/dom/StyledElement.cpp b/Source/WebCore/dom/StyledElement.cpp index c5616b082..e75cd531d 100644 --- a/Source/WebCore/dom/StyledElement.cpp +++ b/Source/WebCore/dom/StyledElement.cpp @@ -147,8 +147,6 @@ CSSStyleDeclaration* StyledElement::style() void StyledElement::attributeChanged(const Attribute& attribute) { - parseAttribute(attribute); - if (isPresentationAttribute(attribute.name())) { setAttributeStyleDirty(); setNeedsStyleRecalc(InlineStyleChange); @@ -157,28 +155,6 @@ void StyledElement::attributeChanged(const Attribute& attribute) Element::attributeChanged(attribute); } -void StyledElement::classAttributeChanged(const AtomicString& newClassString) -{ - const UChar* characters = newClassString.characters(); - unsigned length = newClassString.length(); - unsigned i; - for (i = 0; i < length; ++i) { - if (isNotHTMLSpace(characters[i])) - break; - } - bool hasClass = i < length; - if (hasClass) { - const bool shouldFoldCase = document()->inQuirksMode(); - ensureAttributeData()->setClass(newClassString, shouldFoldCase); - } else if (attributeData()) - mutableAttributeData()->clearClass(); - - if (DOMTokenList* classList = optionalClassList()) - static_cast<ClassList*>(classList)->reset(newClassString); - - setNeedsStyleRecalc(); -} - void StyledElement::styleAttributeChanged(const AtomicString& newStyleString, ShouldReparseStyleAttribute shouldReparse) { if (shouldReparse) { @@ -197,10 +173,10 @@ void StyledElement::styleAttributeChanged(const AtomicString& newStyleString, Sh void StyledElement::parseAttribute(const Attribute& attribute) { - if (attribute.name() == classAttr) - classAttributeChanged(attribute.value()); - else if (attribute.name() == styleAttr) + if (attribute.name() == styleAttr) styleAttributeChanged(attribute.value()); + else + Element::parseAttribute(attribute); } void StyledElement::inlineStyleChanged() diff --git a/Source/WebCore/dom/StyledElement.h b/Source/WebCore/dom/StyledElement.h index a080dc136..66418ddfd 100644 --- a/Source/WebCore/dom/StyledElement.h +++ b/Source/WebCore/dom/StyledElement.h @@ -53,8 +53,6 @@ public: const StylePropertySet* attributeStyle(); - const SpaceSplitString& classNames() const; - virtual void collectStyleForAttribute(const Attribute&, StylePropertySet*) { } // May be called by ElementAttributeData::cloneDataFrom(). @@ -65,7 +63,7 @@ protected: StyledElement(const QualifiedName&, Document*, ConstructionType); virtual void attributeChanged(const Attribute&) OVERRIDE; - virtual void parseAttribute(const Attribute&); + virtual void parseAttribute(const Attribute&) OVERRIDE; virtual bool isPresentationAttribute(const QualifiedName&) const { return false; } @@ -75,11 +73,6 @@ protected: virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; - // classAttributeChanged() exists to share code between - // parseAttribute (called via setAttribute()) and - // svgAttributeChanged (called when element.className.baseValue is set) - void classAttributeChanged(const AtomicString& newClassString); - private: virtual void updateStyleAttribute() const; void inlineStyleChanged(); @@ -94,13 +87,6 @@ private: } }; -inline const SpaceSplitString& StyledElement::classNames() const -{ - ASSERT(hasClass()); - ASSERT(attributeData()); - return attributeData()->classNames(); -} - inline void StyledElement::invalidateStyleAttribute() { clearIsStyleAttributeValid(); diff --git a/Source/WebCore/dom/Text.cpp b/Source/WebCore/dom/Text.cpp index 9945f94aa..87e366362 100644 --- a/Source/WebCore/dom/Text.cpp +++ b/Source/WebCore/dom/Text.cpp @@ -32,6 +32,7 @@ #include "SVGNames.h" #endif +#include "StyleInheritedData.h" #include <wtf/text/CString.h> #include <wtf/text/StringBuilder.h> diff --git a/Source/WebCore/editing/TextIterator.cpp b/Source/WebCore/editing/TextIterator.cpp index 87c10b31b..5ca7282bc 100644 --- a/Source/WebCore/editing/TextIterator.cpp +++ b/Source/WebCore/editing/TextIterator.cpp @@ -28,6 +28,7 @@ #include "TextIterator.h" #include "Document.h" +#include "Font.h" #include "Frame.h" #include "HTMLElement.h" #include "HTMLTextFormControlElement.h" diff --git a/Source/WebCore/editing/UndoManager.cpp b/Source/WebCore/editing/UndoManager.cpp index e506424f3..419de311d 100644 --- a/Source/WebCore/editing/UndoManager.cpp +++ b/Source/WebCore/editing/UndoManager.cpp @@ -160,6 +160,17 @@ void UndoManager::redo(ExceptionCode& ec) m_redoStack.removeLast(); } +UndoManagerEntry UndoManager::item(unsigned index) const +{ + ASSERT(index < length()); + if (index < m_redoStack.size()) { + UndoManagerEntry entry = *m_redoStack[index]; + entry.reverse(); + return entry; + } + return *m_undoStack[length() - index - 1]; +} + void UndoManager::registerUndoStep(PassRefPtr<UndoStep> step) { if (!m_isInProgress) { diff --git a/Source/WebCore/editing/UndoManager.h b/Source/WebCore/editing/UndoManager.h index dc5d67c7d..f43039e07 100644 --- a/Source/WebCore/editing/UndoManager.h +++ b/Source/WebCore/editing/UndoManager.h @@ -62,6 +62,8 @@ public: void undo(ExceptionCode& = ASSERT_NO_EXCEPTION); void redo(ExceptionCode& = ASSERT_NO_EXCEPTION); + UndoManagerEntry item(unsigned index) const; + unsigned length() const { return m_undoStack.size() + m_redoStack.size(); } unsigned position() const { return m_redoStack.size(); } diff --git a/Source/WebCore/editing/UndoManager.idl b/Source/WebCore/editing/UndoManager.idl index e65677b6f..c228b9ea6 100644 --- a/Source/WebCore/editing/UndoManager.idl +++ b/Source/WebCore/editing/UndoManager.idl @@ -41,6 +41,8 @@ module core { void redo() raises(DOMException); + [Custom] sequence<DOMTransaction> item(in unsigned long index); + readonly attribute unsigned long length; readonly attribute unsigned long position; diff --git a/Source/WebCore/editing/mac/EditorMac.mm b/Source/WebCore/editing/mac/EditorMac.mm index 4b8cd442b..303a70b72 100644 --- a/Source/WebCore/editing/mac/EditorMac.mm +++ b/Source/WebCore/editing/mac/EditorMac.mm @@ -34,6 +34,7 @@ #import "EditingText.h" #import "Editor.h" #import "EditorClient.h" +#import "Font.h" #import "Frame.h" #import "FrameView.h" #import "HTMLConverter.h" diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp index fadcfe7c6..ffb30894b 100644 --- a/Source/WebCore/html/HTMLMediaElement.cpp +++ b/Source/WebCore/html/HTMLMediaElement.cpp @@ -1300,6 +1300,10 @@ void HTMLMediaElement::textTrackModeChanged(TextTrack* track) textTrackAddCues(track, track->cues()); else if (trackElement->readyState() == HTMLTrackElement::NONE) trackElement->scheduleLoad(); + + // If this is the first added track, create the list of text tracks. + if (!m_textTracks) + m_textTracks = TextTrackList::create(this, ActiveDOMObject::scriptExecutionContext()); } break; } diff --git a/Source/WebCore/html/HTMLPropertiesCollection.h b/Source/WebCore/html/HTMLPropertiesCollection.h index ac3d3e238..42bf3e30a 100644 --- a/Source/WebCore/html/HTMLPropertiesCollection.h +++ b/Source/WebCore/html/HTMLPropertiesCollection.h @@ -68,7 +68,7 @@ private: void updateNameCache() const; - void updatePropertyCache(Element* element, const AtomicString& propertyName) const + void updatePropertyCache(Element*, const AtomicString& propertyName) const { if (!m_propertyNames) m_propertyNames = DOMStringList::create(); diff --git a/Source/WebCore/html/HTMLTitleElement.cpp b/Source/WebCore/html/HTMLTitleElement.cpp index f8a97001d..241816ff3 100644 --- a/Source/WebCore/html/HTMLTitleElement.cpp +++ b/Source/WebCore/html/HTMLTitleElement.cpp @@ -27,6 +27,7 @@ #include "HTMLNames.h" #include "NodeRenderingContext.h" #include "RenderStyle.h" +#include "StyleInheritedData.h" #include "Text.h" namespace WebCore { diff --git a/Source/WebCore/html/parser/HTMLElementStack.cpp b/Source/WebCore/html/parser/HTMLElementStack.cpp index 62ed6f4e3..6c220c973 100644 --- a/Source/WebCore/html/parser/HTMLElementStack.cpp +++ b/Source/WebCore/html/parser/HTMLElementStack.cpp @@ -38,16 +38,6 @@ namespace WebCore { using namespace HTMLNames; -static inline bool isNumberedHeaderElement(HTMLStackItem* item) -{ - return item->hasTagName(h1Tag) - || item->hasTagName(h2Tag) - || item->hasTagName(h3Tag) - || item->hasTagName(h4Tag) - || item->hasTagName(h5Tag) - || item->hasTagName(h6Tag); -} - static inline bool isRootNode(HTMLStackItem* item) { return item->isDocumentFragmentNode() @@ -108,7 +98,7 @@ inline bool isForeignContentScopeMarker(HTMLStackItem* item) { return HTMLElementStack::isMathMLTextIntegrationPoint(item) || HTMLElementStack::isHTMLIntegrationPoint(item) - || isInHTMLNamespace(item); + || item->isInHTMLNamespace(); } inline bool isButtonScopeMarker(HTMLStackItem* item) @@ -231,7 +221,7 @@ void HTMLElementStack::popUntilPopped(const AtomicString& tagName) void HTMLElementStack::popUntilNumberedHeaderElementPopped() { - while (!isNumberedHeaderElement(topStackItem())) + while (!topStackItem()->isNumberedHeaderElement()) pop(); pop(); } @@ -460,7 +450,7 @@ bool HTMLElementStack::hasNumberedHeaderElementInScope() const { for (ElementRecord* record = m_top.get(); record; record = record->next()) { HTMLStackItem* item = record->stackItem().get(); - if (isNumberedHeaderElement(item)) + if (item->isNumberedHeaderElement()) return true; if (isScopeMarker(item)) return false; @@ -598,6 +588,19 @@ void HTMLElementStack::removeNonTopCommon(Element* element) ASSERT_NOT_REACHED(); } +HTMLElementStack::ElementRecord* HTMLElementStack::furthestBlockForFormattingElement(Element* formattingElement) const +{ + ElementRecord* furthestBlock = 0; + for (ElementRecord* pos = m_top.get(); pos; pos = pos->next()) { + if (pos->element() == formattingElement) + return furthestBlock; + if (pos->stackItem()->isSpecialNode()) + furthestBlock = pos; + } + ASSERT_NOT_REACHED(); + return 0; +} + #ifndef NDEBUG void HTMLElementStack::show() diff --git a/Source/WebCore/html/parser/HTMLElementStack.h b/Source/WebCore/html/parser/HTMLElementStack.h index 620c5a194..1aaa20448 100644 --- a/Source/WebCore/html/parser/HTMLElementStack.h +++ b/Source/WebCore/html/parser/HTMLElementStack.h @@ -101,6 +101,7 @@ public: HTMLStackItem* oneBelowTop() const; ElementRecord* topRecord() const; ElementRecord* find(Element*) const; + ElementRecord* furthestBlockForFormattingElement(Element*) const; ElementRecord* topmost(const AtomicString& tagName) const; void insertAbove(PassRefPtr<HTMLStackItem>, ElementRecord*); @@ -180,15 +181,6 @@ private: unsigned m_stackDepth; }; -inline bool isInHTMLNamespace(const HTMLStackItem* item) -{ - // A DocumentFragment takes the place of the document element when parsing - // fragments and should be considered in the HTML namespace. - return item->namespaceURI() == HTMLNames::xhtmlNamespaceURI - || item->isDocumentFragmentNode(); // FIXME: Does this also apply to ShadowRoot? -} - - } // namespace WebCore #endif // HTMLElementStack_h diff --git a/Source/WebCore/html/parser/HTMLStackItem.h b/Source/WebCore/html/parser/HTMLStackItem.h index 371ac43f4..0a183bc26 100644 --- a/Source/WebCore/html/parser/HTMLStackItem.h +++ b/Source/WebCore/html/parser/HTMLStackItem.h @@ -29,6 +29,8 @@ #include "Element.h" #include "HTMLNames.h" #include "HTMLToken.h" +#include "MathMLNames.h" +#include "SVGNames.h" #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> @@ -79,6 +81,123 @@ public: || hasTagName(HTMLNames::trTag); } + bool isInHTMLNamespace() const + { + // A DocumentFragment takes the place of the document element when parsing + // fragments and should be considered in the HTML namespace. + return namespaceURI() == HTMLNames::xhtmlNamespaceURI + || isDocumentFragmentNode(); // FIXME: Does this also apply to ShadowRoot? + } + + bool isNumberedHeaderElement() const + { + return hasTagName(HTMLNames::h1Tag) + || hasTagName(HTMLNames::h2Tag) + || hasTagName(HTMLNames::h3Tag) + || hasTagName(HTMLNames::h4Tag) + || hasTagName(HTMLNames::h5Tag) + || hasTagName(HTMLNames::h6Tag); + } + + bool isTableBodyContextElement() const + { + return hasTagName(HTMLNames::tbodyTag) + || hasTagName(HTMLNames::tfootTag) + || hasTagName(HTMLNames::theadTag); + } + + // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#special + bool isSpecialNode() const + { + if (hasTagName(MathMLNames::miTag) + || hasTagName(MathMLNames::moTag) + || hasTagName(MathMLNames::mnTag) + || hasTagName(MathMLNames::msTag) + || hasTagName(MathMLNames::mtextTag) + || hasTagName(MathMLNames::annotation_xmlTag) + || hasTagName(SVGNames::foreignObjectTag) + || hasTagName(SVGNames::descTag) + || hasTagName(SVGNames::titleTag)) + return true; + if (isDocumentFragmentNode()) + return true; + if (!isInHTMLNamespace()) + return false; + const AtomicString& tagName = localName(); + return tagName == HTMLNames::addressTag + || tagName == HTMLNames::appletTag + || tagName == HTMLNames::areaTag + || tagName == HTMLNames::articleTag + || tagName == HTMLNames::asideTag + || tagName == HTMLNames::baseTag + || tagName == HTMLNames::basefontTag + || tagName == HTMLNames::bgsoundTag + || tagName == HTMLNames::blockquoteTag + || tagName == HTMLNames::bodyTag + || tagName == HTMLNames::brTag + || tagName == HTMLNames::buttonTag + || tagName == HTMLNames::captionTag + || tagName == HTMLNames::centerTag + || tagName == HTMLNames::colTag + || tagName == HTMLNames::colgroupTag + || tagName == HTMLNames::commandTag + || tagName == HTMLNames::ddTag + || tagName == HTMLNames::detailsTag + || tagName == HTMLNames::dirTag + || tagName == HTMLNames::divTag + || tagName == HTMLNames::dlTag + || tagName == HTMLNames::dtTag + || tagName == HTMLNames::embedTag + || tagName == HTMLNames::fieldsetTag + || tagName == HTMLNames::figcaptionTag + || tagName == HTMLNames::figureTag + || tagName == HTMLNames::footerTag + || tagName == HTMLNames::formTag + || tagName == HTMLNames::frameTag + || tagName == HTMLNames::framesetTag + || isNumberedHeaderElement() + || tagName == HTMLNames::headTag + || tagName == HTMLNames::headerTag + || tagName == HTMLNames::hgroupTag + || tagName == HTMLNames::hrTag + || tagName == HTMLNames::htmlTag + || tagName == HTMLNames::iframeTag + || tagName == HTMLNames::imgTag + || tagName == HTMLNames::inputTag + || tagName == HTMLNames::isindexTag + || tagName == HTMLNames::liTag + || tagName == HTMLNames::linkTag + || tagName == HTMLNames::listingTag + || tagName == HTMLNames::marqueeTag + || tagName == HTMLNames::menuTag + || tagName == HTMLNames::metaTag + || tagName == HTMLNames::navTag + || tagName == HTMLNames::noembedTag + || tagName == HTMLNames::noframesTag + || tagName == HTMLNames::noscriptTag + || tagName == HTMLNames::objectTag + || tagName == HTMLNames::olTag + || tagName == HTMLNames::pTag + || tagName == HTMLNames::paramTag + || tagName == HTMLNames::plaintextTag + || tagName == HTMLNames::preTag + || tagName == HTMLNames::scriptTag + || tagName == HTMLNames::sectionTag + || tagName == HTMLNames::selectTag + || tagName == HTMLNames::styleTag + || tagName == HTMLNames::summaryTag + || tagName == HTMLNames::tableTag + || isTableBodyContextElement() + || tagName == HTMLNames::tdTag + || tagName == HTMLNames::textareaTag + || tagName == HTMLNames::thTag + || tagName == HTMLNames::titleTag + || tagName == HTMLNames::trTag + || tagName == HTMLNames::ulTag + || tagName == HTMLNames::wbrTag + || tagName == HTMLNames::xmpTag; + } + private: HTMLStackItem(PassRefPtr<ContainerNode> node, ItemType type) : m_node(node) diff --git a/Source/WebCore/html/parser/HTMLTreeBuilder.cpp b/Source/WebCore/html/parser/HTMLTreeBuilder.cpp index 9e91b5381..522a4409b 100644 --- a/Source/WebCore/html/parser/HTMLTreeBuilder.cpp +++ b/Source/WebCore/html/parser/HTMLTreeBuilder.cpp @@ -110,98 +110,6 @@ static bool isTableBodyContextTag(const AtomicString& tagName) || tagName == theadTag; } -// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#special -static bool isSpecialNode(const HTMLStackItem* item) -{ - if (item->hasTagName(MathMLNames::miTag) - || item->hasTagName(MathMLNames::moTag) - || item->hasTagName(MathMLNames::mnTag) - || item->hasTagName(MathMLNames::msTag) - || item->hasTagName(MathMLNames::mtextTag) - || item->hasTagName(MathMLNames::annotation_xmlTag) - || item->hasTagName(SVGNames::foreignObjectTag) - || item->hasTagName(SVGNames::descTag) - || item->hasTagName(SVGNames::titleTag)) - return true; - if (item->isDocumentFragmentNode()) - return true; - if (!isInHTMLNamespace(item)) - return false; - const AtomicString& tagName = item->localName(); - return tagName == addressTag - || tagName == appletTag - || tagName == areaTag - || tagName == articleTag - || tagName == asideTag - || tagName == baseTag - || tagName == basefontTag - || tagName == bgsoundTag - || tagName == blockquoteTag - || tagName == bodyTag - || tagName == brTag - || tagName == buttonTag - || tagName == captionTag - || tagName == centerTag - || tagName == colTag - || tagName == colgroupTag - || tagName == commandTag - || tagName == ddTag - || tagName == detailsTag - || tagName == dirTag - || tagName == divTag - || tagName == dlTag - || tagName == dtTag - || tagName == embedTag - || tagName == fieldsetTag - || tagName == figcaptionTag - || tagName == figureTag - || tagName == footerTag - || tagName == formTag - || tagName == frameTag - || tagName == framesetTag - || isNumberedHeaderTag(tagName) - || tagName == headTag - || tagName == headerTag - || tagName == hgroupTag - || tagName == hrTag - || tagName == htmlTag - || tagName == iframeTag - || tagName == imgTag - || tagName == inputTag - || tagName == isindexTag - || tagName == liTag - || tagName == linkTag - || tagName == listingTag - || tagName == marqueeTag - || tagName == menuTag - || tagName == metaTag - || tagName == navTag - || tagName == noembedTag - || tagName == noframesTag - || tagName == noscriptTag - || tagName == objectTag - || tagName == olTag - || tagName == pTag - || tagName == paramTag - || tagName == plaintextTag - || tagName == preTag - || tagName == scriptTag - || tagName == sectionTag - || tagName == selectTag - || tagName == styleTag - || tagName == summaryTag - || tagName == tableTag - || isTableBodyContextTag(tagName) - || tagName == tdTag - || tagName == textareaTag - || tagName == thTag - || tagName == titleTag - || tagName == trTag - || tagName == ulTag - || tagName == wbrTag - || tagName == xmpTag; -} - static bool isNonAnchorNonNobrFormattingTag(const AtomicString& tagName) { return tagName == bTag @@ -481,7 +389,7 @@ void HTMLTreeBuilder::constructTreeFromAtomicToken(AtomicHTMLToken* token) processToken(token); bool inForeignContent = !m_tree.isEmpty() - && !isInHTMLNamespace(m_tree.currentStackItem()) + && !m_tree.currentStackItem()->isInHTMLNamespace() && !HTMLElementStack::isHTMLIntegrationPoint(m_tree.currentStackItem()) && !HTMLElementStack::isMathMLTextIntegrationPoint(m_tree.currentStackItem()); @@ -640,7 +548,7 @@ void HTMLTreeBuilder::processCloseWhenNestedTag(AtomicHTMLToken* token) processFakeEndTag(item->localName()); break; } - if (isSpecialNode(item.get()) && !item->hasTagName(addressTag) && !item->hasTagName(divTag) && !item->hasTagName(pTag)) + if (item->isSpecialNode() && !item->hasTagName(addressTag) && !item->hasTagName(divTag) && !item->hasTagName(pTag)) break; nodeRecord = nodeRecord->next(); } @@ -816,7 +724,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken* token) } if (isNumberedHeaderTag(token->name())) { processFakePEndTagIfPInButtonScope(); - if (isNumberedHeaderTag(m_tree.currentStackItem()->localName())) { + if (m_tree.currentStackItem()->isNumberedHeaderElement()) { parseError(token); m_tree.openElements()->pop(); } @@ -1494,7 +1402,7 @@ void HTMLTreeBuilder::processAnyOtherEndTagForInBody(AtomicHTMLToken* token) m_tree.openElements()->popUntilPopped(item->element()); return; } - if (isSpecialNode(item.get())) { + if (item->isSpecialNode()) { parseError(token); return; } @@ -1502,21 +1410,6 @@ void HTMLTreeBuilder::processAnyOtherEndTagForInBody(AtomicHTMLToken* token) } } -// FIXME: This probably belongs on HTMLElementStack. -HTMLElementStack::ElementRecord* HTMLTreeBuilder::furthestBlockForFormattingElement(Element* formattingElement) -{ - HTMLElementStack::ElementRecord* furthestBlock = 0; - HTMLElementStack::ElementRecord* record = m_tree.openElements()->topRecord(); - for (; record; record = record->next()) { - if (record->element() == formattingElement) - return furthestBlock; - if (isSpecialNode(record->stackItem().get())) - furthestBlock = record; - } - ASSERT_NOT_REACHED(); - return 0; -} - // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken* token) { @@ -1544,7 +1437,7 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken* token) if (formattingElement != m_tree.currentElement()) parseError(token); // 2. - HTMLElementStack::ElementRecord* furthestBlock = furthestBlockForFormattingElement(formattingElement); + HTMLElementStack::ElementRecord* furthestBlock = m_tree.openElements()->furthestBlockForFormattingElement(formattingElement); // 3. if (!furthestBlock) { m_tree.openElements()->popUntilPopped(formattingElement); @@ -2656,7 +2549,7 @@ bool HTMLTreeBuilder::shouldProcessTokenInForeignContent(AtomicHTMLToken* token) if (m_tree.isEmpty()) return false; HTMLStackItem* item = m_tree.currentStackItem(); - if (isInHTMLNamespace(item)) + if (item->isInHTMLNamespace()) return false; if (HTMLElementStack::isMathMLTextIntegrationPoint(item)) { if (token->type() == HTMLTokenTypes::StartTag @@ -2756,7 +2649,7 @@ void HTMLTreeBuilder::processTokenInForeignContent(AtomicHTMLToken* token) m_tree.openElements()->pop(); return; } - if (!isInHTMLNamespace(m_tree.currentStackItem())) { + if (!m_tree.currentStackItem()->isInHTMLNamespace()) { // FIXME: This code just wants an Element* iterator, instead of an ElementRecord* HTMLElementStack::ElementRecord* nodeRecord = m_tree.openElements()->topRecord(); if (!nodeRecord->stackItem()->hasLocalName(token->name())) @@ -2768,7 +2661,7 @@ void HTMLTreeBuilder::processTokenInForeignContent(AtomicHTMLToken* token) } nodeRecord = nodeRecord->next(); - if (isInHTMLNamespace(nodeRecord->stackItem().get())) + if (nodeRecord->stackItem()->isInHTMLNamespace()) break; } } diff --git a/Source/WebCore/html/parser/HTMLTreeBuilder.h b/Source/WebCore/html/parser/HTMLTreeBuilder.h index 86d229de0..c57362783 100644 --- a/Source/WebCore/html/parser/HTMLTreeBuilder.h +++ b/Source/WebCore/html/parser/HTMLTreeBuilder.h @@ -174,7 +174,6 @@ private: Vector<Attribute> attributesForIsindexInput(AtomicHTMLToken*); - HTMLElementStack::ElementRecord* furthestBlockForFormattingElement(Element*); void callTheAdoptionAgency(AtomicHTMLToken*); void closeTheCell(); diff --git a/Source/WebCore/html/shadow/MediaControlElements.cpp b/Source/WebCore/html/shadow/MediaControlElements.cpp index 1b67afec3..881c2deb5 100644 --- a/Source/WebCore/html/shadow/MediaControlElements.cpp +++ b/Source/WebCore/html/shadow/MediaControlElements.cpp @@ -32,21 +32,27 @@ #include "MediaControlElements.h" +#include "CSSStyleDeclaration.h" #include "CSSValueKeywords.h" #include "DOMTokenList.h" #include "EventNames.h" #include "FloatConversion.h" +#include "FloatPoint.h" #include "Frame.h" +#include "HTMLDivElement.h" #include "HTMLMediaElement.h" #include "HTMLNames.h" #include "HTMLVideoElement.h" +#include "LayoutRepainter.h" #include "LocalizedStrings.h" #include "MediaControls.h" #include "MouseEvent.h" #include "Page.h" #include "RenderDeprecatedFlexibleBox.h" +#include "RenderInline.h" #include "RenderMedia.h" #include "RenderSlider.h" +#include "RenderText.h" #include "RenderTheme.h" #include "RenderVideo.h" #include "RenderView.h" @@ -1258,7 +1264,7 @@ const AtomicString& MediaControlCurrentTimeDisplayElement::shadowPseudoId() cons class RenderTextTrackContainerElement : public RenderBlock { public: RenderTextTrackContainerElement(Node*); - + private: virtual void layout(); }; @@ -1352,29 +1358,18 @@ void MediaControlTextTrackContainerElement::updateDisplay() // 10. For each text track cue cue in cues that has not yet had // corresponding CSS boxes added to output, in text track cue order, run the // following substeps: - - // Simple renderer for now. for (size_t i = 0; i < activeCues.size(); ++i) { TextTrackCue* cue = activeCues[i].data(); ASSERT(cue->isActive()); - if (cue->track()->kind() != TextTrack::captionsKeyword() && cue->track()->kind() != TextTrack::subtitlesKeyword()) - continue; - - if (!cue->track() || cue->track()->mode() != TextTrack::SHOWING) + if (!cue->track() || !cue->track()->isRendered()) continue; - RefPtr<HTMLDivElement> displayTree = cue->getDisplayTree(); - - // Append only new display trees. - if (displayTree->hasChildNodes() && !contains(displayTree.get())) - appendChild(displayTree, ASSERT_NO_EXCEPTION, true); - - // Note: the display tree of a cue is removed when the active flag of the cue is unset. - - // FIXME(BUG 79751): Render the TextTrackCue when snap-to-lines is set. + RefPtr<TextTrackCueBox> displayBox = cue->getDisplayTree(); - // FIXME(BUG 84296): Implement overlapping detection for cue boxes when snap-to-lines is not set. + if (displayBox->hasChildNodes() && !contains(static_cast<Node*>(displayBox.get()))) + // Note: the display tree of a cue is removed when the active flag of the cue is unset. + appendChild(displayBox, ASSERT_NO_EXCEPTION, false); } // 11. Return output. diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.cpp b/Source/WebCore/html/shadow/TextControlInnerElements.cpp index c58f176f7..116b67869 100644 --- a/Source/WebCore/html/shadow/TextControlInnerElements.cpp +++ b/Source/WebCore/html/shadow/TextControlInnerElements.cpp @@ -42,6 +42,7 @@ #include "ScriptController.h" #include "SpeechInput.h" #include "SpeechInputEvent.h" +#include "StyleInheritedData.h" #include "TextEvent.h" #include "TextEventInputType.h" diff --git a/Source/WebCore/html/track/TextTrack.cpp b/Source/WebCore/html/track/TextTrack.cpp index 75d763cdd..addc87527 100644 --- a/Source/WebCore/html/track/TextTrack.cpp +++ b/Source/WebCore/html/track/TextTrack.cpp @@ -199,7 +199,7 @@ void TextTrack::addCue(PassRefPtr<TextTrackCue> prpCue, ExceptionCode& ec) RefPtr<TextTrackCue> cue = prpCue; // TODO(93143): Add spec-compliant behavior for negative time values. - if (cue->startTime() < 0 || cue->endTime() < 0) + if (isnan(cue->startTime()) || isnan(cue->endTime()) || cue->startTime() < 0 || cue->endTime() < 0) return; // 4.8.10.12.4 Text track API @@ -294,6 +294,17 @@ void TextTrack::invalidateTrackIndex() m_trackIndex = invalidTrackIndex; } +bool TextTrack::isRendered() +{ + if (m_kind != captionsKeyword() && m_kind != subtitlesKeyword()) + return false; + + if (m_mode != SHOWING && !m_showingByDefault) + return false; + + return true; +} + TextTrackCueList* TextTrack::ensureTextTrackCueList() { if (!m_cues) diff --git a/Source/WebCore/html/track/TextTrack.h b/Source/WebCore/html/track/TextTrack.h index 3cd7a7447..957bcca60 100644 --- a/Source/WebCore/html/track/TextTrack.h +++ b/Source/WebCore/html/track/TextTrack.h @@ -110,6 +110,8 @@ public: int trackIndex(); void invalidateTrackIndex(); + bool isRendered(); + protected: TextTrack(ScriptExecutionContext*, TextTrackClient*, const String& kind, const String& label, const String& language, TextTrackType); diff --git a/Source/WebCore/html/track/TextTrackCue.cpp b/Source/WebCore/html/track/TextTrackCue.cpp index 7973fc5f5..e67ae8b93 100644 --- a/Source/WebCore/html/track/TextTrackCue.cpp +++ b/Source/WebCore/html/track/TextTrackCue.cpp @@ -41,6 +41,7 @@ #include "Event.h" #include "HTMLDivElement.h" #include "HTMLMediaElement.h" +#include "RenderTextTrackCue.h" #include "Text.h" #include "TextTrack.h" #include "TextTrackCueList.h" @@ -88,9 +89,99 @@ static const String& verticalGrowingRightKeyword() return verticallr; } -TextTrackCue::TextTrackCue(ScriptExecutionContext* context, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit) - : m_id(id) - , m_startTime(start) +// ---------------------------- + +TextTrackCueBox::TextTrackCueBox(Document* document, TextTrackCue* cue) + : HTMLElement(divTag, document) + , m_cue(cue) +{ +} + +TextTrackCue* TextTrackCueBox::getCue() const +{ + return m_cue; +} + +void TextTrackCueBox::applyCSSProperties() +{ + // FIXME: Apply all the initial CSS positioning properties. http://wkb.ug/79916 + + // 3.5.1 On the (root) List of WebVTT Node Objects: + + // the 'position' property must be set to 'absolute' + setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); + + // the 'unicode-bidi' property must be set to 'plaintext' + setInlineStyleProperty(CSSPropertyUnicodeBidi, CSSValueWebkitPlaintext); + + // FIXME: Determine the text direction using the BIDI algorithm. http://wkb.ug/79749 + // the 'direction' property must be set to direction + setInlineStyleProperty(CSSPropertyDirection, CSSValueLtr); + + // the 'writing-mode' property must be set to writing-mode + setInlineStyleProperty(CSSPropertyWebkitWritingMode, m_cue->getCSSWritingMode(), false); + + std::pair<float, float> position = m_cue->getCSSPosition(); + + // the 'top' property must be set to top, + setInlineStyleProperty(CSSPropertyTop, static_cast<double>(position.second), CSSPrimitiveValue::CSS_PERCENTAGE); + + // the 'left' property must be set to left + setInlineStyleProperty(CSSPropertyLeft, static_cast<double>(position.first), CSSPrimitiveValue::CSS_PERCENTAGE); + + // the 'width' property must be set to width, and the 'height' property must be set to height + if (m_cue->vertical() == horizontalKeyword()) { + setInlineStyleProperty(CSSPropertyWidth, static_cast<double>(m_cue->getCSSSize()), CSSPrimitiveValue::CSS_PERCENTAGE); + setInlineStyleProperty(CSSPropertyHeight, CSSValueAuto); + } else { + setInlineStyleProperty(CSSPropertyWidth, CSSValueAuto); + setInlineStyleProperty(CSSPropertyHeight, static_cast<double>(m_cue->getCSSSize()), CSSPrimitiveValue::CSS_PERCENTAGE); + } + + // The 'text-align' property on the (root) List of WebVTT Node Objects must + // be set to the value in the second cell of the row of the table below + // whose first cell is the value of the corresponding cue's text track cue + // alignment: + if (m_cue->align() == startKeyword()) + setInlineStyleProperty(CSSPropertyTextAlign, CSSValueStart); + else if (m_cue->align() == endKeyword()) + setInlineStyleProperty(CSSPropertyTextAlign, CSSValueEnd); + else + setInlineStyleProperty(CSSPropertyTextAlign, CSSValueCenter); + + if (!m_cue->snapToLines()) { + // 10.13.1 Set up x and y: + // Note: x and y are set through the CSS left and top above. + + // 10.13.2 Position the boxes in boxes such that the point x% along the + // width of the bounding box of the boxes in boxes is x% of the way + // across the width of the video's rendering area, and the point y% + // along the height of the bounding box of the boxes in boxes is y% + // of the way across the height of the video's rendering area, while + // maintaining the relative positions of the boxes in boxes to each + // other. + setInlineStyleProperty(CSSPropertyWebkitTransform, + String::format("translate(-%.2f%%, -%.2f%%)", position.first, position.second)); + + setInlineStyleProperty(CSSPropertyWhiteSpace, CSSValuePre); + } +} + +const AtomicString& TextTrackCueBox::shadowPseudoId() const +{ + DEFINE_STATIC_LOCAL(const AtomicString, trackDisplayBoxShadowPseudoId, ("-webkit-media-text-track-display")); + return trackDisplayBoxShadowPseudoId; +} + +RenderObject* TextTrackCueBox::createRenderer(RenderArena* arena, RenderStyle*) +{ + return new (arena) RenderTextTrackCue(this); +} + +// ---------------------------- + +TextTrackCue::TextTrackCue(ScriptExecutionContext* context, double start, double end, const String& content) + : m_startTime(start) , m_endTime(end) , m_content(content) , m_linePosition(undefinedPosition) @@ -103,25 +194,24 @@ TextTrackCue::TextTrackCue(ScriptExecutionContext* context, const String& id, do , m_documentFragment(0) , m_scriptExecutionContext(context) , m_isActive(false) - , m_pauseOnExit(pauseOnExit) + , m_pauseOnExit(false) , m_snapToLines(true) , m_hasInnerTimestamps(false) , m_pastDocumentNodes(HTMLDivElement::create(static_cast<Document*>(context))) , m_futureDocumentNodes(HTMLDivElement::create(static_cast<Document*>(context))) , m_displayTreeShouldChange(true) - , m_displayTree(HTMLDivElement::create(static_cast<Document*>(context))) - , m_displayXPosition(undefinedPosition) - , m_displayYPosition(undefinedPosition) + , m_displayTree(TextTrackCueBox::create(static_cast<Document*>(m_scriptExecutionContext), this)) { ASSERT(m_scriptExecutionContext->isDocument()); - // The text track cue writing directions are directly relatd to the - // block-flow element, which can be set through the CSS writing modes. + // 4. If the text track cue writing direction is horizontal, then let + // writing-mode be 'horizontal-tb'. Otherwise, if the text track cue writing + // direction is vertical growing left, then let writing-mode be + // 'vertical-rl'. Otherwise, the text track cue writing direction is + // vertical growing right; let writing-mode be 'vertical-lr'. m_displayWritingModeMap[Horizontal] = CSSValueHorizontalTb; - m_displayWritingModeMap[VerticalGrowingLeft] = CSSValueVerticalLr; - m_displayWritingModeMap[VerticalGrowingRight] = CSSValueVerticalRl; - - parseSettings(settings); + m_displayWritingModeMap[VerticalGrowingLeft] = CSSValueVerticalRl; + m_displayWritingModeMap[VerticalGrowingRight] = CSSValueVerticalLr; // A text track cue has a text track cue computed line position whose value // is defined in terms of the other aspects of the cue. @@ -443,10 +533,27 @@ int TextTrackCue::calculateComputedLinePosition() // Otherwise, it is the value returned by the following algorithm: - // FIXME(BUG 79751): Complete determination algorithm when it is actually - // used - when displaying a TextTrackCue having snap-to-lines flag set. + // If cue is not associated with a text track, return -1 and abort these + // steps. + if (!track()) + return -1; + + // Let n be the number of text tracks whose text track mode is showing or + // showing by default and that are in the media element's list of text + // tracks before track. - return 100; + // FIXME: Add a method to cache the track index considering only + // rendered tracks (that have showing or showing by default mode set). + // http://wkb.ug/93779 + int n = track()->trackIndex(); + + // Increment n by one. + n++; + + // Negate n. + n = -n; + + return n; } void TextTrackCue::calculateDisplayParameters() @@ -460,7 +567,6 @@ void TextTrackCue::calculateDisplayParameters() // vertical growing left, then let block-flow be 'lr'. Otherwise, the text // track cue writing direction is vertical growing right; let block-flow be // 'rl'. - m_displayWritingMode = m_displayWritingModeMap[m_writingDirection]; // 10.5 Determine the value of maximum size for cue as per the appropriate @@ -469,7 +575,7 @@ void TextTrackCue::calculateDisplayParameters() if ((m_writingDirection == Horizontal && m_cueAlignment == Start && m_displayDirection == CSSValueLtr) || (m_writingDirection == Horizontal && m_cueAlignment == End && m_displayDirection == CSSValueRtl) || (m_writingDirection == VerticalGrowingLeft && m_cueAlignment == Start) - || (m_writingDirection == VerticalGrowingRight && m_cueAlignment == End)) { + || (m_writingDirection == VerticalGrowingRight && m_cueAlignment == Start)) { maximumSize = 100 - m_textPosition; } else if ((m_writingDirection == Horizontal && m_cueAlignment == End && m_displayDirection == CSSValueLtr) || (m_writingDirection == Horizontal && m_cueAlignment == Start && m_displayDirection == CSSValueRtl) @@ -485,61 +591,56 @@ void TextTrackCue::calculateDisplayParameters() // be text track cue size. Otherwise, let size be maximum size. m_displaySize = std::min(m_cueSize, maximumSize); - // 10.7 If the text track cue writing direction is horizontal, then let - // width be 'size vw' and height be 'auto'. Otherwise, let width be 'auto' - // and height be 'size vh'. (These are CSS values used by the next section - // to set CSS properties for the rendering; 'vw' and 'vh' are CSS units.) - m_displayWidth = m_writingDirection == Horizontal ? m_displaySize : autoSize; - m_displayHeight = m_writingDirection == Horizontal ? autoSize : m_displaySize; - // 10.8 Determine the value of x-position or y-position for cue as per the // appropriate rules from the following list: - if ((m_writingDirection == Horizontal && m_cueAlignment == Start && m_displayDirection == CSSValueLtr) - || (m_writingDirection == Horizontal && m_cueAlignment == End && m_displayDirection == CSSValueRtl)) { - m_displayXPosition = m_textPosition; - } else if ((m_writingDirection == Horizontal && m_cueAlignment == End && m_displayDirection == CSSValueLtr) - || (m_writingDirection == Horizontal && m_cueAlignment == Start && m_displayDirection == CSSValueRtl)) { - m_displayXPosition = 100 - m_textPosition; + if (m_writingDirection == Horizontal) { + if (m_cueAlignment == Start) { + if (m_displayDirection == CSSValueLtr) + m_displayPosition.first = m_textPosition; + else + m_displayPosition.first = 100 - m_textPosition - m_displaySize; + } else if (m_cueAlignment == End) { + if (m_displayDirection == CSSValueRtl) + m_displayPosition.first = 100 - m_textPosition; + else + m_displayPosition.first = m_textPosition - m_displaySize; + } } if ((m_writingDirection == VerticalGrowingLeft && m_cueAlignment == Start) || (m_writingDirection == VerticalGrowingRight && m_cueAlignment == Start)) { - m_displayYPosition = m_textPosition; + m_displayPosition.second = m_textPosition; } else if ((m_writingDirection == VerticalGrowingLeft && m_cueAlignment == End) || (m_writingDirection == VerticalGrowingRight && m_cueAlignment == End)) { - m_displayYPosition = 100 - m_textPosition; + m_displayPosition.second = 100 - m_textPosition; } if (m_writingDirection == Horizontal && m_cueAlignment == Middle) { - m_displayXPosition = m_textPosition - m_displaySize / 2; - - if (m_displayDirection == CSSValueRtl) - m_displayXPosition = 100 - m_displayXPosition; + if (m_displayDirection == CSSValueLtr) + m_displayPosition.first = m_textPosition - m_displaySize / 2; + else + m_displayPosition.first = 100 - m_textPosition - m_displaySize / 2; } if ((m_writingDirection == VerticalGrowingLeft && m_cueAlignment == Middle) || (m_writingDirection == VerticalGrowingRight && m_cueAlignment == Middle)) - m_displayYPosition = m_textPosition - m_displaySize / 2; + m_displayPosition.second = m_textPosition - m_displaySize / 2; // 10.9 Determine the value of whichever of x-position or y-position is not // yet calculated for cue as per the appropriate rules from the following // list: - if (m_snapToLines && m_displayYPosition == undefinedPosition && m_writingDirection == Horizontal) - m_displayYPosition = 0; + if (m_snapToLines && m_displayPosition.second == undefinedPosition && m_writingDirection == Horizontal) + m_displayPosition.second = 0; - if (!m_snapToLines && m_writingDirection == Horizontal) - m_displayYPosition = m_computedLinePosition; + if (!m_snapToLines && m_displayPosition.second == undefinedPosition && m_writingDirection == Horizontal) + m_displayPosition.second = m_computedLinePosition; - if (m_snapToLines && m_displayXPosition == undefinedPosition + if (m_snapToLines && m_displayPosition.first == undefinedPosition && (m_writingDirection == VerticalGrowingLeft || m_writingDirection == VerticalGrowingRight)) - m_displayXPosition = 0; + m_displayPosition.first = 0; if (!m_snapToLines && (m_writingDirection == VerticalGrowingLeft || m_writingDirection == VerticalGrowingRight)) - m_displayXPosition = m_computedLinePosition; - - // 10.10 Let left be 'x-position vw' and top be 'y-position vh'. - - // FIXME(Bug 79916): CSS top and left properties need to be applied. + m_displayPosition.first = m_computedLinePosition; } void TextTrackCue::updateDisplayTree(float movieTime) @@ -587,10 +688,8 @@ void TextTrackCue::updateDisplayTree(float movieTime) } } -PassRefPtr<HTMLDivElement> TextTrackCue::getDisplayTree() +PassRefPtr<TextTrackCueBox> TextTrackCue::getDisplayTree() { - DEFINE_STATIC_LOCAL(const AtomicString, trackDisplayBoxShadowPseudoId, ("-webkit-media-text-track-display")); - if (!m_displayTreeShouldChange) return m_displayTree; @@ -600,7 +699,6 @@ PassRefPtr<HTMLDivElement> TextTrackCue::getDisplayTree() // 10.11. Apply the terms of the CSS specifications to nodes within the // following constraints, thus obtaining a set of CSS boxes positioned // relative to an initial containing block: - m_displayTree->setShadowPseudoId(trackDisplayBoxShadowPseudoId, ASSERT_NO_EXCEPTION); m_displayTree->removeChildren(); // The document tree is the tree of WebVTT Node Objects rooted at nodes. @@ -624,38 +722,7 @@ PassRefPtr<HTMLDivElement> TextTrackCue::getDisplayTree() // is no line breaking opportunity. (Thus, normally text wraps as needed, // but if there is a particularly long word, it does not overflow as it // normally would in CSS, it is instead forcibly wrapped at the box's edge.) - - // FIXME(BUG 79916): CSS width property should be set to 'size vw', when the - // maximum cue size computation is corrected in the specification. - if (m_snapToLines) - m_displayTree->setInlineStyleProperty(CSSPropertyWidth, (double) m_cueSize, CSSPrimitiveValue::CSS_PERCENTAGE); - - // FIXME(BUG 79750, 79751): Steps 10.12 - 10.14 - - if (!m_snapToLines) { - std::pair<double, double> position = getPositionCoordinates(); - - // 10.13.1 Set up x and y: - m_displayTree->setInlineStyleProperty(CSSPropertyLeft, position.first, CSSPrimitiveValue::CSS_PERCENTAGE); - m_displayTree->setInlineStyleProperty(CSSPropertyTop, position.second, CSSPrimitiveValue::CSS_PERCENTAGE); - - // 10.13.2 Position the boxes in boxes such that the point x% along the - // width of the bounding box of the boxes in boxes is x% of the way - // across the width of the video's rendering area, and the point y% - // along the height of the bounding box of the boxes in boxes is y% - // of the way across the height of the video's rendering area, while - // maintaining the relative positions of the boxes in boxes to each - // other. - String translateX = "-" + String::number(position.first) + "%"; - String translateY = "-" + String::number(position.second) + "%"; - String webkitTransformTranslateValue = "translate(" + translateX + "," + translateY + ")"; - - m_displayTree->setInlineStyleProperty(CSSPropertyWebkitTransform, - webkitTransformTranslateValue); - - m_displayTree->setInlineStyleProperty(CSSPropertyWhiteSpace, - CSSValuePre); - } + m_displayTree->applyCSSProperties(); if (m_hasInnerTimestamps) updateDisplayTree(track()->mediaElement()->currentTime()); @@ -673,8 +740,9 @@ void TextTrackCue::removeDisplayTree() m_displayTree->remove(ASSERT_NO_EXCEPTION); } -std::pair<double, double> TextTrackCue::getPositionCoordinates() +std::pair<double, double> TextTrackCue::getPositionCoordinates() const { + // This method is used for setting x and y when snap to lines is not set. std::pair<double, double> coordinates; if (m_writingDirection == Horizontal && m_displayDirection == CSSValueLtr) { @@ -732,7 +800,7 @@ TextTrackCue::CueSetting TextTrackCue::settingName(const String& name) return None; } -void TextTrackCue::parseSettings(const String& input) +void TextTrackCue::setCueSettings(const String& input) { unsigned position = 0; @@ -929,6 +997,24 @@ NextSetting: } } +int TextTrackCue::getCSSWritingMode() const +{ + return m_displayWritingMode; +} + +int TextTrackCue::getCSSSize() const +{ + return m_displaySize; +} + +std::pair<double, double> TextTrackCue::getCSSPosition() const +{ + if (!m_snapToLines) + return getPositionCoordinates(); + + return m_displayPosition; +} + const AtomicString& TextTrackCue::interfaceName() const { return eventNames().interfaceForTextTrackCue; diff --git a/Source/WebCore/html/track/TextTrackCue.h b/Source/WebCore/html/track/TextTrackCue.h index 9c5ba5b71..115a86809 100644 --- a/Source/WebCore/html/track/TextTrackCue.h +++ b/Source/WebCore/html/track/TextTrackCue.h @@ -34,6 +34,7 @@ #if ENABLE(VIDEO_TRACK) #include "EventTarget.h" +#include "HTMLElement.h" #include "TextTrack.h" #include <wtf/PassOwnPtr.h> #include <wtf/RefCounted.h> @@ -41,15 +42,40 @@ namespace WebCore { class DocumentFragment; +class HTMLDivElement; class ScriptExecutionContext; class TextTrack; -class HTMLDivElement; +class TextTrackCue; + +// ---------------------------- + +class TextTrackCueBox : public HTMLElement { +public: + static PassRefPtr<TextTrackCueBox> create(Document* document, TextTrackCue* cue) + { + return adoptRef(new TextTrackCueBox(document, cue)); + } + + TextTrackCue* getCue() const; + void applyCSSProperties(); + + virtual const AtomicString& shadowPseudoId() const OVERRIDE; + +private: + TextTrackCueBox(Document*, TextTrackCue*); + + virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE; + + TextTrackCue* m_cue; +}; + +// ---------------------------- class TextTrackCue : public RefCounted<TextTrackCue>, public EventTarget { public: - static PassRefPtr<TextTrackCue> create(ScriptExecutionContext* context, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit) + static PassRefPtr<TextTrackCue> create(ScriptExecutionContext* context, double start, double end, const String& content) { - return adoptRef(new TextTrackCue(context, id, start, end, content, settings, pauseOnExit)); + return adoptRef(new TextTrackCue(context, start, end, content)); } virtual ~TextTrackCue(); @@ -90,6 +116,8 @@ public: const String& text() const { return m_content; } void setText(const String&); + void setCueSettings(const String&); + int cueIndex(); void invalidateCueIndex(); @@ -101,13 +129,27 @@ public: bool isActive(); void setIsActive(bool); - PassRefPtr<HTMLDivElement> getDisplayTree(); + PassRefPtr<TextTrackCueBox> getDisplayTree(); void updateDisplayTree(float); void removeDisplayTree(); + int calculateComputedLinePosition(); + virtual const AtomicString& interfaceName() const; virtual ScriptExecutionContext* scriptExecutionContext() const; + std::pair<double, double> getCSSPosition() const; + int getCSSSize() const; + int getCSSWritingMode() const; + + enum WritingDirection { + Horizontal, + VerticalGrowingLeft, + VerticalGrowingRight, + NumberOfWritingDirections + }; + WritingDirection getWritingDirection() const { return m_writingDirection; } + DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); @@ -119,15 +161,13 @@ protected: virtual EventTargetData* ensureEventTargetData(); private: - TextTrackCue(ScriptExecutionContext*, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit); + TextTrackCue(ScriptExecutionContext*, double start, double end, const String& content); + std::pair<double, double> getPositionCoordinates() const; void parseSettings(const String&); - int calculateComputedLinePosition(); void calculateDisplayParameters(); - std::pair<double, double> getPositionCoordinates(); - void cueWillChange(); void cueDidChange(); @@ -147,12 +187,6 @@ private: int m_cueSize; int m_cueIndex; - enum WritingDirection { - Horizontal, - VerticalGrowingLeft, - VerticalGrowingRight, - NumberOfWritingDirections - }; WritingDirection m_writingDirection; enum Alignment { Start, Middle, End }; @@ -173,7 +207,7 @@ private: RefPtr<HTMLDivElement> m_futureDocumentNodes; bool m_displayTreeShouldChange; - RefPtr<HTMLDivElement> m_displayTree; + RefPtr<TextTrackCueBox> m_displayTree; int m_displayDirection; @@ -181,11 +215,8 @@ private: int m_displayWritingMode; int m_displaySize; - int m_displayHeight; - int m_displayWidth; - double m_displayXPosition; - double m_displayYPosition; + std::pair<float, float> m_displayPosition; }; } // namespace WebCore diff --git a/Source/WebCore/html/track/TextTrackCue.idl b/Source/WebCore/html/track/TextTrackCue.idl index d552525a4..040110963 100644 --- a/Source/WebCore/html/track/TextTrackCue.idl +++ b/Source/WebCore/html/track/TextTrackCue.idl @@ -29,7 +29,7 @@ module html { Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack, JSGenerateToNativeObject, - Constructor(in DOMString id, in double startTime, in double endTime, in DOMString text, in [Optional=DefaultIsUndefined] DOMString settings, in [Optional=DefaultIsUndefined] boolean pauseOnExit), + Constructor(in double startTime, in double endTime, in DOMString text), CallWith=ScriptExecutionContext, EventTarget, JSCustomMarkFunction, diff --git a/Source/WebCore/html/track/WebVTTParser.cpp b/Source/WebCore/html/track/WebVTTParser.cpp index 32b79f10e..fe47d2258 100644 --- a/Source/WebCore/html/track/WebVTTParser.cpp +++ b/Source/WebCore/html/track/WebVTTParser.cpp @@ -262,7 +262,9 @@ void WebVTTParser::createNewCue() if (!m_currentContent.length()) return; - RefPtr<TextTrackCue> cue = TextTrackCue::create(m_scriptExecutionContext, m_currentId, m_currentStartTime, m_currentEndTime, m_currentContent.toString(), m_currentSettings, false); + RefPtr<TextTrackCue> cue = TextTrackCue::create(m_scriptExecutionContext, m_currentStartTime, m_currentEndTime, m_currentContent.toString()); + cue->setId(m_currentId); + cue->setCueSettings(m_currentSettings); m_cuelist.append(cue); if (m_client) diff --git a/Source/WebCore/inspector/InjectedScriptExterns.js b/Source/WebCore/inspector/InjectedScriptExterns.js index edd7754e4..a24f69773 100644 --- a/Source/WebCore/inspector/InjectedScriptExterns.js +++ b/Source/WebCore/inspector/InjectedScriptExterns.js @@ -76,6 +76,10 @@ InjectedScriptHost.prototype.type = function(object) { } * @param {*} object */ InjectedScriptHost.prototype.getEventListeners = function(object) { } +/** + * @param {string} expression + */ +InjectedScriptHost.prototype.evaluate = function(expression) { } /** diff --git a/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js b/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js index 977872767..3ace0b245 100644 --- a/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js +++ b/Source/WebCore/inspector/InjectedScriptWebGLModuleSource.js @@ -35,6 +35,105 @@ */ (function (InjectedScriptHost, inspectedWindow, injectedScriptId) { +var TypeUtils = { + /** + * http://www.khronos.org/registry/typedarray/specs/latest/#7 + * @type {Array.<Function>} + */ + typedArrayClasses: (function(typeNames) { + var result = []; + for (var i = 0, n = typeNames.length; i < n; ++i) { + if (inspectedWindow[typeNames[i]]) + result.push(inspectedWindow[typeNames[i]]); + } + return result; + })(["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array"]), + + /** + * @param {*} array + * @return {Function} + */ + typedArrayClass: function(array) + { + var classes = TypeUtils.typedArrayClasses; + for (var i = 0, n = classes.length; i < n; ++i) { + if (array instanceof classes[i]) + return classes[i]; + } + return null; + }, + + /** + * @param {*} obj + * @return {*} + * FIXME: suppress checkTypes due to outdated builtin externs for CanvasRenderingContext2D and ImageData + * @suppress {checkTypes} + */ + clone: function(obj) + { + if (!obj) + return obj; + + var type = typeof obj; + if (type !== "object" && type !== "function") + return obj; + + // Handle Array and ArrayBuffer instances. + if (typeof obj.slice === "function") { + console.assert(obj instanceof Array || obj instanceof ArrayBuffer); + return obj.slice(0); + } + + var typedArrayClass = TypeUtils.typedArrayClass(obj); + if (typedArrayClass) + return new typedArrayClass(obj); + + if (obj instanceof HTMLImageElement) + return obj.cloneNode(true); + + if (obj instanceof HTMLCanvasElement) { + var result = obj.cloneNode(true); + var context = result.getContext("2d"); + context.drawImage(obj, 0, 0); + return result; + } + + if (obj instanceof HTMLVideoElement) { + var result = obj.cloneNode(true); + // FIXME: Copy HTMLVideoElement's current image into a 2d canvas. + return result; + } + + if (obj instanceof ImageData) { + var context = TypeUtils._dummyCanvas2dContext(); + var result = context.createImageData(obj); + for (var i = 0, n = obj.data.length; i < n; ++i) + result.data[i] = obj.data[i]; + return result; + } + + console.error("ASSERT_NOT_REACHED: failed to clone object: ", obj); + return obj; + }, + + /** + * @return {CanvasRenderingContext2D} + */ + _dummyCanvas2dContext: function() + { + var context = TypeUtils._dummyCanvas2dContext; + if (!context) { + var canvas = inspectedWindow.document.createElement("canvas"); + context = canvas.getContext("2d"); + var contextResource = Resource.forObject(context); + if (contextResource) + context = contextResource.wrappedObject(); + TypeUtils._dummyCanvas2dContext = context; + } + return context; + } +} + /** * @constructor */ @@ -93,7 +192,7 @@ Cache.prototype = { * @param {Resource|Object} thisObject * @param {string} functionName * @param {Array|Arguments} args - * @param {Resource|*} result + * @param {Resource|*=} result */ function Call(thisObject, functionName, args, result) { @@ -134,6 +233,76 @@ Call.prototype = { result: function() { return this._result; + }, + + freeze: function() + { + if (this._freezed) + return; + this._freezed = true; + for (var i = 0, n = this._args.length; i < n; ++i) { + // FIXME: freeze the Resources also! + if (!Resource.forObject(this._args[i])) + this._args[i] = TypeUtils.clone(this._args[i]); + } + } +} + +/** + * @constructor + * @param {ReplayableResource} thisObject + * @param {string} functionName + * @param {Array.<ReplayableResource|*>} args + * @param {ReplayableResource|*} result + */ +function ReplayableCall(thisObject, functionName, args, result) +{ + this._thisObject = thisObject; + this._functionName = functionName; + this._args = args; + this._result = result; +} + +ReplayableCall.prototype = { + /** + * @return {ReplayableResource} + */ + resource: function() + { + return this._thisObject; + }, + + /** + * @return {string} + */ + functionName: function() + { + return this._functionName; + }, + + /** + * @return {Array.<ReplayableResource|*>} + */ + args: function() + { + return this._args; + }, + + /** + * @return {ReplayableResource|*} + */ + result: function() + { + return this._result; + }, + + /** + * @param {Cache} cache + * @return {Call} + */ + replay: function(cache) + { + // FIXME: Do the replay. } } @@ -145,18 +314,24 @@ function Resource(wrappedObject) { this._id = ++Resource._uniqueId; this._resourceManager = null; + this._calls = []; this.setWrappedObject(wrappedObject); } +/** + * @type {number} + */ Resource._uniqueId = 0; /** - * @param {Object} obj + * @param {*} obj * @return {Resource} */ Resource.forObject = function(obj) { - if (!obj || obj instanceof Resource) + if (!obj) + return null; + if (obj instanceof Resource) return obj; if (typeof obj === "object") return obj["__resourceObject"]; @@ -185,7 +360,8 @@ Resource.prototype = { */ setWrappedObject: function(value) { - console.assert(value && !(value instanceof Resource), "Binding a Resource object to another Resource object?"); + console.assert(value, "wrappedObject should not be NULL"); + console.assert(!(value instanceof Resource), "Binding a Resource object to another Resource object?"); this._wrappedObject = value; this._bindObjectToResource(value); }, @@ -216,6 +392,23 @@ Resource.prototype = { }, /** + * @return {Array.<Call>} + */ + calls: function() + { + return this._calls; + }, + + /** + * @param {Call} call + */ + pushCall: function(call) + { + call.freeze(); + this._calls.push(call); + }, + + /** * @param {Object} object */ _bindObjectToResource: function(object) @@ -226,6 +419,26 @@ Resource.prototype = { /** * @constructor + * @param {Resource} originalResource + * @param {Object} data + */ +function ReplayableResource(originalResource, data) +{ +} + +ReplayableResource.prototype = { + /** + * @param {Cache} cache + * @return {Resource} + */ + replay: function(cache) + { + // FIXME: Do the replay. + } +} + +/** + * @constructor * @extends {Resource} * @param {WebGLRenderingContext} glContext */ @@ -313,7 +526,7 @@ WebGLRenderingContextResource.prototype.__proto__ = Resource.prototype; * @param {WebGLRenderingContext} originalObject * @param {Function} originalFunction * @param {string} functionName - * @param {Array} args + * @param {Array|Arguments} args */ WebGLRenderingContextResource.WrapFunction = function(originalObject, originalFunction, functionName, args) { @@ -353,8 +566,8 @@ WebGLRenderingContextResource.WrapFunction.prototype = { */ function TraceLog() { - this._calls = []; - this._resourceCache = new Cache(); + this._replayableCalls = []; + this._replayablesCache = new Cache(); } TraceLog.prototype = { @@ -363,7 +576,15 @@ TraceLog.prototype = { */ size: function() { - return this._calls.length; + return this._replayableCalls.length; + }, + + /** + * @return {Array.<ReplayableCall>} + */ + replayableCalls: function() + { + return this._replayableCalls; }, /** @@ -379,8 +600,68 @@ TraceLog.prototype = { */ addCall: function(call) { - // FIXME: Clone call and push the clone. - this._calls.push(call); + // FIXME: Convert the call to a ReplayableCall and push it. + } +} + +/** + * @constructor + * @param {TraceLog} traceLog + */ +function TraceLogPlayer(traceLog) +{ + this._traceLog = traceLog; + this._nextReplayStep = 0; + this._replayWorldCache = new Cache(); +} + +TraceLogPlayer.prototype = { + /** + * @return {TraceLog} + */ + traceLog: function() + { + return this._traceLog; + }, + + /** + * @return {number} + */ + nextReplayStep: function() + { + return this._nextReplayStep; + }, + + reset: function() + { + // FIXME: Prevent memory leaks: detach and delete all old resources OR reuse them OR create a new replay canvas every time. + this._nextReplayStep = 0; + this._replayWorldCache.reset(); + }, + + step: function() + { + this.stepTo(this._nextReplayStep); + }, + + /** + * @param {number} stepNum + */ + stepTo: function(stepNum) + { + stepNum = Math.min(stepNum, this._traceLog.size() - 1); + console.assert(stepNum >= 0); + if (this._nextReplayStep > stepNum) + this.reset(); + // FIXME: Replay all the cached resources first to warm-up. + var replayableCalls = this._traceLog.replayableCalls(); + while (this._nextReplayStep <= stepNum) + replayableCalls[this._nextReplayStep++].replay(this._replayWorldCache); + }, + + replay: function() + { + this.stepTo(this._traceLog.size() - 1); } } @@ -445,6 +726,10 @@ ResourceTrackingManager.prototype = { this._stopCapturingOnFrameEnd = true; }, + /** + * @param {Resource} resource + * @param {Array|Arguments} args + */ captureArguments: function(resource, args) { if (!this._capturing) @@ -491,6 +776,10 @@ ResourceTrackingManager.prototype = { var InjectedScript = function() { this._manager = new ResourceTrackingManager(); + this._lastTraceLogId = 0; + this._traceLogs = {}; + this._traceLogPlayer = null; + this._replayContext = null; } InjectedScript.prototype = { @@ -508,7 +797,72 @@ InjectedScript.prototype = { captureFrame: function() { + var id = this._makeTraceLogId(); this._manager.captureFrame(); + this._traceLogs[id] = this._manager.lastTraceLog(); + return id; + }, + + /** + * @param {string} id + */ + dropTraceLog: function(id) + { + if (this._traceLogPlayer && this._traceLogPlayer.traceLog() === this._traceLogs[id]) + this._traceLogPlayer = null; + delete this._traceLogs[id]; + }, + + /** + * @param {string} id + * @return {Object|string} + */ + traceLog: function(id) + { + var traceLog = this._traceLogs[id]; + if (!traceLog) + return "Error: Trace log with this ID not found."; + var result = { + id: id, + calls: [] + }; + var calls = traceLog.replayableCalls(); + for (var i = 0, n = calls.length; i < n; ++i) { + var call = calls[i]; + result.calls.push({ + functionName: call.functionName() + "(" + call.args().join(", ") + ") => " + call.result() + }); + } + return result; + }, + + /** + * @param {string} id + * @param {number} stepNo + * @return {string} + */ + replayTraceLog: function(id, stepNo) + { + var traceLog = this._traceLogs[id]; + if (!traceLog) + return ""; + if (!this._traceLogPlayer || this._traceLogPlayer.traceLog() !== traceLog) + this._traceLogPlayer = new TraceLogPlayer(traceLog); + this._traceLogPlayer.stepTo(stepNo); + if (!this._replayContext) { + console.error("ASSERT_NOT_REACHED: replayTraceLog failed to create a replay canvas?!"); + return ""; + } + // Return current screenshot. + return this._replayContext.canvas.toDataURL(); + }, + + /** + * @return {string} + */ + _makeTraceLogId: function() + { + return "{\"injectedScriptId\":" + injectedScriptId + ",\"traceLogId\":" + (++this._lastTraceLogId) + "}"; } } diff --git a/Source/WebCore/inspector/Inspector.json b/Source/WebCore/inspector/Inspector.json index 6fed8dc71..4aba46a69 100644 --- a/Source/WebCore/inspector/Inspector.json +++ b/Source/WebCore/inspector/Inspector.json @@ -2144,7 +2144,11 @@ }, { "id": "ShorthandEntry", - "type": "object" + "type": "object", + "properties": [ + { "name": "name", "type": "string", "description": "Shorthand name." }, + { "name": "value", "type": "string", "description": "Shorthand value." } + ] }, { "id": "CSSPropertyInfo", diff --git a/Source/WebCore/inspector/InspectorOverlay.cpp b/Source/WebCore/inspector/InspectorOverlay.cpp index 21bd0ed49..981b2552b 100644 --- a/Source/WebCore/inspector/InspectorOverlay.cpp +++ b/Source/WebCore/inspector/InspectorOverlay.cpp @@ -33,6 +33,7 @@ #include "InspectorOverlay.h" #include "Element.h" +#include "Font.h" #include "FontCache.h" #include "FontFamily.h" #include "Frame.h" diff --git a/Source/WebCore/inspector/InspectorStyleSheet.cpp b/Source/WebCore/inspector/InspectorStyleSheet.cpp index 730e36bb8..83b402d6e 100644 --- a/Source/WebCore/inspector/InspectorStyleSheet.cpp +++ b/Source/WebCore/inspector/InspectorStyleSheet.cpp @@ -493,7 +493,7 @@ PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() con populateAllProperties(&properties); RefPtr<Array<TypeBuilder::CSS::CSSProperty> > propertiesObject = Array<TypeBuilder::CSS::CSSProperty>::create(); - RefPtr<Array<InspectorObject> > shorthandEntries = Array<InspectorObject>::create(); + RefPtr<Array<TypeBuilder::CSS::ShorthandEntry> > shorthandEntries = Array<TypeBuilder::CSS::ShorthandEntry>::create(); HashMap<String, RefPtr<TypeBuilder::CSS::CSSProperty> > propertyNameToPreviousActiveProperty; HashSet<String> foundShorthands; @@ -557,10 +557,10 @@ PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyle::styleWithProperties() con if (!shorthand.isEmpty()) { if (!foundShorthands.contains(shorthand)) { foundShorthands.add(shorthand); - RefPtr<InspectorObject> shorthandEntry = InspectorObject::create(); - shorthandEntry->setString("name", shorthand); - shorthandEntry->setString("value", shorthandValue(shorthand)); - shorthandEntries->addItem(shorthandEntry.release()); + RefPtr<TypeBuilder::CSS::ShorthandEntry> entry = TypeBuilder::CSS::ShorthandEntry::create() + .setName(shorthand) + .setValue(shorthandValue(shorthand)); + shorthandEntries->addItem(entry); } } } @@ -949,7 +949,7 @@ PassRefPtr<TypeBuilder::CSS::CSSStyle> InspectorStyleSheet::buildObjectForStyle( if (id.isEmpty()) { RefPtr<TypeBuilder::CSS::CSSStyle> bogusStyle = TypeBuilder::CSS::CSSStyle::create() .setCssProperties(Array<TypeBuilder::CSS::CSSProperty>::create()) - .setShorthandEntries(Array<InspectorObject>::create()); + .setShorthandEntries(Array<TypeBuilder::CSS::ShorthandEntry>::create()); return bogusStyle.release(); } RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id); diff --git a/Source/WebCore/inspector/compile-front-end.py b/Source/WebCore/inspector/compile-front-end.py index d956e3dbf..449131936 100755 --- a/Source/WebCore/inspector/compile-front-end.py +++ b/Source/WebCore/inspector/compile-front-end.py @@ -30,42 +30,32 @@ import os import os.path import generate_protocol_externs +import sys inspector_path = "Source/WebCore/inspector" inspector_frontend_path = inspector_path + "/front-end" generate_protocol_externs.generate_protocol_externs(inspector_frontend_path + "/protocol-externs.js", inspector_path + "/Inspector.json") -externs = ["externs.js", "protocol-externs.js"] jsmodule_name_prefix = "jsmodule_" modules = [ { - "target_name": "util", + "name": "common", "dependencies": [], "sources": [ - "DOMExtension.js", - "utilities.js", - "treeoutline.js", - ] - }, - { - "target_name": "common", - "dependencies": ["util"], - "sources": [ + "Color.js", "Object.js", "Settings.js", + "UIString.js", "UserMetrics.js", - "HandlerRegistry.js", - "InspectorFrontendHostStub.js", + "utilities.js", ] }, { - "target_name": "sdk", + "name": "sdk", "dependencies": ["common"], "sources": [ - "InspectorBackend.js", "ApplicationCacheModel.js", - "Color.js", "CompilerScriptMapping.js", "ConsoleModel.js", "ContentProvider.js", @@ -85,9 +75,10 @@ modules = [ "FileUtils.js", "HAREntry.js", "IndexedDBModel.js", + "InspectorBackend.js", + "JavaScriptSource.js", "Linkifier.js", "NetworkLog.js", - "Placard.js", "PresentationConsoleMessageHelper.js", "SASSSourceMapping.js", "Script.js", @@ -109,27 +100,29 @@ modules = [ "UISourceCode.js", "UserAgentSupport.js", "Workspace.js", + "protocol-externs.js", ] }, { - "target_name": "ui", + "name": "ui", "dependencies": ["common"], "sources": [ - "AdvancedSearchController.js", "Checkbox.js", "ContextMenu.js", - "CookiesTable.js", + "DOMExtension.js", "DOMSyntaxHighlighter.js", "DataGrid.js", "DefaultTextEditor.js", "Dialog.js", "Drawer.js", "EmptyView.js", + "GoToLineDialog.js", "HelpScreen.js", "InspectorView.js", "KeyboardShortcut.js", "Panel.js", "PanelEnablerView.js", + "Placard.js", "Popover.js", "ProgressBar.js", "PropertiesSection.js", @@ -150,33 +143,33 @@ modules = [ "TextEditorHighlighter.js", "TextEditorModel.js", "TextPrompt.js", + "TimelineGrid.js", "Toolbar.js", "UIUtils.js", "View.js", + "treeoutline.js", ] }, { - "target_name": "components", + "name": "components", "dependencies": ["sdk", "ui"], "sources": [ + "AdvancedSearchController.js", + "HandlerRegistry.js", "ConsoleMessage.js", + "CookiesTable.js", "DOMBreakpointsSidebarPane.js", "DOMPresentationUtils.js", "ElementsTreeOutline.js", - "GoToLineDialog.js", "NativeBreakpointsSidebarPane.js", - "NavigatorOverlayController.js", - "NavigatorView.js", "JavaScriptContextManager.js", - "JavaScriptSource.js", "ObjectPopoverHelper.js", "ObjectPropertiesSection.js", "SourceFrame.js", - "TimelineGrid.js", ] }, { - "target_name": "elements", + "name": "elements", "dependencies": ["components"], "sources": [ "ElementsPanel.js", @@ -187,7 +180,7 @@ modules = [ ] }, { - "target_name": "network", + "name": "network", "dependencies": ["components"], "sources": [ "FontView.js", @@ -207,7 +200,7 @@ modules = [ ] }, { - "target_name": "resources", + "name": "resources", "dependencies": ["components"], "sources": [ "ApplicationCacheItemsView.js", @@ -223,13 +216,15 @@ modules = [ ] }, { - "target_name": "scripts", + "name": "scripts", "dependencies": ["components"], "sources": [ "BreakpointsSidebarPane.js", "CallStackSidebarPane.js", "FilteredItemSelectionDialog.js", "JavaScriptSourceFrame.js", + "NavigatorOverlayController.js", + "NavigatorView.js", "RevisionHistoryView.js", "ScopeChainSidebarPane.js", "ScriptsNavigator.js", @@ -244,7 +239,7 @@ modules = [ ] }, { - "target_name": "console", + "name": "console", "dependencies": ["components"], "sources": [ "ConsoleView.js", @@ -252,7 +247,7 @@ modules = [ ] }, { - "target_name": "timeline", + "name": "timeline", "dependencies": ["components"], "sources": [ "MemoryStatistics.js", @@ -264,7 +259,7 @@ modules = [ ] }, { - "target_name": "audits", + "name": "audits", "dependencies": ["components"], "sources": [ "AuditCategories.js", @@ -276,7 +271,7 @@ modules = [ ] }, { - "target_name": "extensions", + "name": "extensions", "dependencies": ["components"], "sources": [ "ExtensionAPI.js", @@ -288,22 +283,28 @@ modules = [ ] }, { - "target_name": "inspector", + "name": "settings", "dependencies": ["components", "extensions"], "sources": [ "SettingsScreen.js", + ] + }, + { + "name": "workers", + "dependencies": ["components"], + "sources": [ "WorkerManager.js", ] }, { - "target_name": "tests", + "name": "tests", "dependencies": ["components"], "sources": [ "TestController.js", ] }, { - "target_name": "profiler", + "name": "profiler", "dependencies": ["components"], "sources": [ "BottomUpProfileDataGridTree.js", @@ -324,33 +325,30 @@ modules = [ "TopDownProfileDataGridTree.js", ] }, -# { -# "target_name": "tokenizers", -# "dependencies": ["components"], -# "sources": [ -# "SourceCSSTokenizer.js", -# "SourceHTMLTokenizer.js", -# "SourceJavaScriptTokenizer.js", -# ] -# }, + { + "name": "host_stub", + "dependencies": ["ui"], + "sources": [ + "InspectorFrontendHostStub.js", + ] + }, ] -# To be compiled... -# -# [Misc] -# inspector -# SettingsScreen -# JavaScriptFormatter -# ScriptFormatterWorker +modules_by_name = {} +for module in modules: + modules_by_name[module["name"]] = module -compiler_command = "java -jar ~/closure/compiler.jar --summary_detail_level 3 --compilation_level SIMPLE_OPTIMIZATIONS --warning_level VERBOSE --language_in ECMASCRIPT5 --accept_const_keyword \\\n" -command = compiler_command -for extern in externs: - command += " --externs " + inspector_frontend_path + "/" + extern - command += " \\\n" -for module in modules: - command += " --module " + jsmodule_name_prefix + module["target_name"] + ":" +def dump_module(name, recursively, processed_modules): + if name in processed_modules: + return "" + processed_modules[name] = True + module = modules_by_name[name] + command = "" + if recursively: + for dependency in module["dependencies"]: + command += dump_module(dependency, recursively, processed_modules) + command += " \\\n --module " + jsmodule_name_prefix + module["name"] + ":" command += str(len(module["sources"])) firstDependency = True for dependency in module["dependencies"]: @@ -360,31 +358,49 @@ for module in modules: command += "," firstDependency = False command += jsmodule_name_prefix + dependency - command += " \\\n" for script in module["sources"]: - command += " --js " + inspector_frontend_path + "/" + script - command += " \\\n" -command += "\n" -os.system(command) + command += " \\\n --js " + inspector_frontend_path + "/" + script + return command + +compiler_command = "java -jar ~/closure/compiler.jar --summary_detail_level 3 --compilation_level SIMPLE_OPTIMIZATIONS --warning_level VERBOSE --language_in ECMASCRIPT5 --accept_const_keyword \\\n" + +process_recursively = len(sys.argv) == 2 +if process_recursively: + module_name = sys.argv[1] + if module_name != "all": + modules = [modules_by_name[sys.argv[1]]] + for module in modules: + command = compiler_command + command += " --externs " + inspector_frontend_path + "/externs.js" + command += dump_module(module["name"], True, {}) + print "Compiling \"" + module["name"] + "\"" + os.system(command) +else: + command = compiler_command + command += " --externs " + inspector_frontend_path + "/externs.js" + for module in modules: + command += dump_module(module["name"], False, {}) + os.system(command) -print "Compiling InjectedScriptSource.js..." -os.system("echo \"var injectedScriptValue = \" > " + inspector_path + "/" + "InjectedScriptSourceTmp.js") -os.system("cat " + inspector_path + "/" + "InjectedScriptSource.js" + " >> " + inspector_path + "/" + "InjectedScriptSourceTmp.js") -command = compiler_command -command += " --externs " + inspector_path + "/" + "InjectedScriptExterns.js" + " \\\n" -command += " --module " + jsmodule_name_prefix + "injected_script" + ":" + "1" + " \\\n" -command += " --js " + inspector_path + "/" + "InjectedScriptSourceTmp.js" + " \\\n" -command += "\n" -os.system(command) -os.system("rm " + inspector_path + "/" + "InjectedScriptSourceTmp.js") +if not process_recursively: + print "Compiling InjectedScriptSource.js..." + os.system("echo \"var injectedScriptValue = \" > " + inspector_path + "/" + "InjectedScriptSourceTmp.js") + os.system("cat " + inspector_path + "/" + "InjectedScriptSource.js" + " >> " + inspector_path + "/" + "InjectedScriptSourceTmp.js") + command = compiler_command + command += " --externs " + inspector_path + "/" + "InjectedScriptExterns.js" + " \\\n" + command += " --module " + jsmodule_name_prefix + "injected_script" + ":" + "1" + " \\\n" + command += " --js " + inspector_path + "/" + "InjectedScriptSourceTmp.js" + " \\\n" + command += "\n" + os.system(command) + os.system("rm " + inspector_path + "/" + "InjectedScriptSourceTmp.js") -print "Compiling InjectedScriptWebGLModuleSource.js..." -os.system("echo \"var injectedScriptWebGLModuleValue = \" > " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") -os.system("cat " + inspector_path + "/" + "InjectedScriptWebGLModuleSource.js" + " >> " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") -command = compiler_command -command += " --externs " + inspector_path + "/" + "InjectedScriptExterns.js" + " \\\n" -command += " --module " + jsmodule_name_prefix + "injected_script" + ":" + "1" + " \\\n" -command += " --js " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js" + " \\\n" -command += "\n" -os.system(command) -os.system("rm " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") + print "Compiling InjectedScriptWebGLModuleSource.js..." + os.system("echo \"var injectedScriptWebGLModuleValue = \" > " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") + os.system("cat " + inspector_path + "/" + "InjectedScriptWebGLModuleSource.js" + " >> " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") + command = compiler_command + command += " --externs " + inspector_path + "/" + "InjectedScriptExterns.js" + " \\\n" + command += " --module " + jsmodule_name_prefix + "injected_script" + ":" + "1" + " \\\n" + command += " --js " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js" + " \\\n" + command += "\n" + os.system(command) + os.system("rm " + inspector_path + "/" + "InjectedScriptWebGLModuleSourceTmp.js") diff --git a/Source/WebCore/inspector/front-end/CompilerScriptMapping.js b/Source/WebCore/inspector/front-end/CompilerScriptMapping.js index df5ca2cb3..4d362d0e5 100644 --- a/Source/WebCore/inspector/front-end/CompilerScriptMapping.js +++ b/Source/WebCore/inspector/front-end/CompilerScriptMapping.js @@ -260,6 +260,9 @@ WebInspector.SourceMapParser.prototype = { this._parseMap(mappingPayload, 0, 0); }, + /** + * @param {Array.<SourceMapV3.Section>} sections + */ _parseSections: function(sections) { for (var i = 0; i < sections.length; ++i) { @@ -268,6 +271,11 @@ WebInspector.SourceMapParser.prototype = { } }, + /** + * @param {SourceMapV3} map + * @param {number} lineNumber + * @param {number} columnNumber + */ _parseMap: function(map, lineNumber, columnNumber) { var sourceIndex = 0; diff --git a/Source/WebCore/inspector/front-end/ConsoleModel.js b/Source/WebCore/inspector/front-end/ConsoleModel.js index 2e2abdd1a..040296ea7 100644 --- a/Source/WebCore/inspector/front-end/ConsoleModel.js +++ b/Source/WebCore/inspector/front-end/ConsoleModel.js @@ -162,6 +162,7 @@ WebInspector.ConsoleMessage = function(source, level, url, line, repeatCount) this.level = level; this.url = url || null; this.line = line || 0; + this.message = ""; repeatCount = repeatCount || 1; this.repeatCount = repeatCount; @@ -189,6 +190,11 @@ WebInspector.ConsoleMessage.prototype = { clone: function() { // Implemented by concrete instances + }, + + location: function() + { + // Implemented by concrete instances } } diff --git a/Source/WebCore/inspector/front-end/DOMAgent.js b/Source/WebCore/inspector/front-end/DOMAgent.js index eedebe573..45f201c1d 100644 --- a/Source/WebCore/inspector/front-end/DOMAgent.js +++ b/Source/WebCore/inspector/front-end/DOMAgent.js @@ -1076,7 +1076,7 @@ WebInspector.DOMAgent.prototype = { }, /** - * @param {DOMAgent.Node} node + * @param {WebInspector.DOMNode} node */ _unbind: function(node) { diff --git a/Source/WebCore/inspector/front-end/DOMStorage.js b/Source/WebCore/inspector/front-end/DOMStorage.js index cdb32f415..df977711a 100644 --- a/Source/WebCore/inspector/front-end/DOMStorage.js +++ b/Source/WebCore/inspector/front-end/DOMStorage.js @@ -85,10 +85,69 @@ WebInspector.DOMStorage.prototype = { /** * @constructor + * @extends {WebInspector.Object} + */ +WebInspector.DOMStorageModel = function() +{ + this._storages = {}; + InspectorBackend.registerDOMStorageDispatcher(new WebInspector.DOMStorageDispatcher(this)); + DOMStorageAgent.enable(); +} + +WebInspector.DOMStorageModel.Events = { + DOMStorageAdded: "DOMStorageAdded", + DOMStorageUpdated: "DOMStorageUpdated" +} + +WebInspector.DOMStorageModel.prototype = { + /** + * @param {WebInspector.DOMStorage} domStorage + */ + _addDOMStorage: function(domStorage) + { + this._storages[domStorage.id] = domStorage; + this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageAdded, domStorage); + }, + + /** + * @param {DOMStorageAgent.StorageId} storageId + */ + _domStorageUpdated: function(storageId) + { + this.dispatchEventToListeners(WebInspector.DOMStorageModel.Events.DOMStorageUpdated, this._storages[storageId]); + }, + + /** + * @param {DOMStorageAgent.StorageId} storageId + * @return {WebInspector.DOMStorage} + */ + storageForId: function(storageId) + { + return this._storages[storageId]; + }, + + /** + * @return {Array.<WebInspector.DOMStorage>} + */ + storages: function() + { + var result = []; + for (var storageId in this._storages) + result.push(this._storages[storageId]); + return result; + } +} + +WebInspector.DOMStorageModel.prototype.__proto__ = WebInspector.Object.prototype; + +/** + * @constructor * @implements {DOMStorageAgent.Dispatcher} + * @param {WebInspector.DOMStorageModel} model */ -WebInspector.DOMStorageDispatcher = function() +WebInspector.DOMStorageDispatcher = function(model) { + this._model = model; } WebInspector.DOMStorageDispatcher.prototype = { @@ -98,11 +157,10 @@ WebInspector.DOMStorageDispatcher.prototype = { */ addDOMStorage: function(payload) { - var domStorage = new WebInspector.DOMStorage( + this._model._addDOMStorage(new WebInspector.DOMStorage( payload.id, payload.origin, - payload.isLocalStorage); - WebInspector.panel("resources").addDOMStorage(domStorage); + payload.isLocalStorage)); }, /** @@ -110,6 +168,11 @@ WebInspector.DOMStorageDispatcher.prototype = { */ domStorageUpdated: function(storageId) { - WebInspector.panel("resources").domStorageUpdated(storageId); + this._model._domStorageUpdated(storageId); } } + +/** + * @type {WebInspector.DOMStorageModel} + */ +WebInspector.domStorageModel = null; diff --git a/Source/WebCore/inspector/front-end/Database.js b/Source/WebCore/inspector/front-end/Database.js index 6e94adb48..72389c5ab 100644 --- a/Source/WebCore/inspector/front-end/Database.js +++ b/Source/WebCore/inspector/front-end/Database.js @@ -28,9 +28,11 @@ /** * @constructor + * @param {WebInspector.DatabaseModel} model */ -WebInspector.Database = function(id, domain, name, version) +WebInspector.Database = function(model, id, domain, name, version) { + this._model = model; this._id = id; this._domain = domain; this._name = name; @@ -113,18 +115,100 @@ WebInspector.Database.prototype = { onError(WebInspector.UIString("Database not found.")); return; } - WebInspector.DatabaseDispatcher._callbacks[transactionId] = {"onSuccess": onSuccess, "onError": onError}; + this._model._callbacks[transactionId] = {"onSuccess": onSuccess, "onError": onError}; } - DatabaseAgent.executeSQL(this._id, query, callback); + DatabaseAgent.executeSQL(this._id, query, callback.bind(this)); } } /** * @constructor + * @extends {WebInspector.Object} + */ +WebInspector.DatabaseModel = function() +{ + this._callbacks = {}; + this._databases = []; + InspectorBackend.registerDatabaseDispatcher(new WebInspector.DatabaseDispatcher(this)); + DatabaseAgent.enable(); +} + +WebInspector.DatabaseModel.Events = { + DatabaseAdded: "DatabaseAdded" +} + +WebInspector.DatabaseModel.prototype = { + /** + * @return {Array.<WebInspector.Database>} + */ + databases: function() + { + var result = []; + for (var databaseId in this._databases) + result.push(this._databases[databaseId]); + return result; + }, + + /** + * @param {DatabaseAgent.DatabaseId} databaseId + * @return {WebInspector.Database} + */ + databaseForId: function(databaseId) + { + return this._databases[databaseId]; + }, + + /** + * @param {WebInspector.Database} database + */ + _addDatabase: function(database) + { + this._databases.push(database); + this.dispatchEventToListeners(WebInspector.DatabaseModel.Events.DatabaseAdded, database); + }, + + /** + * @param {number} transactionId + * @param {Array.<string>} columnNames + * @param {Array.<*>} values + */ + _sqlTransactionSucceeded: function(transactionId, columnNames, values) + { + if (!this._callbacks[transactionId]) + return; + + var callback = this._callbacks[transactionId]["onSuccess"]; + delete this._callbacks[transactionId]; + if (callback) + callback(columnNames, values); + }, + + /** + * @param {number} transactionId + * @param {?DatabaseAgent.Error} errorObj + */ + _sqlTransactionFailed: function(transactionId, errorObj) + { + if (!this._callbacks[transactionId]) + return; + + var callback = this._callbacks[transactionId]["onError"]; + delete this._callbacks[transactionId]; + if (callback) + callback(errorObj); + } +} + +WebInspector.DatabaseModel.prototype.__proto__ = WebInspector.Object.prototype; + +/** + * @constructor * @implements {DatabaseAgent.Dispatcher} + * @param {WebInspector.DatabaseModel} model */ -WebInspector.DatabaseDispatcher = function() +WebInspector.DatabaseDispatcher = function(model) { + this._model = model; } WebInspector.DatabaseDispatcher._callbacks = {}; @@ -135,12 +219,12 @@ WebInspector.DatabaseDispatcher.prototype = { */ addDatabase: function(payload) { - var database = new WebInspector.Database( + this._model._addDatabase(new WebInspector.Database( + this._model, payload.id, payload.domain, payload.name, - payload.version); - WebInspector.panel("resources").addDatabase(database); + payload.version)); }, /** @@ -150,13 +234,7 @@ WebInspector.DatabaseDispatcher.prototype = { */ sqlTransactionSucceeded: function(transactionId, columnNames, values) { - if (!WebInspector.DatabaseDispatcher._callbacks[transactionId]) - return; - - var callback = WebInspector.DatabaseDispatcher._callbacks[transactionId]["onSuccess"]; - delete WebInspector.DatabaseDispatcher._callbacks[transactionId]; - if (callback) - callback(columnNames, values); + this._model._sqlTransactionSucceeded(transactionId, columnNames, values); }, /** @@ -165,12 +243,11 @@ WebInspector.DatabaseDispatcher.prototype = { */ sqlTransactionFailed: function(transactionId, errorObj) { - if (!WebInspector.DatabaseDispatcher._callbacks[transactionId]) - return; - - var callback = WebInspector.DatabaseDispatcher._callbacks[transactionId]["onError"]; - delete WebInspector.DatabaseDispatcher._callbacks[transactionId]; - if (callback) - callback(errorObj); + this._model._sqlTransactionFailed(transactionId, errorObj); } } + +/** + * @type {WebInspector.DatabaseModel} + */ +WebInspector.databaseModel = null; diff --git a/Source/WebCore/inspector/front-end/DebuggerModel.js b/Source/WebCore/inspector/front-end/DebuggerModel.js index 8c6c8e0a8..e8e2d4b4f 100644 --- a/Source/WebCore/inspector/front-end/DebuggerModel.js +++ b/Source/WebCore/inspector/front-end/DebuggerModel.js @@ -647,6 +647,7 @@ WebInspector.DebuggerDispatcher.prototype = { * @param {number} endLine * @param {number} endColumn * @param {boolean=} isContentScript + * @param {string=} sourceMapURL */ scriptParsed: function(scriptId, sourceURL, startLine, startColumn, endLine, endColumn, isContentScript, sourceMapURL) { diff --git a/Source/WebCore/inspector/front-end/FileUtils.js b/Source/WebCore/inspector/front-end/FileUtils.js index 07fe25f5c..34ec16e50 100644 --- a/Source/WebCore/inspector/front-end/FileUtils.js +++ b/Source/WebCore/inspector/front-end/FileUtils.js @@ -36,21 +36,33 @@ WebInspector.OutputStreamDelegate = function() } WebInspector.OutputStreamDelegate.prototype = { - onTransferStarted: function(source) - { - }, + onTransferStarted: function(source) { }, - onChunkTransferred: function(source) - { - }, + onChunkTransferred: function(source) { }, - onTransferFinished: function(source) - { - }, + onTransferFinished: function(source) { }, - onError: function(source, event) - { - } + onError: function(source, event) { } +} + +/** + * @interface + */ +WebInspector.OutputStream = function() +{ +} + +WebInspector.OutputStream.prototype = { + startTransfer: function() { }, + + /** + * @param {string} chunk + */ + transferChunk: function(chunk) { }, + + finishTransfer: function() { }, + + dispose: function() { } } /** diff --git a/Source/WebCore/inspector/front-end/HandlerRegistry.js b/Source/WebCore/inspector/front-end/HandlerRegistry.js index e13f56d9c..84ae7fda5 100644 --- a/Source/WebCore/inspector/front-end/HandlerRegistry.js +++ b/Source/WebCore/inspector/front-end/HandlerRegistry.js @@ -184,3 +184,9 @@ WebInspector.HandlerSelector.prototype = this._handlerRegistry.activeHandler = value; } } + + +/** + * @type {WebInspector.HandlerRegistry} + */ +WebInspector.openAnchorLocationRegistry = null; diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotView.js b/Source/WebCore/inspector/front-end/HeapSnapshotView.js index a26a6592a..b7f5019fd 100644 --- a/Source/WebCore/inspector/front-end/HeapSnapshotView.js +++ b/Source/WebCore/inspector/front-end/HeapSnapshotView.js @@ -784,35 +784,6 @@ WebInspector.HeapSnapshotProfileType.prototype = { WebInspector.HeapSnapshotProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype; - -/** - * @interface - */ -WebInspector.OutputStream = function() -{ -} - -WebInspector.OutputStream.prototype = { - startTransfer: function() - { - }, - - /** - * @param {string} chunk - */ - transferChunk: function(chunk) - { - }, - - finishTransfer: function() - { - }, - - dispose: function() - { - } -}; - /** * @constructor * @extends {WebInspector.ProfileHeader} diff --git a/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js index 61d8ae87f..dc2701cd0 100644 --- a/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js +++ b/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js @@ -32,6 +32,7 @@ if (!window.InspectorFrontendHost) { /** * @constructor + * @implements {InspectorFrontendHostAPI} */ WebInspector.InspectorFrontendHostStub = function() { @@ -192,7 +193,7 @@ WebInspector.InspectorFrontendHostStub.prototype = { } } -var InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub(); +InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub(); Preferences.localizeUI = false; // Default implementation; platforms will override. diff --git a/Source/WebCore/inspector/front-end/InspectorView.js b/Source/WebCore/inspector/front-end/InspectorView.js index e5799babe..b521a9d1d 100644 --- a/Source/WebCore/inspector/front-end/InspectorView.js +++ b/Source/WebCore/inspector/front-end/InspectorView.js @@ -237,6 +237,15 @@ WebInspector.InspectorView.prototype = { this._panelsElement.style.bottom = 0; } this.doResize(); + }, + + /** + * @param {WebInspector.Panel} panel + */ + showPanelForAnchorNavigation: function(panel) + { + WebInspector.searchController.disableSearchUntilExplicitAction(); + this.setCurrentPanel(panel); } } diff --git a/Source/WebCore/inspector/front-end/PresentationConsoleMessageHelper.js b/Source/WebCore/inspector/front-end/PresentationConsoleMessageHelper.js index 0d63f27de..a0cc97848 100644 --- a/Source/WebCore/inspector/front-end/PresentationConsoleMessageHelper.js +++ b/Source/WebCore/inspector/front-end/PresentationConsoleMessageHelper.js @@ -101,7 +101,7 @@ WebInspector.PresentationConsoleMessageHelper.prototype = { var pendingMessages = []; for (var i = 0; i < messages.length; i++) { var message = messages[i]; - var rawLocation = message.location(); + var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ message.location(); if (script.scriptId === rawLocation.scriptId) this._addConsoleMessageToScript(message, rawLocation); else diff --git a/Source/WebCore/inspector/front-end/RequestCookiesView.js b/Source/WebCore/inspector/front-end/RequestCookiesView.js index dbaf9d36a..d8d5da840 100644 --- a/Source/WebCore/inspector/front-end/RequestCookiesView.js +++ b/Source/WebCore/inspector/front-end/RequestCookiesView.js @@ -61,7 +61,7 @@ WebInspector.RequestCookiesView.prototype = { get _gotCookies() { - return !!(this._request.requestCookies || this._request.responseCookies); + return (this._request.requestCookies && this._request.requestCookies.length) || (this._request.responseCookies && this._request.responseCookies.length); }, _buildCookiesTable: function() diff --git a/Source/WebCore/inspector/front-end/ResourcesPanel.js b/Source/WebCore/inspector/front-end/ResourcesPanel.js index 22aebced5..8ddcd2520 100644 --- a/Source/WebCore/inspector/front-end/ResourcesPanel.js +++ b/Source/WebCore/inspector/front-end/ResourcesPanel.js @@ -87,8 +87,11 @@ WebInspector.ResourcesPanel = function(database) this.storageViewStatusBarItemsContainer = document.createElement("div"); this.storageViewStatusBarItemsContainer.className = "status-bar-items"; - this._databases = []; - this._domStorage = []; + this._databaseTableViews = new Map(); + this._databaseQueryViews = new Map(); + this._databaseTreeElements = new Map(); + this._domStorageViews = new Map(); + this._domStorageTreeElements = new Map(); this._cookieViews = {}; this._origins = {}; this._domains = {}; @@ -102,11 +105,19 @@ WebInspector.ResourcesPanel = function(database) } WebInspector.GoToLineDialog.install(this, viewGetter.bind(this)); + if (WebInspector.resourceTreeModel.cachedResourcesLoaded()) + this._cachedResourcesLoaded(); + WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.OnLoad, this._onLoadEventFired, this); WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._cachedResourcesLoaded, this); WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources, this._resetWithFrames, this); - if (WebInspector.resourceTreeModel.cachedResourcesLoaded()) - this._cachedResourcesLoaded(); + + WebInspector.databaseModel.databases().forEach(this._addDatabase.bind(this)); + WebInspector.databaseModel.addEventListener(WebInspector.DatabaseModel.Events.DatabaseAdded, this._databaseAdded, this); + + WebInspector.domStorageModel.storages().forEach(this._addDOMStorage.bind(this)); + WebInspector.domStorageModel.addEventListener(WebInspector.DOMStorageModel.Events.DOMStorageAdded, this._domStorageAdded, this); + WebInspector.domStorageModel.addEventListener(WebInspector.DOMStorageModel.Events.DOMStorageUpdated, this._domStorageUpdated, this); } WebInspector.ResourcesPanel.prototype = { @@ -167,22 +178,14 @@ WebInspector.ResourcesPanel.prototype = { { this._origins = {}; this._domains = {}; - for (var i = 0; i < this._databases.length; ++i) { - var database = this._databases[i]; - delete database._tableViews; - if (database._queryView) - database._queryView.removeEventListener(WebInspector.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabaseTables, this); - delete database._queryView; - } - this._databases = []; - - var domStorageLength = this._domStorage.length; - for (var i = 0; i < this._domStorage.length; ++i) { - var domStorage = this._domStorage[i]; - delete domStorage._domStorageView; - } - this._domStorage = []; - + var queryViews = this._databaseQueryViews.values(); + for (var i = 0; i < queryViews.length; ++i) + queryViews[i].removeEventListener(WebInspector.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabaseTables, this); + this._databaseTableViews.clear(); + this._databaseQueryViews.clear(); + this._databaseTreeElements.clear(); + this._domStorageViews.clear(); + this._domStorageTreeElements.clear(); this._cookieViews = {}; this.databasesListTreeElement.removeChildren(); @@ -289,12 +292,22 @@ WebInspector.ResourcesPanel.prototype = { this._initialize(); }, - addDatabase: function(database) + /** + * @param {WebInspector.Event} event + */ + _databaseAdded: function(event) { - this._databases.push(database); + var database = /** @type {WebInspector.Database} */ event.data; + this._addDatabase(database); + }, + /** + * @param {WebInspector.Database} database + */ + _addDatabase: function(database) + { var databaseTreeElement = new WebInspector.DatabaseTreeElement(this, database); - database._databasesTreeElement = databaseTreeElement; + this._databaseTreeElements.put(database, databaseTreeElement); this.databasesListTreeElement.appendChild(databaseTreeElement); }, @@ -313,36 +326,47 @@ WebInspector.ResourcesPanel.prototype = { } }, - addDOMStorage: function(domStorage) + /** + * @param {WebInspector.Event} event + */ + _domStorageAdded: function(event) + { + var domStorage = /** @type {WebInspector.DOMStorage}*/ event.data; + this._addDOMStorage(domStorage); + }, + + /** + * @param {WebInspector.DOMStorage} domStorage + */ + _addDOMStorage: function(domStorage) { - this._domStorage.push(domStorage); var domStorageTreeElement = new WebInspector.DOMStorageTreeElement(this, domStorage, (domStorage.isLocalStorage ? "local-storage" : "session-storage")); - domStorage._domStorageTreeElement = domStorageTreeElement; + this._domStorageTreeElements.put(domStorage, domStorageTreeElement); if (domStorage.isLocalStorage) this.localStorageListTreeElement.appendChild(domStorageTreeElement); else this.sessionStorageListTreeElement.appendChild(domStorageTreeElement); }, - selectDatabase: function(databaseId) + /** + * @param {WebInspector.Database} database + */ + selectDatabase: function(database) { - var database; - for (var i = 0, len = this._databases.length; i < len; ++i) { - database = this._databases[i]; - if (database.id === databaseId) { - this.showDatabase(database); - database._databasesTreeElement.select(); - return; - } + if (database) { + this._showDatabase(database); + this._databaseTreeElements.get(database).select(); } }, - selectDOMStorage: function(storageId) + /** + * @param {WebInspector.DOMStorage} domStorage + */ + selectDOMStorage: function(domStorage) { - var domStorage = this._domStorageForId(storageId); if (domStorage) { - this.showDOMStorage(domStorage); - domStorage._domStorageTreeElement.select(); + this._showDOMStorage(domStorage); + this._domStorageTreeElements.get(domStorage).select(); } }, @@ -400,25 +424,28 @@ WebInspector.ResourcesPanel.prototype = { /** * @param {string=} tableName */ - showDatabase: function(database, tableName) + _showDatabase: function(database, tableName) { if (!database) return; var view; if (tableName) { - if (!("_tableViews" in database)) - database._tableViews = {}; - view = database._tableViews[tableName]; + var tableViews = this._databaseTableViews.get(database); + if (!tableViews) { + tableViews = {}; + this._databaseTableViews.put(database, tableViews); + } + view = tableViews[tableName]; if (!view) { view = new WebInspector.DatabaseTableView(database, tableName); - database._tableViews[tableName] = view; + tableViews[tableName] = view; } } else { - view = database._queryView; + view = this._databaseQueryViews.get(database); if (!view) { view = new WebInspector.DatabaseQueryView(database); - database._queryView = view; + this._databaseQueryViews.put(database, view); view.addEventListener(WebInspector.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabaseTables, this); } } @@ -434,16 +461,16 @@ WebInspector.ResourcesPanel.prototype = { this._innerShowView(view); }, - showDOMStorage: function(domStorage) + _showDOMStorage: function(domStorage) { if (!domStorage) return; var view; - view = domStorage._domStorageView; + view = this._domStorageViews.get(domStorage); if (!view) { view = new WebInspector.DOMStorageItemsView(domStorage); - domStorage._domStorageView = view; + this._domStorageViews.put(domStorage, view); } this._innerShowView(view); @@ -513,12 +540,17 @@ WebInspector.ResourcesPanel.prototype = { { var database = event.data; - if (!database || !database._databasesTreeElement) + if (!database) + return; + + var databasesTreeElement = this._databaseTreeElements.get(database); + if (!databasesTreeElement) return; - database._databasesTreeElement.shouldRefreshChildren = true; + databasesTreeElement.shouldRefreshChildren = true; + var tableViews = this._databaseTableViews.get(database); - if (!("_tableViews" in database)) + if (!tableViews) return; var tableNamesHash = {}; @@ -529,26 +561,26 @@ WebInspector.ResourcesPanel.prototype = { for (var i = 0; i < tableNamesLength; ++i) tableNamesHash[tableNames[i]] = true; - for (var tableName in database._tableViews) { + for (var tableName in tableViews) { if (!(tableName in tableNamesHash)) { - if (self.visibleView === database._tableViews[tableName]) + if (self.visibleView === tableViews[tableName]) self.closeVisibleView(); - delete database._tableViews[tableName]; + delete tableViews[tableName]; } } } database.getTableNames(tableNamesCallback); }, - domStorageUpdated: function(storageId) + /** + * @param {WebInspector.Event} event + */ + _domStorageUpdated: function(event) { - var domStorage = this._domStorageForId(storageId); - if (!domStorage) - return; - - var view = domStorage._domStorageView; + var storage = /** @type {WebInspector.DOMStorage}*/ event.data; + var view = this._domStorageViews.get(storage); if (this.visibleView && view === this.visibleView) - domStorage._domStorageView.update(); + view.update(); }, _populateApplicationCacheTree: function() @@ -622,19 +654,6 @@ WebInspector.ResourcesPanel.prototype = { this._applicationCacheViews[manifestURL].updateNetworkState(isNowOnline); }, - _domStorageForId: function(storageId) - { - if (!this._domStorage) - return null; - var domStorageLength = this._domStorage.length; - for (var i = 0; i < domStorageLength; ++i) { - var domStorage = this._domStorage[i]; - if (domStorage.id == storageId) - return domStorage; - } - return null; - }, - sidebarResized: function(event) { var width = event.data; @@ -1322,7 +1341,7 @@ WebInspector.DatabaseTreeElement.prototype = { onselect: function() { WebInspector.BaseStorageTreeElement.prototype.onselect.call(this); - this._storagePanel.showDatabase(this._database); + this._storagePanel._showDatabase(this._database); }, onexpand: function() @@ -1366,7 +1385,7 @@ WebInspector.DatabaseTableTreeElement.prototype = { onselect: function() { WebInspector.BaseStorageTreeElement.prototype.onselect.call(this); - this._storagePanel.showDatabase(this._database, this._tableName); + this._storagePanel._showDatabase(this._database, this._tableName); } } WebInspector.DatabaseTableTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype; @@ -1852,7 +1871,7 @@ WebInspector.DOMStorageTreeElement.prototype = { onselect: function() { WebInspector.BaseStorageTreeElement.prototype.onselect.call(this); - this._storagePanel.showDOMStorage(this._domStorage); + this._storagePanel._showDOMStorage(this._domStorage); } } WebInspector.DOMStorageTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype; diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js index 1f688d6d8..08bd66af2 100644 --- a/Source/WebCore/inspector/front-end/ScriptsPanel.js +++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js @@ -28,6 +28,8 @@ importScript("BreakpointsSidebarPane.js"); importScript("CallStackSidebarPane.js"); importScript("FilteredItemSelectionDialog.js"); importScript("JavaScriptSourceFrame.js"); +importScript("NavigatorOverlayController.js"); +importScript("NavigatorView.js"); importScript("RevisionHistoryView.js"); importScript("ScopeChainSidebarPane.js"); importScript("ScriptsNavigator.js"); @@ -390,7 +392,7 @@ WebInspector.ScriptsPanel.prototype = { showFunctionDefinition: function(functionLocation) { - WebInspector.showPanelForAnchorNavigation(this); + WebInspector.inspectorView.showPanelForAnchorNavigation(this); var uiLocation = WebInspector.debuggerModel.rawLocationToUILocation(functionLocation); this._showSourceLine(uiLocation.uiSourceCode, uiLocation.lineNumber); }, diff --git a/Source/WebCore/inspector/front-end/SearchController.js b/Source/WebCore/inspector/front-end/SearchController.js index 372034d96..8d2e726d3 100644 --- a/Source/WebCore/inspector/front-end/SearchController.js +++ b/Source/WebCore/inspector/front-end/SearchController.js @@ -169,7 +169,7 @@ WebInspector.SearchController.prototype = { this._matchesElement.textContent = ""; }, - disableSearchUntilExplicitAction: function(event) + disableSearchUntilExplicitAction: function() { this._performSearch("", false, false); }, diff --git a/Source/WebCore/inspector/front-end/Settings.js b/Source/WebCore/inspector/front-end/Settings.js index cebc91d32..ee13ebc27 100644 --- a/Source/WebCore/inspector/front-end/Settings.js +++ b/Source/WebCore/inspector/front-end/Settings.js @@ -102,6 +102,7 @@ WebInspector.Settings = function() this.deviceOrientationOverride = this.createSetting("deviceOrientationOverride", ""); this.showHeapSnapshotObjectsHiddenProperties = this.createSetting("showHeaSnapshotObjectsHiddenProperties", false); this.searchInContentScripts = this.createSetting("searchInContentScripts", false); + this.textEditorIndent = this.createSetting("textEditorIndent", " "); // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused // periodical breakpoints duplication leading to inspector slowness. diff --git a/Source/WebCore/inspector/front-end/Spectrum.js b/Source/WebCore/inspector/front-end/Spectrum.js index 0c8ce544c..0cd4803e8 100644 --- a/Source/WebCore/inspector/front-end/Spectrum.js +++ b/Source/WebCore/inspector/front-end/Spectrum.js @@ -261,6 +261,9 @@ WebInspector.Spectrum.draggable = function(element, onmove, onstart, onstop) { }; WebInspector.Spectrum.prototype = { + /** + * @type {WebInspector.Color} + */ set color(color) { var rgba = (color.rgba || color.rgb).slice(0); diff --git a/Source/WebCore/inspector/front-end/TextEditorModel.js b/Source/WebCore/inspector/front-end/TextEditorModel.js index 4ab3c995b..068cf997b 100644 --- a/Source/WebCore/inspector/front-end/TextEditorModel.js +++ b/Source/WebCore/inspector/front-end/TextEditorModel.js @@ -532,5 +532,3 @@ WebInspector.TextEditorModel.prototype = { } WebInspector.TextEditorModel.prototype.__proto__ = WebInspector.Object.prototype; - -WebInspector.settings.textEditorIndent = WebInspector.settings.createSetting("textEditorIndent", WebInspector.TextEditorModel.Indent.FourSpaces); diff --git a/Source/WebCore/platform/graphics/chromium/LinkHighlight.h b/Source/WebCore/inspector/front-end/UIString.js index 2f97cab79..ec6a18857 100644 --- a/Source/WebCore/platform/graphics/chromium/LinkHighlight.h +++ b/Source/WebCore/inspector/front-end/UIString.js @@ -1,5 +1,8 @@ /* - * Copyright (C) 2012 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). + * Copyright (C) 2009 Joseph Pecoraro * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,6 +13,9 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -22,45 +28,26 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#ifndef LinkHighlight_h -#define LinkHighlight_h - -#include "ContentLayerChromium.h" -#include "Path.h" -#include <public/WebAnimationDelegate.h> -#include <wtf/RefPtr.h> - -#if USE(ACCELERATED_COMPOSITING) - -namespace WebCore { - -class GraphicsLayerChromium; - -class LinkHighlight : public RefCounted<LinkHighlight>, public ContentLayerDelegate, public WebKit::WebAnimationDelegate { -public: - static PassRefPtr<LinkHighlight> create(GraphicsLayerChromium* parent, const Path&, int animationId, int groupId); - virtual ~LinkHighlight(); - - ContentLayerChromium* contentLayer(); - - // ContentLayerDelegate implementation. - virtual void paintContents(SkCanvas*, const IntRect& clipRect, FloatRect& opaque) OVERRIDE; - - // WebAnimationDelegate implementation. - virtual void notifyAnimationStarted(double time) OVERRIDE; - virtual void notifyAnimationFinished(double time) OVERRIDE; - -private: - LinkHighlight(GraphicsLayerChromium* parent, const Path&, int animationId, int groupId); - - RefPtr<ContentLayerChromium> m_contentLayer; - GraphicsLayerChromium* m_parent; - Path m_path; -}; - -} // namespace WebCore - -#endif // USE(ACCELERATED_COMPOSITING) - -#endif + /** + * @param {string} string + * @param {...*} vararg + */ +WebInspector.UIString = function(string, vararg) +{ + if (Preferences.localizeUI) { + if (window.localizedStrings && string in window.localizedStrings) + string = window.localizedStrings[string]; + else { + if (!(string in WebInspector._missingLocalizedStrings)) { + console.warn("Localized string \"" + string + "\" not found."); + WebInspector._missingLocalizedStrings[string] = true; + } + + if (Preferences.showMissingLocalizedStrings) + string += " (not localized)"; + } + } + return String.vsprintf(string, Array.prototype.slice.call(arguments, 1)); +} + +WebInspector._missingLocalizedStrings = {}; diff --git a/Source/WebCore/inspector/front-end/UIUtils.js b/Source/WebCore/inspector/front-end/UIUtils.js index 9af5070e1..c1e07584e 100644 --- a/Source/WebCore/inspector/front-end/UIUtils.js +++ b/Source/WebCore/inspector/front-end/UIUtils.js @@ -680,30 +680,6 @@ Number.withThousandsSeparator = function(num) return str; } -WebInspector._missingLocalizedStrings = {}; - -/** - * @param {string} string - * @param {...*} vararg - */ -WebInspector.UIString = function(string, vararg) -{ - if (Preferences.localizeUI) { - if (window.localizedStrings && string in window.localizedStrings) - string = window.localizedStrings[string]; - else { - if (!(string in WebInspector._missingLocalizedStrings)) { - console.warn("Localized string \"" + string + "\" not found."); - WebInspector._missingLocalizedStrings[string] = true; - } - - if (Preferences.showMissingLocalizedStrings) - string += " (not localized)"; - } - } - return String.vsprintf(string, Array.prototype.slice.call(arguments, 1)); -} - WebInspector.useLowerCaseMenuTitles = function() { return WebInspector.platform() === "windows" && Preferences.useLowerCaseMenuTitlesOnWindows; diff --git a/Source/WebCore/inspector/front-end/WebKit.qrc b/Source/WebCore/inspector/front-end/WebKit.qrc index bd9b15512..c9c8497a5 100644 --- a/Source/WebCore/inspector/front-end/WebKit.qrc +++ b/Source/WebCore/inspector/front-end/WebKit.qrc @@ -196,6 +196,7 @@ <file>treeoutline.js</file> <file>UISourceCode.js</file> <file>UISourceCodeFrame.js</file> + <file>UIString.js</file> <file>UIUtils.js</file> <file>UserAgentSupport.js</file> <file>UserMetrics.js</file> diff --git a/Source/WebCore/inspector/front-end/externs.js b/Source/WebCore/inspector/front-end/externs.js index 92b877ed1..8cf53d26c 100644 --- a/Source/WebCore/inspector/front-end/externs.js +++ b/Source/WebCore/inspector/front-end/externs.js @@ -116,20 +116,70 @@ DOMApplicationCache.prototype.OBSOLETE = 5; var InspectorBackend = {} InspectorBackend.runAfterPendingDispatches = function(message) {} +/** @interface */ +function InspectorFrontendHostAPI() {} +InspectorFrontendHostAPI.prototype.platform = function() {} +InspectorFrontendHostAPI.prototype.port = function() {} +InspectorFrontendHostAPI.prototype.bringToFront = function() {} +InspectorFrontendHostAPI.prototype.closeWindow = function() {} +InspectorFrontendHostAPI.prototype.requestAttachWindow = function() {} +InspectorFrontendHostAPI.prototype.requestDetachWindow = function() {} +InspectorFrontendHostAPI.prototype.requestSetDockSide = function() {} +InspectorFrontendHostAPI.prototype.setAttachedWindowHeight = function(height) {} +InspectorFrontendHostAPI.prototype.moveWindowBy = function(x, y) {} +InspectorFrontendHostAPI.prototype.setInjectedScriptForOrigin = function(origin, script) {} +InspectorFrontendHostAPI.prototype.loaded = function() {} +InspectorFrontendHostAPI.prototype.localizedStringsURL = function() {} +InspectorFrontendHostAPI.prototype.hiddenPanels = function() {} +InspectorFrontendHostAPI.prototype.inspectedURLChanged = function(url) {} +InspectorFrontendHostAPI.prototype.documentCopy = function(event) {} +InspectorFrontendHostAPI.prototype.copyText = function(text) {} +InspectorFrontendHostAPI.prototype.openInNewTab = function(url) {} +InspectorFrontendHostAPI.prototype.canSave = function() {} +InspectorFrontendHostAPI.prototype.save = function(url, content, forceSaveAs) {} +InspectorFrontendHostAPI.prototype.canAppend = function() {} +InspectorFrontendHostAPI.prototype.append = function(url, content) {} +InspectorFrontendHostAPI.prototype.sendMessageToBackend = function(message) {} +InspectorFrontendHostAPI.prototype.recordActionTaken = function(actionCode) {} +InspectorFrontendHostAPI.prototype.recordPanelShown = function(panelCode) {} +InspectorFrontendHostAPI.prototype.recordSettingChanged = function(settingCode) {} +InspectorFrontendHostAPI.prototype.loadResourceSynchronously = function(url) {} +InspectorFrontendHostAPI.prototype.setZoomFactor = function(zoom) {} +InspectorFrontendHostAPI.prototype.canInspectWorkers = function() {} +/** @type {InspectorFrontendHostAPI} */ +var InspectorFrontendHost; + +/** @constructor */ +function SourceMapV3() +{ + /** @type {number} */ this.version; + /** @type {string} */ this.file; + /** @type {Array.<string>} */ this.sources; + /** @type {Array.<SourceMapV3.Section>} */ this.sections; + /** @type {string} */ this.mappings +} + +/** @constructor */ +SourceMapV3.Section = function() +{ + /** @type {SourceMapV3} */ this.map; + /** @type {SourceMapV3.Offset} */ this.offset; +} + +/** @constructor */ +SourceMapV3.Offset = function() +{ + /** @type {number} */ this.line; + /** @type {number} */ this.column; +} // FIXME: remove everything below. var WebInspector = {} - -WebInspector.panels = {}; -/** - * @type {WebInspector.InspectorView} - */ -WebInspector.inspectorView; +WebInspector.panels = {}; /** * @param {Element} element - * @param {WebInspector.View} view * @param {function()=} onclose */ WebInspector.showViewInDrawer = function(element, view, onclose) {} @@ -203,18 +253,6 @@ function ExtensionReloadOptions() { this.userAgent = ""; } -/** - * @type {WebInspector.HandlerRegistry} - */ -WebInspector.openAnchorLocationRegistry = null; - -/** - * @param {WebInspector.Panel} panel - */ -WebInspector.showPanelForAnchorNavigation = function(panel) -{ -} - WebInspector.showPanel = function(panel) { } diff --git a/Source/WebCore/inspector/front-end/inspector.html b/Source/WebCore/inspector/front-end/inspector.html index 7785f7d1f..5fdd2b477 100644 --- a/Source/WebCore/inspector/front-end/inspector.html +++ b/Source/WebCore/inspector/front-end/inspector.html @@ -39,6 +39,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <script type="text/javascript" src="DOMExtension.js"></script> <script type="text/javascript" src="treeoutline.js"></script> <script type="text/javascript" src="inspector.js"></script> + <script type="text/javascript" src="UIString.js"></script> <script type="text/javascript" src="UIUtils.js"></script> <script type="text/javascript" src="InspectorBackend.js"></script> <script type="text/javascript" src="InspectorBackendCommands.js"></script> @@ -71,8 +72,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <script type="text/javascript" src="NetworkRequest.js"></script> <script type="text/javascript" src="CSSStyleModel.js"></script> <script type="text/javascript" src="NetworkManager.js"></script> - <script type="text/javascript" src="NavigatorOverlayController.js"></script> - <script type="text/javascript" src="NavigatorView.js"></script> <script type="text/javascript" src="NetworkLog.js"></script> <script type="text/javascript" src="ResourceTreeModel.js"></script> <script type="text/javascript" src="ResourceUtils.js"></script> diff --git a/Source/WebCore/inspector/front-end/inspector.js b/Source/WebCore/inspector/front-end/inspector.js index 5160cec8a..e055d112e 100644 --- a/Source/WebCore/inspector/front-end/inspector.js +++ b/Source/WebCore/inspector/front-end/inspector.js @@ -501,8 +501,6 @@ WebInspector._doLoadedDoneWithCapabilities = function() this.cssModel = new WebInspector.CSSStyleModel(); this.timelineManager = new WebInspector.TimelineManager(); this.userAgentSupport = new WebInspector.UserAgentSupport(); - InspectorBackend.registerDatabaseDispatcher(new WebInspector.DatabaseDispatcher()); - InspectorBackend.registerDOMStorageDispatcher(new WebInspector.DOMStorageDispatcher()); this.searchController = new WebInspector.SearchController(); this.advancedSearchController = new WebInspector.AdvancedSearchController(); @@ -553,8 +551,8 @@ WebInspector._doLoadedDoneWithCapabilities = function() } InspectorAgent.enable(showInitialPanel); - DatabaseAgent.enable(); - DOMStorageAgent.enable(); + this.databaseModel = new WebInspector.DatabaseModel(); + this.domStorageModel = new WebInspector.DOMStorageModel(); if (!Capabilities.profilerCausesRecompilation || WebInspector.settings.profilerEnabled.get()) ProfilerAgent.enable(); @@ -1017,9 +1015,9 @@ WebInspector.inspect = function(payload, hints) } if (hints.databaseId) - WebInspector.showPanel("resources").selectDatabase(hints.databaseId); + WebInspector.showPanel("resources").selectDatabase(WebInspector.databaseModel.databaseForId(hints.databaseId)); else if (hints.domStorageId) - WebInspector.showPanel("resources").selectDOMStorage(hints.domStorageId); + WebInspector.showPanel("resources").selectDOMStorage(WebInspector.domStorageModel.storageForId(hints.domStorageId)); object.release(); } @@ -1060,17 +1058,11 @@ WebInspector._showAnchorLocationInPanel = function(anchor, panel) anchor.addStyleClass("webkit-html-resource-link"); } - this.showPanelForAnchorNavigation(panel); + WebInspector.inspectorView.showPanelForAnchorNavigation(panel); panel.showAnchorLocation(anchor); return true; } -WebInspector.showPanelForAnchorNavigation = function(panel) -{ - WebInspector.searchController.disableSearchUntilExplicitAction(); - WebInspector.inspectorView.setCurrentPanel(panel); -} - WebInspector.showProfileForURL = function(url) { WebInspector.showPanel("profiles").showProfileForURL(url); diff --git a/Source/WebCore/page/ContextMenuController.cpp b/Source/WebCore/page/ContextMenuController.cpp index 3a8a8dd8a..d9019fc30 100644 --- a/Source/WebCore/page/ContextMenuController.cpp +++ b/Source/WebCore/page/ContextMenuController.cpp @@ -68,6 +68,7 @@ #include "UserTypingGestureIndicator.h" #include "WindowFeatures.h" #include "markup.h" +#include <wtf/unicode/CharacterNames.h> #include <wtf/unicode/Unicode.h> #if PLATFORM(GTK) diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp index 4482fe245..4c495fd5a 100644 --- a/Source/WebCore/page/FrameView.cpp +++ b/Source/WebCore/page/FrameView.cpp @@ -136,6 +136,33 @@ static RenderLayer::UpdateLayerPositionsFlags updateLayerPositionFlags(RenderLay return flags; } +Pagination::Mode paginationModeForRenderStyle(RenderStyle* style) +{ + EOverflow overflow = style->overflowY(); + if (overflow != OPAGEDX && overflow != OPAGEDY) + return Pagination::Unpaginated; + + bool isHorizontalWritingMode = style->isHorizontalWritingMode(); + TextDirection textDirection = style->direction(); + WritingMode writingMode = style->writingMode(); + + // paged-x always corresponds to LeftToRightPaginated or RightToLeftPaginated. If the WritingMode + // is horizontal, then we use TextDirection to choose between those options. If the WritingMode + // is vertical, then the direction of the verticality dictates the choice. + if (overflow == OPAGEDX) { + if ((isHorizontalWritingMode && textDirection == LTR) || writingMode == LeftToRightWritingMode) + return Pagination::LeftToRightPaginated; + return Pagination::RightToLeftPaginated; + } + + // paged-y always corresponds to TopToBottomPaginated or BottomToTopPaginated. If the WritingMode + // is horizontal, then the direction of the horizontality dictates the choice. If the WritingMode + // is vertical, then we use TextDirection to choose between those options. + if (writingMode == TopToBottomWritingMode || (!isHorizontalWritingMode && textDirection == RTL)) + return Pagination::TopToBottomPaginated; + return Pagination::BottomToTopPaginated; +} + FrameView::FrameView(Frame* frame) : m_frame(frame) , m_canHaveScrollbars(true) @@ -582,6 +609,8 @@ void FrameView::applyOverflowToViewport(RenderObject* o, ScrollbarMode& hMode, S // Don't set it at all. ; } + + Pagination pagination; switch (overflowY) { case OHIDDEN: @@ -596,11 +625,19 @@ void FrameView::applyOverflowToViewport(RenderObject* o, ScrollbarMode& hMode, S case OAUTO: vMode = ScrollbarAuto; break; + case OPAGEDX: + pagination.mode = WebCore::paginationModeForRenderStyle(o->style()); + break; + case OPAGEDY: + pagination.mode = WebCore::paginationModeForRenderStyle(o->style()); + break; default: // Don't set it at all. ; } + setPagination(pagination); + m_viewportRenderer = o; } @@ -2555,6 +2592,30 @@ void FrameView::updateOverflowStatus(bool horizontalOverflow, bool verticalOverf } +const Pagination& FrameView::pagination() const +{ + if (m_pagination != Pagination()) + return m_pagination; + + if (Page* page = m_frame->page()) { + if (page->mainFrame() == m_frame) + return page->pagination(); + } + + return m_pagination; +} + +void FrameView::setPagination(const Pagination& pagination) +{ + if (m_pagination == pagination) + return; + + m_pagination = pagination; + + if (m_frame) + m_frame->document()->styleResolverChanged(DeferRecalcStyle); +} + IntRect FrameView::windowClipRect(bool clipToContents) const { ASSERT(m_frame->view() == this); @@ -3051,8 +3112,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect) p->fillRect(rect, Color(0xFF, 0, 0), ColorSpaceDeviceRGB); #endif - Page* page = m_frame->page(); - if (page->mainFrame() == m_frame && page->pagination().mode != Page::Pagination::Unpaginated) + if (pagination().mode != Pagination::Unpaginated) p->fillRect(rect, baseBackgroundColor(), ColorSpaceDeviceRGB); bool isTopLevelPainter = !sCurrentPaintTimeStamp; diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h index 87c108b48..6ab968e85 100644 --- a/Source/WebCore/page/FrameView.h +++ b/Source/WebCore/page/FrameView.h @@ -29,6 +29,7 @@ #include "Color.h" #include "Frame.h" #include "LayoutTypes.h" +#include "Pagination.h" #include "PaintPhase.h" #include "ScrollView.h" #include <wtf/Forward.h> @@ -52,6 +53,8 @@ class RenderLayer; class RenderObject; class RenderScrollbarPart; +Pagination::Mode paginationModeForRenderStyle(RenderStyle*); + typedef unsigned long long DOMTimeStamp; class FrameView : public ScrollView { @@ -347,6 +350,15 @@ public: void setScrollingPerformanceLoggingEnabled(bool); + // Page and FrameView both store a Pagination value. Page::pagination() is set only by API, + // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all + // FrameViews in the page cache, but FrameView::pagination() only affects the current + // FrameView. FrameView::pagination() will return m_pagination if it has been set. Otherwise, + // it will return Page::pagination() since currently there are no callers that need to + // distinguish between the two. + const Pagination& pagination() const; + void setPagination(const Pagination&); + protected: virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); virtual void scrollContentsSlowPath(const IntRect& updateRect); @@ -484,6 +496,8 @@ private: bool m_verticalOverflow; RenderObject* m_viewportRenderer; + Pagination m_pagination; + bool m_wasScrolledByUser; bool m_inProgrammaticScroll; bool m_safeToPropagateScrollToParent; diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h index f8b026f73..2ba722acc 100644 --- a/Source/WebCore/page/Page.h +++ b/Source/WebCore/page/Page.h @@ -25,6 +25,7 @@ #include "FindOptions.h" #include "LayoutTypes.h" #include "PageVisibilityState.h" +#include "Pagination.h" #include "PlatformScreen.h" #include "PlatformString.h" #include "Region.h" @@ -246,28 +247,10 @@ namespace WebCore { float deviceScaleFactor() const { return m_deviceScaleFactor; } void setDeviceScaleFactor(float); - struct Pagination { - enum Mode { Unpaginated, LeftToRightPaginated, RightToLeftPaginated, TopToBottomPaginated, BottomToTopPaginated }; - - Pagination() - : mode(Unpaginated) - , behavesLikeColumns(false) - , pageLength(0) - , gap(0) - { - }; - - bool operator==(const Pagination& other) const - { - return mode == other.mode && behavesLikeColumns == other.behavesLikeColumns && pageLength == other.pageLength && gap == other.gap; - } - - Mode mode; - bool behavesLikeColumns; - unsigned pageLength; - unsigned gap; - }; - + // Page and FrameView both store a Pagination value. Page::pagination() is set only by API, + // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all + // FrameViews in the page cache, but FrameView::pagination() only affects the current + // FrameView. const Pagination& pagination() const { return m_pagination; } void setPagination(const Pagination&); diff --git a/Source/WebCore/page/PrintContext.cpp b/Source/WebCore/page/PrintContext.cpp index a2ea78c76..a1d138f3e 100644 --- a/Source/WebCore/page/PrintContext.cpp +++ b/Source/WebCore/page/PrintContext.cpp @@ -25,6 +25,7 @@ #include "Frame.h" #include "FrameView.h" #include "RenderView.h" +#include "StyleInheritedData.h" #include <wtf/text/WTFString.h> namespace WebCore { diff --git a/Source/WebCore/page/SecurityOrigin.cpp b/Source/WebCore/page/SecurityOrigin.cpp index bb79e55e8..f5cd1c52e 100644 --- a/Source/WebCore/page/SecurityOrigin.cpp +++ b/Source/WebCore/page/SecurityOrigin.cpp @@ -215,7 +215,7 @@ PassRefPtr<SecurityOrigin> SecurityOrigin::createUnique() return origin.release(); } -PassRefPtr<SecurityOrigin> SecurityOrigin::isolatedCopy() +PassRefPtr<SecurityOrigin> SecurityOrigin::isolatedCopy() const { return adoptRef(new SecurityOrigin(this)); } @@ -400,7 +400,7 @@ bool SecurityOrigin::canAccessStorage(const SecurityOrigin* topOrigin) const if (!topOrigin) return true; - if (m_blockThirdPartyStorage && topOrigin->isThirdParty(this)) + if ((m_blockThirdPartyStorage || topOrigin->m_blockThirdPartyStorage) && topOrigin->isThirdParty(this)) return false; return true; diff --git a/Source/WebCore/page/SecurityOrigin.h b/Source/WebCore/page/SecurityOrigin.h index fb8e036db..2e32cfb69 100644 --- a/Source/WebCore/page/SecurityOrigin.h +++ b/Source/WebCore/page/SecurityOrigin.h @@ -54,7 +54,7 @@ public: // Create a deep copy of this SecurityOrigin. This method is useful // when marshalling a SecurityOrigin to another thread. - PassRefPtr<SecurityOrigin> isolatedCopy(); + PassRefPtr<SecurityOrigin> isolatedCopy() const; // Set the domain property of this security origin to newDomain. This // function does not check whether newDomain is a suffix of the current diff --git a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp index 1db759404..e256bde1a 100644 --- a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp +++ b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp @@ -29,12 +29,12 @@ #include "Frame.h" #include "FrameView.h" +#include "Page.h" #include "Region.h" #include "RenderLayerCompositor.h" #include "RenderView.h" #include "ScrollbarThemeComposite.h" #include "WebScrollbarThemeGeometryNative.h" -#include <public/WebScrollableLayer.h> #include <public/WebScrollbar.h> #include <public/WebScrollbarLayer.h> #include <public/WebScrollbarThemeGeometry.h> @@ -42,7 +42,6 @@ using WebKit::WebLayer; using WebKit::WebRect; -using WebKit::WebScrollableLayer; using WebKit::WebScrollbarLayer; using WebKit::WebVector; @@ -51,36 +50,39 @@ namespace WebCore { class ScrollingCoordinatorPrivate { WTF_MAKE_NONCOPYABLE(ScrollingCoordinatorPrivate); public: - ScrollingCoordinatorPrivate() { } + ScrollingCoordinatorPrivate() + : m_scrollLayer(0) + { + } + ~ScrollingCoordinatorPrivate() { } - void setScrollLayer(WebScrollableLayer layer) + void setScrollLayer(WebLayer* layer) { m_scrollLayer = layer; - if (!m_horizontalScrollbarLayer.isNull()) - m_horizontalScrollbarLayer.setScrollLayer(layer); - if (!m_verticalScrollbarLayer.isNull()) - m_verticalScrollbarLayer.setScrollLayer(layer); + if (m_horizontalScrollbarLayer) + m_horizontalScrollbarLayer->setScrollLayer(layer); + if (m_verticalScrollbarLayer) + m_verticalScrollbarLayer->setScrollLayer(layer); } - void setHorizontalScrollbarLayer(WebScrollbarLayer layer) + void setHorizontalScrollbarLayer(PassOwnPtr<WebScrollbarLayer> layer) { m_horizontalScrollbarLayer = layer; } - void setVerticalScrollbarLayer(WebScrollbarLayer layer) + void setVerticalScrollbarLayer(PassOwnPtr<WebScrollbarLayer> layer) { m_verticalScrollbarLayer = layer; } - bool hasScrollLayer() const { return !m_scrollLayer.isNull(); } - WebScrollableLayer scrollLayer() const { return m_scrollLayer; } + WebLayer* scrollLayer() const { return m_scrollLayer; } private: - WebScrollableLayer m_scrollLayer; - WebScrollbarLayer m_horizontalScrollbarLayer; - WebScrollbarLayer m_verticalScrollbarLayer; + WebLayer* m_scrollLayer; + OwnPtr<WebScrollbarLayer> m_horizontalScrollbarLayer; + OwnPtr<WebScrollbarLayer> m_verticalScrollbarLayer; }; PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page) @@ -112,15 +114,20 @@ static GraphicsLayer* scrollLayerForFrameView(FrameView* frameView) #endif } -static WebScrollbarLayer createScrollbarLayer(Scrollbar* scrollbar, WebScrollableLayer scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView) +static WebLayer* scrollableLayerForGraphicsLayer(GraphicsLayer* layer) +{ + return layer->platformLayer(); +} + +static PassOwnPtr<WebScrollbarLayer> createScrollbarLayer(Scrollbar* scrollbar, WebLayer* scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView) { ASSERT(scrollbar); ASSERT(scrollbarGraphicsLayer); - if (scrollLayer.isNull()) { + if (!scrollLayer) { // FIXME: sometimes we get called before setScrollLayer, workaround by finding the scroll layout ourselves. - scrollLayer = scrollLayerForFrameView(frameView)->platformLayer()->to<WebScrollableLayer>(); - ASSERT(!scrollLayer.isNull()); + scrollLayer = scrollableLayerForGraphicsLayer(scrollLayerForFrameView(frameView)); + ASSERT(scrollLayer); } // Root layer non-overlay scrollbars should be marked opaque to disable @@ -138,7 +145,7 @@ static WebScrollbarLayer createScrollbarLayer(Scrollbar* scrollbar, WebScrollabl if (!platformSupported || scrollbar->isCustomScrollbar()) { scrollbarGraphicsLayer->setContentsToMedia(0); scrollbarGraphicsLayer->setDrawsContent(true); - return WebScrollbarLayer(); + return nullptr; } // All Chromium scrollbar themes derive from ScrollbarThemeComposite. @@ -146,14 +153,14 @@ static WebScrollbarLayer createScrollbarLayer(Scrollbar* scrollbar, WebScrollabl WebKit::WebScrollbarThemePainter painter(themeComposite, scrollbar); OwnPtr<WebKit::WebScrollbarThemeGeometry> geometry(WebKit::WebScrollbarThemeGeometryNative::create(themeComposite)); - WebScrollbarLayer scrollbarLayer = WebScrollbarLayer::create(scrollbar, painter, geometry.release()); - scrollbarLayer.setScrollLayer(scrollLayer); + OwnPtr<WebScrollbarLayer> scrollbarLayer = adoptPtr(WebScrollbarLayer::create(scrollbar, painter, geometry.release())); + scrollbarLayer->setScrollLayer(scrollLayer); - scrollbarGraphicsLayer->setContentsToMedia(&scrollbarLayer); + scrollbarGraphicsLayer->setContentsToMedia(scrollbarLayer->layer()); scrollbarGraphicsLayer->setDrawsContent(false); - scrollbarLayer.setOpaque(scrollbarGraphicsLayer->contentsOpaque()); + scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaque()); - return scrollbarLayer; + return scrollbarLayer.release(); } void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* horizontalScrollbarLayer) @@ -161,6 +168,7 @@ void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* if (!horizontalScrollbarLayer || !coordinatesScrollingForFrameView(frameView)) return; + setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view())); m_private->setHorizontalScrollbarLayer(createScrollbarLayer(frameView->horizontalScrollbar(), m_private->scrollLayer(), horizontalScrollbarLayer, frameView)); } @@ -169,25 +177,25 @@ void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* f if (!verticalScrollbarLayer || !coordinatesScrollingForFrameView(frameView)) return; + setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view())); m_private->setVerticalScrollbarLayer(createScrollbarLayer(frameView->verticalScrollbar(), m_private->scrollLayer(), verticalScrollbarLayer, frameView)); } void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer) { - WebScrollableLayer layer; - if (scrollLayer) - layer = scrollLayer->platformLayer()->to<WebScrollableLayer>(); - m_private->setScrollLayer(layer); + m_private->setScrollLayer(scrollLayer ? scrollableLayerForGraphicsLayer(scrollLayer) : 0); } void ScrollingCoordinator::setNonFastScrollableRegion(const Region& region) { - if (m_private->hasScrollLayer()) { + // We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves. + setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view())); + if (m_private->scrollLayer()) { Vector<IntRect> rects = region.rects(); WebVector<WebRect> webRects(rects.size()); for (size_t i = 0; i < rects.size(); ++i) webRects[i] = rects[i]; - m_private->scrollLayer().setNonFastScrollableRegion(webRects); + m_private->scrollLayer()->setNonFastScrollableRegion(webRects); } } @@ -198,14 +206,18 @@ void ScrollingCoordinator::setScrollParameters(const ScrollParameters&) void ScrollingCoordinator::setWheelEventHandlerCount(unsigned wheelEventHandlerCount) { - if (m_private->hasScrollLayer()) - m_private->scrollLayer().setHaveWheelEventHandlers(wheelEventHandlerCount > 0); + // We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves. + setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view())); + if (m_private->scrollLayer()) + m_private->scrollLayer()->setHaveWheelEventHandlers(wheelEventHandlerCount > 0); } void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool should) { - if (m_private->hasScrollLayer()) - m_private->scrollLayer().setShouldScrollOnMainThread(should); + // We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves. + setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view())); + if (m_private->scrollLayer()) + m_private->scrollLayer()->setShouldScrollOnMainThread(should); } bool ScrollingCoordinator::supportsFixedPositionLayers() const @@ -215,14 +227,14 @@ bool ScrollingCoordinator::supportsFixedPositionLayers() const void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLayer* layer, bool enable) { - if (WebLayer* platformLayer = layer->platformLayer()) - platformLayer->to<WebScrollableLayer>().setIsContainerForFixedPositionLayers(enable); + if (WebLayer* scrollableLayer = scrollableLayerForGraphicsLayer(layer)) + scrollableLayer->setIsContainerForFixedPositionLayers(enable); } void ScrollingCoordinator::setLayerIsFixedToContainerLayer(GraphicsLayer* layer, bool enable) { - if (WebLayer* platformLayer = layer->platformLayer()) - platformLayer->to<WebScrollableLayer>().setFixedToContainerLayer(enable); + if (WebLayer* scrollableLayer = scrollableLayerForGraphicsLayer(layer)) + scrollableLayer->setFixedToContainerLayer(enable); } } diff --git a/Source/WebCore/page/scrolling/mac/ScrollingThreadMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingThreadMac.mm index 064696e42..789759102 100644 --- a/Source/WebCore/page/scrolling/mac/ScrollingThreadMac.mm +++ b/Source/WebCore/page/scrolling/mac/ScrollingThreadMac.mm @@ -63,7 +63,9 @@ void ScrollingThread::threadRunLoopSourceCallback(void* scrollingThread) void ScrollingThread::threadRunLoopSourceCallback() { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; dispatchFunctionsFromScrollingThread(); + [pool drain]; } } // namespace WebCore diff --git a/Source/WebCore/platform/ScrollAnimatorNone.cpp b/Source/WebCore/platform/ScrollAnimatorNone.cpp index 45cc1e587..34a6f7709 100644 --- a/Source/WebCore/platform/ScrollAnimatorNone.cpp +++ b/Source/WebCore/platform/ScrollAnimatorNone.cpp @@ -34,18 +34,22 @@ #include "ScrollAnimatorNone.h" -#include "ActivePlatformGestureAnimation.h" #include "FloatPoint.h" #include "NotImplemented.h" #include <wtf/OwnArrayPtr.h> #include "PlatformGestureEvent.h" #include "ScrollableArea.h" #include "ScrollbarTheme.h" -#include "TouchpadFlingPlatformGestureCurve.h" #include <algorithm> #include <wtf/CurrentTime.h> #include <wtf/PassOwnPtr.h> +#if ENABLE(GESTURE_ANIMATION) +#include "ActivePlatformGestureAnimation.h" +#include "TouchpadFlingPlatformGestureCurve.h" +#endif + + #if PLATFORM(CHROMIUM) #include "TraceEvent.h" #endif @@ -401,9 +405,11 @@ ScrollAnimatorNone::~ScrollAnimatorNone() void ScrollAnimatorNone::fireUpAnAnimation(FloatPoint fp) { +#if ENABLE(GESTURE_ANIMATION) if (m_gestureAnimation) m_gestureAnimation.clear(); m_gestureAnimation = ActivePlatformGestureAnimation::create(TouchpadFlingPlatformGestureCurve::create(fp), this); +#endif #if USE(REQUEST_ANIMATION_FRAME_TIMER) startNextTimer(0); #else @@ -491,7 +497,9 @@ void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset void ScrollAnimatorNone::cancelAnimations() { m_animationActive = false; +#if ENABLE(GESTURE_ANIMATION) m_gestureAnimation.clear(); +#endif } void ScrollAnimatorNone::serviceScrollAnimations() @@ -545,12 +553,14 @@ void ScrollAnimatorNone::animationTimerFired() if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime)) continueAnimation = true; +#if ENABLE(GESTURE_ANIMATION) if (m_gestureAnimation) { if (m_gestureAnimation->animate(currentTime)) continueAnimation = true; else m_gestureAnimation.clear(); } +#endif if (continueAnimation) #if USE(REQUEST_ANIMATION_FRAME_TIMER) diff --git a/Source/WebCore/platform/ScrollAnimatorNone.h b/Source/WebCore/platform/ScrollAnimatorNone.h index ae18c02a0..2a4d86611 100644 --- a/Source/WebCore/platform/ScrollAnimatorNone.h +++ b/Source/WebCore/platform/ScrollAnimatorNone.h @@ -173,7 +173,9 @@ protected: bool m_firstVelocitySet; bool m_firstVelocityIsVertical; +#if ENABLE(GESTURE_ANIMATION) OwnPtr<ActivePlatformGestureAnimation> m_gestureAnimation; +#endif }; } // namespace WebCore diff --git a/Source/WebCore/platform/blackberry/CookieParser.cpp b/Source/WebCore/platform/blackberry/CookieParser.cpp index 91babc2a1..e29ea28bd 100644 --- a/Source/WebCore/platform/blackberry/CookieParser.cpp +++ b/Source/WebCore/platform/blackberry/CookieParser.cpp @@ -29,6 +29,7 @@ #include "Logging.h" #include "ParsedCookie.h" +#include <network/TopLevelDomain.h> #include <wtf/CurrentTime.h> #include <wtf/text/CString.h> @@ -271,6 +272,11 @@ ParsedCookie* CookieParser::parseOneCookie(const String& cookie, unsigned start, // We should check for an embedded dot in the portion of string in the host not in the domain // but to match firefox behaviour we do not. + // Check whether the domain is a top level domain, if it is throw it out + // http://publicsuffix.org/list/ + if (!BlackBerry::Platform::TopLevelDomain::isCookieWritableDomain(realDomain.utf8().data())) + LOG_AND_DELETE("Invalid cookie %s (domain): it did not pass the top level domain check", cookie.ascii().data()); + res->setDomain(realDomain); } else LOG_AND_DELETE("Invalid cookie %s (domain)", cookie.ascii().data()); diff --git a/Source/WebCore/platform/cf/BinaryPropertyList.cpp b/Source/WebCore/platform/cf/BinaryPropertyList.cpp index 9ba9617dd..bec2ec950 100644 --- a/Source/WebCore/platform/cf/BinaryPropertyList.cpp +++ b/Source/WebCore/platform/cf/BinaryPropertyList.cpp @@ -697,7 +697,7 @@ void BinaryPropertyListSerializer::appendStringObject(const String& string) unsigned length = string.length(); if (charactersAreAllASCII(characters, length)) { if (length <= maxLengthInMarkerByte) - appendByte(asciiStringMarkerByte | length); + appendByte(static_cast<unsigned char>(asciiStringMarkerByte | length)); else { appendByte(asciiStringWithSeparateLengthMarkerByte); appendInteger(length); @@ -706,7 +706,7 @@ void BinaryPropertyListSerializer::appendStringObject(const String& string) appendByte(characters[i]); } else { if (length <= maxLengthInMarkerByte) - appendByte(unicodeStringMarkerByte | length); + appendByte(static_cast<unsigned char>(unicodeStringMarkerByte | length)); else { appendByte(unicodeStringWithSeparateLengthMarkerByte); appendInteger(length); @@ -723,7 +723,7 @@ void BinaryPropertyListSerializer::appendStringObject(const char* string) startObject(); unsigned length = strlen(string); if (length <= maxLengthInMarkerByte) - appendByte(asciiStringMarkerByte | length); + appendByte(static_cast<unsigned char>(asciiStringMarkerByte | length)); else { appendByte(asciiStringWithSeparateLengthMarkerByte); appendInteger(length); diff --git a/Source/WebCore/platform/efl/RenderThemeEfl.cpp b/Source/WebCore/platform/efl/RenderThemeEfl.cpp index e07dd8409..4075430d4 100644 --- a/Source/WebCore/platform/efl/RenderThemeEfl.cpp +++ b/Source/WebCore/platform/efl/RenderThemeEfl.cpp @@ -27,6 +27,7 @@ #include "RenderThemeEfl.h" #include "CSSValueKeywords.h" +#include "FontDescription.h" #include "GraphicsContext.h" #include "HTMLInputElement.h" #include "InputType.h" @@ -766,13 +767,18 @@ void RenderThemeEfl::adjustSliderTrackStyle(StyleResolver* styleResolver, Render return; } - adjustSizeConstraints(style, SliderHorizontal); + const ThemePartDesc* desc; + if (style->appearance() == SliderHorizontalPart) { + adjustSizeConstraints(style, SliderHorizontal); + desc = m_partDescs + static_cast<size_t>(SliderHorizontal); + } else { + adjustSizeConstraints(style, SliderVertical); + desc = m_partDescs + static_cast<size_t>(SliderVertical); + } style->resetBorder(); - - const struct ThemePartDesc *desc = m_partDescs + (size_t)SliderHorizontal; - if (style->width().value() < desc->min.width().value()) + if (style->width().value() > 0 && style->width().value() < desc->min.width().value()) style->setWidth(desc->min.width()); - if (style->height().value() < desc->min.height().value()) + if (style->height().value() > 0 && style->height().value() < desc->min.height().value()) style->setHeight(desc->min.height()); } @@ -809,6 +815,12 @@ int RenderThemeEfl::sliderTickOffsetFromTrackCenter() const return sliderTickOffset; } + +LayoutUnit RenderThemeEfl::sliderTickSnappingThreshold() const +{ + // The same threshold value as the Chromium port. + return 5; +} #endif bool RenderThemeEfl::supportsDataListUI(const AtomicString& type) const diff --git a/Source/WebCore/platform/efl/RenderThemeEfl.h b/Source/WebCore/platform/efl/RenderThemeEfl.h index 641e52619..b97fdd3ad 100644 --- a/Source/WebCore/platform/efl/RenderThemeEfl.h +++ b/Source/WebCore/platform/efl/RenderThemeEfl.h @@ -164,6 +164,7 @@ public: #if ENABLE(DATALIST_ELEMENT) virtual IntSize sliderTickSize() const OVERRIDE; virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE; + virtual LayoutUnit sliderTickSnappingThreshold() const OVERRIDE; #endif virtual bool supportsDataListUI(const AtomicString&) const OVERRIDE; diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp index 595d16a4f..78a0de410 100644 --- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp +++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp @@ -66,7 +66,7 @@ void ANGLEWebKitBridge::setResources(ShBuiltInResources resources) m_resources = resources; } -bool ANGLEWebKitBridge::validateShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog) +bool ANGLEWebKitBridge::validateShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog, int extraCompileOptions) { if (!builtCompilers) { m_fragmentCompiler = ShConstructCompiler(SH_FRAGMENT_SHADER, SH_WEBGL_SPEC, m_shaderOutput, &m_resources); @@ -88,7 +88,7 @@ bool ANGLEWebKitBridge::validateShaderSource(const char* shaderSource, ANGLEShad const char* const shaderSourceStrings[] = { shaderSource }; - bool validateSuccess = ShCompile(compiler, shaderSourceStrings, 1, SH_OBJECT_CODE); + bool validateSuccess = ShCompile(compiler, shaderSourceStrings, 1, SH_OBJECT_CODE | extraCompileOptions); if (!validateSuccess) { int logSize = 0; ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &logSize); diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h index d75b5f298..834dcc9aa 100644 --- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h +++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h @@ -53,7 +53,7 @@ public: ShBuiltInResources getResources() { return m_resources; } void setResources(ShBuiltInResources); - bool validateShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog); + bool validateShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog, int extraCompileOptions); private: diff --git a/Source/WebCore/platform/graphics/FontMetrics.h b/Source/WebCore/platform/graphics/FontMetrics.h index 5fe408bb6..11b062918 100644 --- a/Source/WebCore/platform/graphics/FontMetrics.h +++ b/Source/WebCore/platform/graphics/FontMetrics.h @@ -20,6 +20,7 @@ #ifndef FontMetrics_h #define FontMetrics_h +#include "FontBaseline.h" #include <wtf/MathExtras.h> namespace WebCore { diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h index a2f4d6867..0369b20a7 100644 --- a/Source/WebCore/platform/graphics/GraphicsContext.h +++ b/Source/WebCore/platform/graphics/GraphicsContext.h @@ -128,10 +128,8 @@ namespace WebCore { class TransformationMatrix; enum TextDrawingMode { - TextModeInvisible = 0, TextModeFill = 1 << 0, TextModeStroke = 1 << 1, - TextModeClip = 1 << 2 }; typedef unsigned TextDrawingModeFlags; diff --git a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp index 425681805..6fad26e53 100644 --- a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp +++ b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp @@ -358,6 +358,11 @@ void MediaPlayerPrivate::paint(GraphicsContext* context, const IntRect& rect) return; #endif + paintCurrentFrameInContext(context, rect); +} + +void MediaPlayerPrivate::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect) +{ if (!hasVideo() || context->paintingDisabled() || !m_webCorePlayer->visible()) return; diff --git a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h index c378bf68a..40156fbb7 100644 --- a/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h +++ b/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h @@ -89,6 +89,8 @@ public: virtual void paint(GraphicsContext*, const IntRect&); + virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&); + virtual bool hasAvailableVideoFrame() const; #if USE(ACCELERATED_COMPOSITING) diff --git a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp index befadb940..2eed9cd6b 100644 --- a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp +++ b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp @@ -1646,12 +1646,8 @@ void GraphicsContext::setPlatformTextDrawingMode(TextDrawingModeFlags mode) if (paintingDisabled()) return; - // Wow, wish CG had used bits here. CGContextRef context = platformContext(); switch (mode) { - case TextModeInvisible: - CGContextSetTextDrawingMode(context, kCGTextInvisible); - break; case TextModeFill: CGContextSetTextDrawingMode(context, kCGTextFill); break; @@ -1661,18 +1657,6 @@ void GraphicsContext::setPlatformTextDrawingMode(TextDrawingModeFlags mode) case TextModeFill | TextModeStroke: CGContextSetTextDrawingMode(context, kCGTextFillStroke); break; - case TextModeClip: - CGContextSetTextDrawingMode(context, kCGTextClip); - break; - case TextModeFill | TextModeClip: - CGContextSetTextDrawingMode(context, kCGTextFillClip); - break; - case TextModeStroke | TextModeClip: - CGContextSetTextDrawingMode(context, kCGTextStrokeClip); - break; - case TextModeFill | TextModeStroke | TextModeClip: - CGContextSetTextDrawingMode(context, kCGTextFillStrokeClip); - break; default: break; } diff --git a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp index db517cad2..10654312c 100644 --- a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp +++ b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp @@ -69,22 +69,21 @@ Canvas2DLayerBridge::Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, grContext->resetContext(); } - m_layer = WebExternalTextureLayer::create(this); - m_layer.setTextureId(textureId); - m_layer.setRateLimitContext(!WebKit::WebCompositor::threadingEnabled() || m_useDoubleBuffering); + m_layer = adoptPtr(WebExternalTextureLayer::create(this)); + m_layer->setTextureId(textureId); + m_layer->setRateLimitContext(!WebKit::WebCompositor::threadingEnabled() || m_useDoubleBuffering); } Canvas2DLayerBridge::~Canvas2DLayerBridge() { if (SkDeferredCanvas* deferred = deferredCanvas()) deferred->setNotificationClient(0); - m_layer.setTextureId(0); + m_layer->setTextureId(0); if (m_useDoubleBuffering) { m_context->makeContextCurrent(); GLC(m_context.get(), m_context->deleteTexture(m_frontBufferTexture)); m_context->flush(); } - m_layer.clearClient(); } SkDeferredCanvas* Canvas2DLayerBridge::deferredCanvas() @@ -98,7 +97,7 @@ void Canvas2DLayerBridge::prepareForDraw() { ASSERT(deferredCanvas()); if (!m_useDoubleBuffering) - m_layer.willModifyTexture(); + m_layer->willModifyTexture(); m_context->makeContextCurrent(); } @@ -148,13 +147,13 @@ WebGraphicsContext3D* Canvas2DLayerBridge::context() WebKit::WebLayer* Canvas2DLayerBridge::layer() { - return &m_layer; + return m_layer->layer(); } void Canvas2DLayerBridge::contextAcquired() { if (m_deferralMode == NonDeferred && !m_useDoubleBuffering) - m_layer.willModifyTexture(); + m_layer->willModifyTexture(); } unsigned Canvas2DLayerBridge::backBufferTexture() diff --git a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h index 409d207c5..27b1ea659 100644 --- a/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h +++ b/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.h @@ -76,7 +76,7 @@ private: unsigned m_backBufferTexture; IntSize m_size; SkCanvas* m_canvas; - WebKit::WebExternalTextureLayer m_layer; + OwnPtr<WebKit::WebExternalTextureLayer> m_layer; RefPtr<GraphicsContext3D> m_context; }; diff --git a/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp index 0dc960b6d..a8f57e296 100644 --- a/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp @@ -96,23 +96,13 @@ void ContentLayerChromium::setTexturePriorities(const CCPriorityCalculator& prio void ContentLayerChromium::update(CCTextureUpdateQueue& queue, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) { createTextureUpdaterIfNeeded(); - - IntRect contentRect; - - // Always call updateContentRect() but with an empty layer rectangle when - // layer doesn't draw contents. - if (drawsContent()) - contentRect = visibleContentRect(); - - updateContentRect(queue, contentRect, occlusion, stats); + TiledLayerChromium::update(queue, occlusion, stats); m_needsDisplay = false; } bool ContentLayerChromium::needMoreUpdates() { - if (!drawsContent()) - return false; - return needsIdlePaint(visibleContentRect()); + return needsIdlePaint(); } void ContentLayerChromium::createTextureUpdaterIfNeeded() diff --git a/Source/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm b/Source/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm index a27af4cbe..c0f10dc6b 100644 --- a/Source/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm +++ b/Source/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm @@ -41,20 +41,6 @@ namespace { typedef HashMap<uint32, MemoryActivatedFont*> FontContainerRefMemoryFontHash; typedef HashMap<WTF::String, MemoryActivatedFont*> FontNameMemoryFontHash; -// On 10.5, font loading is not blocked by the sandbox and thus there is no -// need for the cross-process font loading mechanim. -// On system versions >=10.6 cross-process font loading is required. -bool OutOfProcessFontLoadingEnabled() -{ - static SInt32 systemVersion = 0; - if (!systemVersion) { - if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr) - return false; - } - - return systemVersion >= 0x1060; -} - // Caching: // // Requesting a font from the browser process is expensive and so is @@ -199,7 +185,7 @@ void FontPlatformData::loadFont(NSFont* nsFont, float fontSize, NSFont*& outNSFo { outNSFont = nsFont; cgFont = CTFontCopyGraphicsFont(toCTFontRef(outNSFont), 0); - if (OutOfProcessFontLoadingEnabled() && outNSFont && cgFont && isLastResortFont(cgFont)) { + if (outNSFont && cgFont && isLastResortFont(cgFont)) { // Release old CGFontRef since it points at the LastResort font which we don't want. CFRelease(cgFont); cgFont = 0; diff --git a/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp b/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp index 1d167a556..6102a3e6f 100644 --- a/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp @@ -156,16 +156,15 @@ class DrawingBufferPrivate : public WebKit::WebExternalTextureLayerClient { public: explicit DrawingBufferPrivate(DrawingBuffer* drawingBuffer) : m_drawingBuffer(drawingBuffer) - , m_layer(WebKit::WebExternalTextureLayer::create(this)) + , m_layer(adoptPtr(WebKit::WebExternalTextureLayer::create(this))) { GraphicsContext3D::Attributes attributes = m_drawingBuffer->graphicsContext3D()->getContextAttributes(); - m_layer.setOpaque(!attributes.alpha); - m_layer.setPremultipliedAlpha(attributes.premultipliedAlpha); + m_layer->setOpaque(!attributes.alpha); + m_layer->setPremultipliedAlpha(attributes.premultipliedAlpha); } virtual ~DrawingBufferPrivate() { - m_layer.clearClient(); } virtual unsigned prepareTexture(WebKit::WebTextureUpdater& updater) OVERRIDE @@ -187,11 +186,11 @@ public: return GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_drawingBuffer->graphicsContext3D()); } - WebKit::WebLayer* layer() { return &m_layer; } + WebKit::WebLayer* layer() { return m_layer->layer(); } private: DrawingBuffer* m_drawingBuffer; - WebKit::WebExternalTextureLayer m_layer; + OwnPtr<WebKit::WebExternalTextureLayer> m_layer; }; #if USE(ACCELERATED_COMPOSITING) diff --git a/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp b/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp index 156dcd3d1..9f8998cda 100644 --- a/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp +++ b/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp @@ -629,7 +629,8 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD } return new FontPlatformData(hfont, - fontDescription.computedPixelSize()); + fontDescription.computedPixelSize(), + fontDescription.orientation()); } } diff --git a/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp b/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp index a6541ee1c..6f27f8a54 100644 --- a/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp +++ b/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp @@ -32,14 +32,16 @@ #include "config.h" #include "FontPlatformData.h" -#include <windows.h> -#include <objidl.h> -#include <mlang.h> - +#include "FontCache.h" #include "HWndDC.h" #include "PlatformSupport.h" +#include "SharedBuffer.h" #include "SkTypeface_win.h" #include "SkiaFontWin.h" + +#include <mlang.h> +#include <objidl.h> +#include <windows.h> #include <wtf/StdLibExtras.h> namespace WebCore { @@ -62,6 +64,7 @@ SkTypeface* CreateTypefaceFromHFont(HFONT hfont, int* size, int* lfQuality) FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType) : m_font(hashTableDeletedFontValue()) , m_size(-1) + , m_orientation(Horizontal) , m_scriptCache(0) , m_scriptFontProperties(0) , m_typeface(0) @@ -72,6 +75,7 @@ FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType) FontPlatformData::FontPlatformData() : m_font(0) , m_size(0) + , m_orientation(Horizontal) , m_scriptCache(0) , m_scriptFontProperties(0) , m_typeface(0) @@ -79,9 +83,10 @@ FontPlatformData::FontPlatformData() { } -FontPlatformData::FontPlatformData(HFONT font, float size) +FontPlatformData::FontPlatformData(HFONT font, float size, FontOrientation orientation) : m_font(RefCountedHFONT::create(font)) , m_size(size) + , m_orientation(orientation) , m_scriptCache(0) , m_scriptFontProperties(0) , m_typeface(CreateTypefaceFromHFont(font, 0, &m_lfQuality)) @@ -92,6 +97,7 @@ FontPlatformData::FontPlatformData(HFONT font, float size) FontPlatformData::FontPlatformData(float size, bool bold, bool oblique) : m_font(0) , m_size(size) + , m_orientation(Horizontal) , m_scriptCache(0) , m_scriptFontProperties(0) , m_typeface(0) @@ -102,6 +108,7 @@ FontPlatformData::FontPlatformData(float size, bool bold, bool oblique) FontPlatformData::FontPlatformData(const FontPlatformData& data) : m_font(data.m_font) , m_size(data.m_size) + , m_orientation(data.m_orientation) , m_scriptCache(0) , m_scriptFontProperties(0) , m_typeface(data.m_typeface) @@ -115,6 +122,7 @@ FontPlatformData& FontPlatformData::operator=(const FontPlatformData& data) if (this != &data) { m_font = data.m_font; m_size = data.m_size; + m_orientation = data.m_orientation; SkRefCnt_SafeAssign(m_typeface, data.m_typeface); m_lfQuality = data.m_lfQuality; diff --git a/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h b/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h index d264b17da..55a5c2b07 100644 --- a/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h +++ b/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h @@ -64,7 +64,7 @@ public: FontPlatformData(WTF::HashTableDeletedValueType); FontPlatformData(); // This constructor takes ownership of the HFONT - FontPlatformData(HFONT, float size); + FontPlatformData(HFONT, float size, FontOrientation); FontPlatformData(float size, bool bold, bool oblique); FontPlatformData(const FontPlatformData&); @@ -79,8 +79,8 @@ public: SkTypeface* typeface() const { return m_typeface; } int lfQuality() const { return m_lfQuality; } - FontOrientation orientation() const { return Horizontal; } // FIXME: Implement. - void setOrientation(FontOrientation) { } // FIXME: Implement. + FontOrientation orientation() const { return m_orientation; } + void setOrientation(FontOrientation orientation) { m_orientation = orientation; } unsigned hash() const { @@ -89,7 +89,7 @@ public: bool operator==(const FontPlatformData& other) const { - return m_font == other.m_font && m_size == other.m_size; + return m_font == other.m_font && m_size == other.m_size && m_orientation == other.m_orientation; } #ifndef NDEBUG @@ -137,6 +137,7 @@ private: RefPtr<RefCountedHFONT> m_font; float m_size; // Point size of the font in pixels. + FontOrientation m_orientation; SkTypeface* m_typeface; // cached from m_font int m_lfQuality; // cached from m_font diff --git a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp index da2ecc610..101ad4bb1 100644 --- a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp +++ b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp @@ -107,7 +107,7 @@ void FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect(WebGraphic context->makeContextCurrent(); texture->acquireBackingTexture(resourceProvider); - CCScopedLockResourceForWrite lock(resourceProvider, texture->resourceId()); + CCResourceProvider::ScopedWriteLockGL lock(resourceProvider, texture->resourceId()); // Create an accelerated canvas to draw on. OwnPtr<SkCanvas> canvas = createAcceleratedCanvas(grContext, texture->size(), lock.textureId()); diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp index fb0900bbc..7d5591be3 100644 --- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp @@ -52,7 +52,6 @@ #include "FloatRect.h" #include "GraphicsContext.h" #include "Image.h" -#include "LinkHighlight.h" #include "NativeImageSkia.h" #include "PlatformContextSkia.h" #include "PlatformString.h" @@ -83,14 +82,17 @@ PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client) GraphicsLayerChromium::GraphicsLayerChromium(GraphicsLayerClient* client) : GraphicsLayer(client) + , m_contentsLayer(0) + , m_contentsLayerId(0) + , m_linkHighlight(0) , m_contentsLayerPurpose(NoContentsLayer) , m_contentsLayerHasBackgroundColor(false) , m_inSetChildren(false) , m_pageScaleChanged(false) { m_opaqueRectTrackingContentLayerDelegate = adoptPtr(new OpaqueRectTrackingContentLayerDelegate(this)); - m_layer = WebContentLayer::create(m_opaqueRectTrackingContentLayerDelegate.get()); - m_layer.setDrawsContent(m_drawsContent && m_contentsVisible); + m_layer = adoptPtr(WebContentLayer::create(m_opaqueRectTrackingContentLayerDelegate.get())); + m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); if (client) deviceOrPageScaleFactorChanged(); updateDebugIndicators(); @@ -98,31 +100,16 @@ GraphicsLayerChromium::GraphicsLayerChromium(GraphicsLayerClient* client) GraphicsLayerChromium::~GraphicsLayerChromium() { - // Do cleanup while we can still safely call methods on the derived class. willBeDestroyed(); } void GraphicsLayerChromium::willBeDestroyed() { - if (!m_layer.isNull()) { - m_layer.clearClient(); - m_layer.clearRenderSurface(); - m_layer.setAnimationDelegate(0); - } - - if (!m_contentsLayer.isNull()) { - m_contentsLayer.clearRenderSurface(); - m_contentsLayer.setAnimationDelegate(0); - } - - if (!m_transformLayer.isNull()) { - m_transformLayer.clearRenderSurface(); - m_transformLayer.setAnimationDelegate(0); + if (m_linkHighlight) { + m_linkHighlight->clearCurrentGraphicsLayer(); + m_linkHighlight = 0; } - if (m_linkHighlight) - m_linkHighlight.clear(); - GraphicsLayer::willBeDestroyed(); } @@ -136,21 +123,20 @@ void GraphicsLayerChromium::setName(const String& inName) void GraphicsLayerChromium::updateNames() { - if (!m_layer.isNull()) { - String debugName = "Layer for " + m_nameBase; - m_layer.setDebugName(debugName); - } - if (!m_transformLayer.isNull()) { + String debugName = "Layer for " + m_nameBase; + m_layer->layer()->setDebugName(debugName); + + if (m_transformLayer) { String debugName = "TransformLayer for " + m_nameBase; - m_transformLayer.setDebugName(debugName); + m_transformLayer->setDebugName(debugName); } - if (!m_contentsLayer.isNull()) { + if (m_contentsLayer) { String debugName = "ContentsLayer for " + m_nameBase; - m_contentsLayer.setDebugName(debugName); + m_contentsLayer->setDebugName(debugName); } if (m_linkHighlight) { String debugName = "LinkHighlight for " + m_nameBase; - m_linkHighlight->contentLayer()->setDebugName(debugName); + m_linkHighlight->layer()->setDebugName(debugName); } } @@ -203,7 +189,7 @@ bool GraphicsLayerChromium::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* void GraphicsLayerChromium::removeFromParent() { GraphicsLayer::removeFromParent(); - primaryLayer().removeFromParent(); + platformLayer()->removeFromParent(); } void GraphicsLayerChromium::setPosition(const FloatPoint& point) @@ -233,8 +219,11 @@ void GraphicsLayerChromium::setSize(const FloatSize& size) GraphicsLayer::setSize(clampedSize); updateLayerSize(); - if (m_pageScaleChanged && !m_layer.isNull()) - m_layer.invalidate(); + if (m_pageScaleChanged) { + m_layer->layer()->invalidate(); + if (m_linkHighlight) + m_linkHighlight->invalidate(); + } m_pageScaleChanged = false; } @@ -301,13 +290,13 @@ void GraphicsLayerChromium::setBackgroundColor(const Color& color) void GraphicsLayerChromium::clearBackgroundColor() { GraphicsLayer::clearBackgroundColor(); - m_contentsLayer.setBackgroundColor(static_cast<RGBA32>(0)); + m_contentsLayer->setBackgroundColor(static_cast<RGBA32>(0)); } void GraphicsLayerChromium::setContentsOpaque(bool opaque) { GraphicsLayer::setContentsOpaque(opaque); - m_layer.setOpaque(m_contentsOpaque); + m_layer->layer()->setOpaque(m_contentsOpaque); } static bool copyWebCoreFilterOperationsToWebFilterOperations(const FilterOperations& filters, WebFilterOperations& webFilters) @@ -391,11 +380,11 @@ bool GraphicsLayerChromium::setFilters(const FilterOperations& filters) if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, webFilters)) { // Make sure the filters are removed from the platform layer, as they are // going to fallback to software mode. - m_layer.setFilters(WebFilterOperations()); + m_layer->layer()->setFilters(WebFilterOperations()); GraphicsLayer::setFilters(FilterOperations()); return false; } - m_layer.setFilters(webFilters); + m_layer->layer()->setFilters(webFilters); return GraphicsLayer::setFilters(filters); } @@ -404,7 +393,7 @@ void GraphicsLayerChromium::setBackgroundFilters(const FilterOperations& filters WebFilterOperations webFilters; if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, webFilters)) return; - m_layer.setBackgroundFilters(webFilters); + m_layer->layer()->setBackgroundFilters(webFilters); } void GraphicsLayerChromium::setMaskLayer(GraphicsLayer* maskLayer) @@ -414,23 +403,21 @@ void GraphicsLayerChromium::setMaskLayer(GraphicsLayer* maskLayer) GraphicsLayer::setMaskLayer(maskLayer); - WebLayer maskWebLayer; - if (m_maskLayer) - maskWebLayer = *m_maskLayer->platformLayer(); - m_layer.setMaskLayer(maskWebLayer); + WebLayer* maskWebLayer = m_maskLayer ? m_maskLayer->platformLayer() : 0; + m_layer->layer()->setMaskLayer(maskWebLayer); } void GraphicsLayerChromium::setBackfaceVisibility(bool visible) { GraphicsLayer::setBackfaceVisibility(visible); - m_layer.setDoubleSided(m_backfaceVisibility); + m_layer->setDoubleSided(m_backfaceVisibility); } void GraphicsLayerChromium::setOpacity(float opacity) { float clampedOpacity = max(min(opacity, 1.0f), 0.0f); GraphicsLayer::setOpacity(clampedOpacity); - primaryLayer().setOpacity(opacity); + platformLayer()->setOpacity(opacity); } void GraphicsLayerChromium::setReplicatedByLayer(GraphicsLayer* layer) @@ -438,29 +425,33 @@ void GraphicsLayerChromium::setReplicatedByLayer(GraphicsLayer* layer) GraphicsLayerChromium* layerChromium = static_cast<GraphicsLayerChromium*>(layer); GraphicsLayer::setReplicatedByLayer(layer); - WebLayer webReplicaLayer; - if (layerChromium) - webReplicaLayer = layerChromium->primaryLayer(); - primaryLayer().setReplicaLayer(webReplicaLayer); + WebLayer* webReplicaLayer = layerChromium ? layerChromium->platformLayer() : 0; + platformLayer()->setReplicaLayer(webReplicaLayer); } void GraphicsLayerChromium::setContentsNeedsDisplay() { - if (!m_contentsLayer.isNull()) - m_contentsLayer.invalidate(); + if (m_contentsLayer) + m_contentsLayer->invalidate(); } void GraphicsLayerChromium::setNeedsDisplay() { - if (drawsContent()) - m_layer.invalidate(); + if (drawsContent()) { + m_layer->layer()->invalidate(); + if (m_linkHighlight) + m_linkHighlight->invalidate(); + } } void GraphicsLayerChromium::setNeedsDisplayInRect(const FloatRect& rect) { - if (drawsContent()) - m_layer.invalidateRect(rect); + if (drawsContent()) { + m_layer->layer()->invalidateRect(rect); + if (m_linkHighlight) + m_linkHighlight->invalidate(); + } } void GraphicsLayerChromium::setContentsRect(const IntRect& rect) @@ -476,46 +467,56 @@ void GraphicsLayerChromium::setContentsToImage(Image* image) { bool childrenChanged = false; if (image) { - if (m_contentsLayer.isNull() || m_contentsLayerPurpose != ContentsLayerForImage) { - WebKit::WebImageLayer imageLayer = WebKit::WebImageLayer::create(); - setupContentsLayer(imageLayer); + if (m_contentsLayerPurpose != ContentsLayerForImage) { + m_imageLayer = adoptPtr(WebImageLayer::create()); + setupContentsLayer(m_imageLayer->layer()); m_contentsLayerPurpose = ContentsLayerForImage; childrenChanged = true; } - WebKit::WebImageLayer imageLayer = m_contentsLayer.to<WebKit::WebImageLayer>(); NativeImageSkia* nativeImage = image->nativeImageForCurrentFrame(); - imageLayer.setBitmap(nativeImage->bitmap()); - imageLayer.setOpaque(image->isBitmapImage() && !image->currentFrameHasAlpha()); + m_imageLayer->setBitmap(nativeImage->bitmap()); + m_imageLayer->layer()->setOpaque(image->isBitmapImage() && !image->currentFrameHasAlpha()); updateContentsRect(); } else { - if (!m_contentsLayer.isNull()) { + if (m_imageLayer) { childrenChanged = true; - // The old contents layer will be removed via updateChildList. - m_contentsLayer.reset(); + m_imageLayer.clear(); } + // The old contents layer will be removed via updateChildList. + m_contentsLayer = 0; } if (childrenChanged) updateChildList(); } -void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* platformLayer) +void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* layer) +{ + setContentsTo(ContentsLayerForCanvas, layer); +} + +void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer) +{ + setContentsTo(ContentsLayerForVideo, layer); +} + +void GraphicsLayerChromium::setContentsTo(ContentsLayerPurpose purpose, WebKit::WebLayer* layer) { bool childrenChanged = false; - if (platformLayer) { - if (m_contentsLayer != *platformLayer) { - setupContentsLayer(*platformLayer); - m_contentsLayerPurpose = ContentsLayerForCanvas; + if (layer) { + if (m_contentsLayerId != layer->id()) { + setupContentsLayer(layer); + m_contentsLayerPurpose = purpose; childrenChanged = true; } updateContentsRect(); } else { - if (!m_contentsLayer.isNull()) { + if (m_contentsLayer) { childrenChanged = true; // The old contents layer will be removed via updateChildList. - m_contentsLayer.reset(); + m_contentsLayer = 0; } } @@ -525,7 +526,7 @@ void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* platformLayer) bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset) { - primaryLayer().setAnimationDelegate(this); + platformLayer()->setAnimationDelegate(this); int animationId = mapAnimationNameToId(animationName); int groupId = AnimationIdVendor::getNextGroupId(); @@ -534,8 +535,8 @@ bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const if (toAdd) { // Remove any existing animations with the same animation id and target property. - primaryLayer().removeAnimation(animationId, toAdd->targetProperty()); - return primaryLayer().addAnimation(toAdd.get()); + platformLayer()->removeAnimation(animationId, toAdd->targetProperty()); + return platformLayer()->addAnimation(toAdd.get()); } return false; @@ -543,12 +544,12 @@ bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const void GraphicsLayerChromium::pauseAnimation(const String& animationName, double timeOffset) { - primaryLayer().pauseAnimation(mapAnimationNameToId(animationName), timeOffset); + platformLayer()->pauseAnimation(mapAnimationNameToId(animationName), timeOffset); } void GraphicsLayerChromium::removeAnimation(const String& animationName) { - primaryLayer().removeAnimation(mapAnimationNameToId(animationName)); + platformLayer()->removeAnimation(mapAnimationNameToId(animationName)); } void GraphicsLayerChromium::suspendAnimations(double wallClockTime) @@ -556,88 +557,52 @@ void GraphicsLayerChromium::suspendAnimations(double wallClockTime) // |wallClockTime| is in the wrong time base. Need to convert here. // FIXME: find a more reliable way to do this. double monotonicTime = wallClockTime + monotonicallyIncreasingTime() - currentTime(); - primaryLayer().suspendAnimations(monotonicTime); + platformLayer()->suspendAnimations(monotonicTime); } void GraphicsLayerChromium::resumeAnimations() { - primaryLayer().resumeAnimations(monotonicallyIncreasingTime()); + platformLayer()->resumeAnimations(monotonicallyIncreasingTime()); } -void GraphicsLayerChromium::addLinkHighlight(const Path& path) +void GraphicsLayerChromium::setLinkHighlight(LinkHighlightClient* linkHighlight) { - m_linkHighlight = LinkHighlight::create(this, path, AnimationIdVendor::LinkHighlightAnimationId, AnimationIdVendor::getNextGroupId()); + m_linkHighlight = linkHighlight; updateChildList(); } -void GraphicsLayerChromium::didFinishLinkHighlight() -{ - if (m_linkHighlight) - m_linkHighlight->contentLayer()->removeFromParent(); - - m_linkHighlight.clear(); -} - -void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer) -{ - bool childrenChanged = false; - if (layer) { - if (m_contentsLayer.isNull() || m_contentsLayerPurpose != ContentsLayerForVideo) { - setupContentsLayer(*layer); - m_contentsLayerPurpose = ContentsLayerForVideo; - childrenChanged = true; - } - updateContentsRect(); - } else { - if (!m_contentsLayer.isNull()) { - childrenChanged = true; - - // The old contents layer will be removed via updateChildList. - m_contentsLayer.reset(); - } - } - - if (childrenChanged) - updateChildList(); -} - -WebKit::WebLayer GraphicsLayerChromium::primaryLayer() const -{ - return m_transformLayer.isNull() ? m_layer : m_transformLayer; -} - PlatformLayer* GraphicsLayerChromium::platformLayer() const { - return const_cast<PlatformLayer*>(m_transformLayer.isNull() ? &m_layer : &m_transformLayer); + return m_transformLayer ? m_transformLayer.get() : m_layer->layer(); } void GraphicsLayerChromium::setDebugBackgroundColor(const Color& color) { if (color.isValid()) - m_layer.setBackgroundColor(color.rgb()); + m_layer->layer()->setBackgroundColor(color.rgb()); else - m_layer.setBackgroundColor(static_cast<RGBA32>(0)); + m_layer->layer()->setBackgroundColor(static_cast<RGBA32>(0)); } void GraphicsLayerChromium::setDebugBorder(const Color& color, float borderWidth) { if (color.isValid()) { - m_layer.setDebugBorderColor(color.rgb()); - m_layer.setDebugBorderWidth(borderWidth); + m_layer->layer()->setDebugBorderColor(color.rgb()); + m_layer->layer()->setDebugBorderWidth(borderWidth); } else { - m_layer.setDebugBorderColor(static_cast<RGBA32>(0)); - m_layer.setDebugBorderWidth(0); + m_layer->layer()->setDebugBorderColor(static_cast<RGBA32>(0)); + m_layer->layer()->setDebugBorderWidth(0); } } void GraphicsLayerChromium::updateChildList() { - Vector<WebLayer> newChildren; + Vector<WebLayer*> newChildren; - if (!m_transformLayer.isNull()) { + if (m_transformLayer) { // Add the primary layer first. Even if we have negative z-order children, the primary layer always comes behind. - newChildren.append(m_layer); - } else if (!m_contentsLayer.isNull()) { + newChildren.append(m_layer->layer()); + } else if (m_contentsLayer) { // FIXME: add the contents layer in the correct order with negative z-order children. // This does not cause visible rendering issues because currently contents layers are only used // for replaced elements that don't have children. @@ -649,79 +614,79 @@ void GraphicsLayerChromium::updateChildList() for (size_t i = 0; i < numChildren; ++i) { GraphicsLayerChromium* curChild = static_cast<GraphicsLayerChromium*>(childLayers[i]); - newChildren.append(curChild->primaryLayer()); + newChildren.append(curChild->platformLayer()); } if (m_linkHighlight) - newChildren.append(m_linkHighlight->contentLayer()); + newChildren.append(m_linkHighlight->layer()); for (size_t i = 0; i < newChildren.size(); ++i) - newChildren[i].removeFromParent(); + newChildren[i]->removeFromParent(); - WebVector<WebLayer> newWebChildren; + WebVector<WebLayer*> newWebChildren; newWebChildren.assign(newChildren.data(), newChildren.size()); - if (!m_transformLayer.isNull()) { - m_transformLayer.setChildren(newWebChildren); + if (m_transformLayer) { + m_transformLayer->setChildren(newWebChildren); - if (!m_contentsLayer.isNull()) { + if (m_contentsLayer) { // If we have a transform layer, then the contents layer is parented in the // primary layer (which is itself a child of the transform layer). - m_layer.removeAllChildren(); - m_layer.addChild(m_contentsLayer); + m_layer->layer()->removeAllChildren(); + m_layer->layer()->addChild(m_contentsLayer); } } else - m_layer.setChildren(newWebChildren); + m_layer->layer()->setChildren(newWebChildren); } void GraphicsLayerChromium::updateLayerPosition() { - primaryLayer().setPosition(m_position); + platformLayer()->setPosition(m_position); } void GraphicsLayerChromium::updateLayerSize() { IntSize layerSize(m_size.width(), m_size.height()); - if (!m_transformLayer.isNull()) { - m_transformLayer.setBounds(layerSize); - m_layer.setPosition(FloatPoint()); + if (m_transformLayer) { + m_transformLayer->setBounds(layerSize); + m_layer->layer()->setPosition(FloatPoint()); } - m_layer.setBounds(layerSize); + m_layer->layer()->setBounds(layerSize); - // Note that we don't resize m_contentsLayer. It's up the caller to do that. + // Note that we don't resize m_contentsLayer-> It's up the caller to do that. } void GraphicsLayerChromium::updateAnchorPoint() { - primaryLayer().setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y())); - primaryLayer().setAnchorPointZ(m_anchorPoint.z()); + platformLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y())); + platformLayer()->setAnchorPointZ(m_anchorPoint.z()); } void GraphicsLayerChromium::updateTransform() { - primaryLayer().setTransform(WebTransformationMatrix(m_transform)); + platformLayer()->setTransform(WebTransformationMatrix(m_transform)); } void GraphicsLayerChromium::updateChildrenTransform() { - primaryLayer().setSublayerTransform(WebTransformationMatrix(m_childrenTransform)); + platformLayer()->setSublayerTransform(WebTransformationMatrix(m_childrenTransform)); } void GraphicsLayerChromium::updateMasksToBounds() { - m_layer.setMasksToBounds(m_masksToBounds); + m_layer->layer()->setMasksToBounds(m_masksToBounds); updateDebugIndicators(); } void GraphicsLayerChromium::updateLayerPreserves3D() { - if (m_preserves3D && m_transformLayer.isNull()) { + if (m_preserves3D && !m_transformLayer) { // Create the transform layer. - m_transformLayer = WebLayer::create(); - m_transformLayer.setPreserves3D(true); - m_transformLayer.setAnimationDelegate(this); - m_layer.transferAnimationsTo(&m_transformLayer); + m_transformLayer = adoptPtr(WebLayer::create()); + m_transformLayer->setPreserves3D(true); + m_transformLayer->setAnimationDelegate(this); + m_layer->layer()->transferAnimationsTo(m_transformLayer.get()); // Copy the position from this layer. updateLayerPosition(); @@ -730,34 +695,34 @@ void GraphicsLayerChromium::updateLayerPreserves3D() updateTransform(); updateChildrenTransform(); - m_layer.setPosition(FloatPoint::zero()); + m_layer->layer()->setPosition(FloatPoint::zero()); - m_layer.setAnchorPoint(FloatPoint(0.5f, 0.5f)); - m_layer.setTransform(SkMatrix44()); + m_layer->layer()->setAnchorPoint(FloatPoint(0.5f, 0.5f)); + m_layer->layer()->setTransform(SkMatrix44()); // Set the old layer to opacity of 1. Further down we will set the opacity on the transform layer. - m_layer.setOpacity(1); + m_layer->layer()->setOpacity(1); - m_layer.setContentsScale(contentsScale()); + m_layer->setContentsScale(contentsScale()); // Move this layer to be a child of the transform layer. if (parent()) - parent()->platformLayer()->replaceChild(m_layer, m_transformLayer); - m_transformLayer.addChild(m_layer); + parent()->platformLayer()->replaceChild(m_layer->layer(), m_transformLayer.get()); + m_transformLayer->addChild(m_layer->layer()); updateChildList(); - } else if (!m_preserves3D && !m_transformLayer.isNull()) { + } else if (m_preserves3D && !m_transformLayer) { // Relace the transformLayer in the parent with this layer. - m_layer.removeFromParent(); + m_layer->layer()->removeFromParent(); if (parent()) - parent()->platformLayer()->replaceChild(m_transformLayer, m_layer); + parent()->platformLayer()->replaceChild(m_transformLayer.get(), m_layer->layer()); - m_layer.setAnimationDelegate(this); - m_transformLayer.transferAnimationsTo(&m_layer); + m_layer->layer()->setAnimationDelegate(this); + m_transformLayer->transferAnimationsTo(m_layer->layer()); // Release the transform layer. - m_transformLayer.setAnimationDelegate(0); - m_transformLayer.reset(); + m_transformLayer->setAnimationDelegate(0); + m_transformLayer.clear(); updateLayerPosition(); updateLayerSize(); @@ -768,39 +733,42 @@ void GraphicsLayerChromium::updateLayerPreserves3D() updateChildList(); } - m_layer.setPreserves3D(m_preserves3D); - primaryLayer().setOpacity(m_opacity); + m_layer->layer()->setPreserves3D(m_preserves3D); + platformLayer()->setOpacity(m_opacity); updateNames(); } void GraphicsLayerChromium::updateLayerIsDrawable() { // For the rest of the accelerated compositor code, there is no reason to make a - // distinction between drawsContent and contentsVisible. So, for m_layer, these two + // distinction between drawsContent and contentsVisible. So, for m_layer->layer(), these two // flags are combined here. m_contentsLayer shouldn't receive the drawsContent flag // so it is only given contentsVisible. - m_layer.setDrawsContent(m_drawsContent && m_contentsVisible); + m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); - if (!m_contentsLayer.isNull()) - m_contentsLayer.setDrawsContent(m_contentsVisible); + if (m_contentsLayer) + m_contentsLayer->setDrawsContent(m_contentsVisible); - if (m_drawsContent) - m_layer.invalidate(); + if (m_drawsContent) { + m_layer->layer()->invalidate(); + if (m_linkHighlight) + m_linkHighlight->invalidate(); + } updateDebugIndicators(); } void GraphicsLayerChromium::updateLayerBackgroundColor() { - if (m_contentsLayer.isNull()) + if (!m_contentsLayer) return; // We never create the contents layer just for background color yet. if (m_backgroundColorSet) - m_contentsLayer.setBackgroundColor(m_backgroundColor.rgb()); + m_contentsLayer->setBackgroundColor(m_backgroundColor.rgb()); else - m_contentsLayer.setBackgroundColor(static_cast<RGBA32>(0)); + m_contentsLayer->setBackgroundColor(static_cast<RGBA32>(0)); } void GraphicsLayerChromium::updateContentsVideo() @@ -810,50 +778,42 @@ void GraphicsLayerChromium::updateContentsVideo() void GraphicsLayerChromium::updateContentsRect() { - if (m_contentsLayer.isNull()) + if (!m_contentsLayer) return; - m_contentsLayer.setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y())); - m_contentsLayer.setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height())); + m_contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y())); + m_contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height())); } void GraphicsLayerChromium::updateContentsScale() { // If page scale is already applied then there's no need to apply it again. - if (appliesPageScale() || m_layer.isNull()) + if (appliesPageScale()) return; - m_layer.setContentsScale(contentsScale()); + m_layer->setContentsScale(contentsScale()); } -void GraphicsLayerChromium::setupContentsLayer(WebLayer contentsLayer) +void GraphicsLayerChromium::setupContentsLayer(WebLayer* contentsLayer) { - if (contentsLayer == m_contentsLayer) - return; - - if (!m_contentsLayer.isNull()) { - m_contentsLayer.setUseParentBackfaceVisibility(false); - m_contentsLayer.removeFromParent(); - m_contentsLayer.reset(); - } - m_contentsLayer = contentsLayer; + m_contentsLayerId = m_contentsLayer->id(); - if (!m_contentsLayer.isNull()) { - m_contentsLayer.setAnchorPoint(FloatPoint(0, 0)); - m_contentsLayer.setUseParentBackfaceVisibility(true); + if (m_contentsLayer) { + m_contentsLayer->setAnchorPoint(FloatPoint(0, 0)); + m_contentsLayer->setUseParentBackfaceVisibility(true); // It is necessary to call setDrawsContent as soon as we receive the new contentsLayer, for // the correctness of early exit conditions in setDrawsContent() and setContentsVisible(). - m_contentsLayer.setDrawsContent(m_contentsVisible); + m_contentsLayer->setDrawsContent(m_contentsVisible); // Insert the content layer first. Video elements require this, because they have // shadow content that must display in front of the video. - m_layer.insertChild(m_contentsLayer, 0); + m_layer->layer()->insertChild(m_contentsLayer, 0); if (showDebugBorders()) { - m_contentsLayer.setDebugBorderColor(Color(0, 0, 128, 180).rgb()); - m_contentsLayer.setDebugBorderWidth(1); + m_contentsLayer->setDebugBorderColor(Color(0, 0, 128, 180).rgb()); + m_contentsLayer->setDebugBorderWidth(1); } } updateDebugIndicators(); diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h index aa64ead6d..4fc8d1cfd 100644 --- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h +++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h @@ -39,20 +39,32 @@ #include <public/WebAnimationDelegate.h> #include <public/WebContentLayer.h> +#include <public/WebImageLayer.h> #include <public/WebLayer.h> #include <wtf/HashMap.h> namespace WebCore { class LayerChromium; -class LinkHighlight; class Path; +class LinkHighlightClient { +public: + virtual void invalidate() = 0; + virtual void clearCurrentGraphicsLayer() = 0; + virtual WebKit::WebLayer* layer() = 0; + +protected: + virtual ~LinkHighlightClient() { } +}; + class GraphicsLayerChromium : public GraphicsLayer, public GraphicsContextPainter, public WebKit::WebAnimationDelegate { public: GraphicsLayerChromium(GraphicsLayerClient*); virtual ~GraphicsLayerChromium(); + virtual void willBeDestroyed() OVERRIDE; + virtual void setName(const String&); virtual bool setChildren(const Vector<GraphicsLayer*>&); @@ -101,7 +113,7 @@ public: virtual void setContentsToImage(Image*); virtual void setContentsToMedia(PlatformLayer*); virtual void setContentsToCanvas(PlatformLayer*); - virtual bool hasContentsLayer() const { return !m_contentsLayer.isNull(); } + virtual bool hasContentsLayer() const { return m_contentsLayer; } virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String&, double timeOffset); virtual void pauseAnimation(const String& animationName, double timeOffset); @@ -109,8 +121,9 @@ public: virtual void suspendAnimations(double wallClockTime); virtual void resumeAnimations(); - virtual void addLinkHighlight(const Path&); - virtual void didFinishLinkHighlight(); + void setLinkHighlight(LinkHighlightClient*); + // Next function for testing purposes. + LinkHighlightClient* linkHighlight() { return m_linkHighlight; } virtual PlatformLayer* platformLayer() const; @@ -125,15 +138,13 @@ public: virtual void notifyAnimationStarted(double startTime) OVERRIDE; virtual void notifyAnimationFinished(double finishTime) OVERRIDE; + WebKit::WebContentLayer* contentLayer() const { return m_layer.get(); } + // Exposed for tests. - WebKit::WebLayer contentsLayer() const { return m_contentsLayer; } + WebKit::WebLayer* contentsLayer() const { return m_contentsLayer; } float contentsScale() const; private: - virtual void willBeDestroyed(); - - WebKit::WebLayer primaryLayer() const; - void updateNames(); void updateChildList(); void updateLayerPosition(); @@ -151,32 +162,39 @@ private: void updateContentsRect(); void updateContentsScale(); - void setupContentsLayer(WebKit::WebLayer); + enum ContentsLayerPurpose { + NoContentsLayer = 0, + ContentsLayerForImage, + ContentsLayerForVideo, + ContentsLayerForCanvas, + }; + + void setContentsTo(ContentsLayerPurpose, WebKit::WebLayer*); + void setupContentsLayer(WebKit::WebLayer*); int mapAnimationNameToId(const String& animationName); String m_nameBase; - WebKit::WebContentLayer m_layer; - WebKit::WebLayer m_transformLayer; - WebKit::WebLayer m_contentsLayer; + OwnPtr<WebKit::WebContentLayer> m_layer; + OwnPtr<WebKit::WebLayer> m_transformLayer; + OwnPtr<WebKit::WebImageLayer> m_imageLayer; + WebKit::WebLayer* m_contentsLayer; + // We don't have ownership of m_contentsLayer, but we do want to know if a given layer is the + // same as our current layer in setContentsTo(). Since m_contentsLayer may be deleted at this point, + // we stash an ID away when we know m_contentsLayer is alive and use that for comparisons from that point + // on. + int m_contentsLayerId; - OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLayerDelegate; + LinkHighlightClient* m_linkHighlight; - enum ContentsLayerPurpose { - NoContentsLayer = 0, - ContentsLayerForImage, - ContentsLayerForVideo, - ContentsLayerForCanvas, - }; + OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLayerDelegate; ContentsLayerPurpose m_contentsLayerPurpose; bool m_contentsLayerHasBackgroundColor : 1; bool m_inSetChildren; bool m_pageScaleChanged; - RefPtr<LinkHighlight> m_linkHighlight; - typedef HashMap<String, int> AnimationIdMap; AnimationIdMap m_animationIdMap; }; diff --git a/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp index f7e603ed8..f8d869fad 100644 --- a/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp @@ -148,8 +148,7 @@ void ImageLayerChromium::update(CCTextureUpdateQueue& queue, const CCOcclusionTr invalidateContentRect(IntRect(IntPoint(), contentBounds())); m_needsDisplay = false; } - - updateContentRect(queue, visibleContentRect(), occlusion, stats); + TiledLayerChromium::update(queue, occlusion, stats); } void ImageLayerChromium::createTextureUpdaterIfNeeded() diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp index 30c81b65c..4e7fa74f5 100644 --- a/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp @@ -234,10 +234,11 @@ void LayerChromium::setBounds(const IntSize& size) setNeedsCommit(); } -const LayerChromium* LayerChromium::rootLayer() const +LayerChromium* LayerChromium::rootLayer() { - const LayerChromium* layer = this; - for (LayerChromium* parent = layer->parent(); parent; layer = parent, parent = parent->parent()) { } + LayerChromium* layer = this; + while (layer->parent()) + layer = layer->parent(); return layer; } diff --git a/Source/WebCore/platform/graphics/chromium/LayerChromium.h b/Source/WebCore/platform/graphics/chromium/LayerChromium.h index ec14a51a7..2e541ee7b 100644 --- a/Source/WebCore/platform/graphics/chromium/LayerChromium.h +++ b/Source/WebCore/platform/graphics/chromium/LayerChromium.h @@ -95,7 +95,7 @@ public: // The root layer is a special case -- it operates in physical pixels. virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE { return m_transform; } - const LayerChromium* rootLayer() const; + LayerChromium* rootLayer(); LayerChromium* parent() const; void addChild(PassRefPtr<LayerChromium>); void insertChild(PassRefPtr<LayerChromium>, size_t index); diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp index 36e47d177..84f00a1c7 100644 --- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp @@ -363,7 +363,7 @@ static inline SkBitmap applyFilters(LayerRendererChromium* layerRenderer, const layerRenderer->context()->flush(); - CCScopedLockResourceForWrite lock(layerRenderer->resourceProvider(), sourceTexture->id()); + CCResourceProvider::ScopedWriteLockGL lock(layerRenderer->resourceProvider(), sourceTexture->id()); SkBitmap source = CCRenderSurfaceFilters::apply(filters, lock.textureId(), sourceTexture->size(), filterContext, filterGrContext); return source; } @@ -465,20 +465,20 @@ void LayerRendererChromium::drawRenderPassQuad(DrawingFrame& frame, const CCRend // FIXME: Cache this value so that we don't have to do it for both the surface and its replica. // Apply filters to the contents texture. SkBitmap filterBitmap = applyFilters(this, renderPass->filters(), contentsTexture); - OwnPtr<CCScopedLockResourceForRead> contentsResourceLock; + OwnPtr<CCResourceProvider::ScopedReadLockGL> contentsResourceLock; unsigned contentsTextureId = 0; if (filterBitmap.getTexture()) { GrTexture* texture = reinterpret_cast<GrTexture*>(filterBitmap.getTexture()); contentsTextureId = texture->getTextureHandle(); } else { - contentsResourceLock = adoptPtr(new CCScopedLockResourceForRead(m_resourceProvider, contentsTexture->id())); + contentsResourceLock = adoptPtr(new CCResourceProvider::ScopedReadLockGL(m_resourceProvider, contentsTexture->id())); contentsTextureId = contentsResourceLock->textureId(); } // Draw the background texture if there is one. if (backgroundTexture) { ASSERT(backgroundTexture->size() == quad->quadRect().size()); - CCScopedLockResourceForRead lock(m_resourceProvider, backgroundTexture->id()); + CCResourceProvider::ScopedReadLockGL lock(m_resourceProvider, backgroundTexture->id()); copyTextureToFramebuffer(frame, lock.textureId(), quad->quadRect(), quad->quadTransform()); } @@ -495,10 +495,10 @@ void LayerRendererChromium::drawRenderPassQuad(DrawingFrame& frame, const CCRend deviceLayerEdges.inflateAntiAliasingDistance(); } - OwnPtr<CCScopedLockResourceForRead> maskResourceLock; + OwnPtr<CCResourceProvider::ScopedReadLockGL> maskResourceLock; unsigned maskTextureId = 0; if (quad->maskResourceId()) { - maskResourceLock = adoptPtr(new CCScopedLockResourceForRead(m_resourceProvider, quad->maskResourceId())); + maskResourceLock = adoptPtr(new CCResourceProvider::ScopedReadLockGL(m_resourceProvider, quad->maskResourceId())); maskTextureId = maskResourceLock->textureId(); } @@ -689,7 +689,7 @@ void LayerRendererChromium::drawTileQuad(const DrawingFrame& frame, const CCTile GLC(context(), context()->useProgram(uniforms.program)); GLC(context(), context()->uniform1i(uniforms.samplerLocation, 0)); GLC(context(), context()->activeTexture(GraphicsContext3D::TEXTURE0)); - CCScopedLockResourceForRead quadResourceLock(m_resourceProvider, quad->resourceId()); + CCResourceProvider::ScopedReadLockGL quadResourceLock(m_resourceProvider, quad->resourceId()); GLC(context(), context()->bindTexture(GraphicsContext3D::TEXTURE_2D, quadResourceLock.textureId())); GLC(context(), context()->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, quad->textureFilter())); GLC(context(), context()->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, quad->textureFilter())); @@ -796,9 +796,9 @@ void LayerRendererChromium::drawYUVVideoQuad(const DrawingFrame& frame, const CC const CCVideoLayerImpl::FramePlane& uPlane = quad->uPlane(); const CCVideoLayerImpl::FramePlane& vPlane = quad->vPlane(); - CCScopedLockResourceForRead yPlaneLock(m_resourceProvider, yPlane.resourceId); - CCScopedLockResourceForRead uPlaneLock(m_resourceProvider, uPlane.resourceId); - CCScopedLockResourceForRead vPlaneLock(m_resourceProvider, vPlane.resourceId); + CCResourceProvider::ScopedReadLockGL yPlaneLock(m_resourceProvider, yPlane.resourceId); + CCResourceProvider::ScopedReadLockGL uPlaneLock(m_resourceProvider, uPlane.resourceId); + CCResourceProvider::ScopedReadLockGL vPlaneLock(m_resourceProvider, vPlane.resourceId); GLC(context(), context()->activeTexture(GraphicsContext3D::TEXTURE1)); GLC(context(), context()->bindTexture(GraphicsContext3D::TEXTURE_2D, yPlaneLock.textureId())); GLC(context(), context()->activeTexture(GraphicsContext3D::TEXTURE2)); @@ -907,7 +907,7 @@ void LayerRendererChromium::drawTextureQuad(const DrawingFrame& frame, const CCT GLC(context(), context()->uniform4f(binding.texTransformLocation, uvRect.x(), uvRect.y(), uvRect.width(), uvRect.height())); GLC(context(), context()->activeTexture(GraphicsContext3D::TEXTURE0)); - CCScopedLockResourceForRead quadResourceLock(m_resourceProvider, quad->resourceId()); + CCResourceProvider::ScopedReadLockGL quadResourceLock(m_resourceProvider, quad->resourceId()); GLC(context(), context()->bindTexture(GraphicsContext3D::TEXTURE_2D, quadResourceLock.textureId())); // FIXME: setting the texture parameters every time is redundant. Move this code somewhere @@ -1199,7 +1199,7 @@ bool LayerRendererChromium::getFramebufferTexture(CCScopedTexture* texture, cons if (!texture->id() && !texture->allocate(CCRenderer::ImplPool, deviceRect.size(), GraphicsContext3D::RGB, CCResourceProvider::TextureUsageAny)) return false; - CCScopedLockResourceForWrite lock(m_resourceProvider, texture->id()); + CCResourceProvider::ScopedWriteLockGL lock(m_resourceProvider, texture->id()); GLC(m_context, m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, lock.textureId())); GLC(m_context, m_context->copyTexImage2D(GraphicsContext3D::TEXTURE_2D, 0, texture->format(), deviceRect.x(), deviceRect.y(), deviceRect.width(), deviceRect.height(), 0)); @@ -1226,7 +1226,7 @@ bool LayerRendererChromium::bindFramebufferToTexture(DrawingFrame& frame, const ASSERT(texture->id()); GLC(m_context, m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_offscreenFramebufferId)); - m_currentFramebufferLock = adoptPtr(new CCScopedLockResourceForWrite(m_resourceProvider, texture->id())); + m_currentFramebufferLock = adoptPtr(new CCResourceProvider::ScopedWriteLockGL(m_resourceProvider, texture->id())); unsigned textureId = m_currentFramebufferLock->textureId(); GLC(m_context, m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, textureId, 0)); diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h index 09cd0e291..3575c193d 100644 --- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h +++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h @@ -248,7 +248,7 @@ private: bool m_visible; TextureUploaderOption m_textureUploaderSetting; - OwnPtr<CCScopedLockResourceForWrite> m_currentFramebufferLock; + OwnPtr<CCResourceProvider::ScopedWriteLockGL> m_currentFramebufferLock; }; diff --git a/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp b/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp deleted file mode 100644 index 1d447304f..000000000 --- a/Source/WebCore/platform/graphics/chromium/LinkHighlight.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" - -#include "LinkHighlight.h" - -#include "CCKeyframedAnimationCurve.h" -#include "GraphicsLayerChromium.h" -#include "PlatformContextSkia.h" -#include <wtf/CurrentTime.h> -#include <wtf/OwnPtr.h> - -#if USE(ACCELERATED_COMPOSITING) - -using WebKit::WebTransformationMatrix; - -namespace WebCore { - -PassRefPtr<LinkHighlight> LinkHighlight::create(GraphicsLayerChromium* parent, const Path& path, int animationId, int groupId) -{ - return adoptRef(new LinkHighlight(parent, path, animationId, groupId)); -} - -LinkHighlight::LinkHighlight(GraphicsLayerChromium* parent, const Path& path, int animationId, int groupId) - : m_contentLayer(ContentLayerChromium::create(this)) - , m_parent(parent) - , m_path(path) -{ - m_contentLayer->setIsDrawable(true); - - IntRect rect = enclosingIntRect(path.boundingRect()); - - m_contentLayer->setBounds(rect.size()); - - WebTransformationMatrix transform; - transform.translate(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2); - m_contentLayer->setTransform(transform); - - m_path.translate(FloatSize(-rect.x(), -rect.y())); - - m_contentLayer->setLayerAnimationDelegate(this); - - // FIXME: Should these be configurable? - const float startOpacity = 0.25; - const float duration = 2; - - m_contentLayer->setOpacity(startOpacity); - - OwnPtr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create()); - curve->addKeyframe(CCFloatKeyframe::create(0, startOpacity, nullptr)); - curve->addKeyframe(CCFloatKeyframe::create(duration / 2, startOpacity, nullptr)); - curve->addKeyframe(CCFloatKeyframe::create(duration, 0, nullptr)); - - // animationId = 1 is reserved for us. - OwnPtr<CCActiveAnimation> animation(CCActiveAnimation::create(curve.release(), animationId, groupId, CCActiveAnimation::Opacity)); - animation->setNeedsSynchronizedStartTime(true); - m_contentLayer->layerAnimationController()->addAnimation(animation.release()); -} - -LinkHighlight::~LinkHighlight() -{ - m_contentLayer->removeFromParent(); - m_contentLayer->clearDelegate(); - m_contentLayer->setLayerAnimationDelegate(0); -} - -ContentLayerChromium* LinkHighlight::contentLayer() -{ - return m_contentLayer.get(); -} - -void LinkHighlight::paintContents(SkCanvas* canvas, const IntRect&, FloatRect&) -{ - PlatformContextSkia platformContext(canvas); - GraphicsContext gc(&platformContext); - // FIXME: make colour configurable? - gc.setStrokeColor(Color(0, 0, 255, 255), ColorSpaceDeviceRGB); - gc.setStrokeThickness(2); - gc.strokePath(m_path); - gc.setFillColor(Color(255, 0, 255, 255), ColorSpaceDeviceRGB); - gc.fillPath(m_path); -} - -void LinkHighlight::notifyAnimationStarted(double) -{ -} - -void LinkHighlight::notifyAnimationFinished(double) -{ - // Allow null parent pointer to facilitate testing. - if (m_parent) - m_parent->didFinishLinkHighlight(); -} - -} // namespace WebCore - -#endif // USE(ACCELERATED_COMPOSITING) diff --git a/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp b/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp index a3dbd770a..579fa2860 100644 --- a/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp +++ b/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp @@ -81,6 +81,8 @@ void SimpleFontData::platformInit() OUTLINETEXTMETRIC outlineTextMetric; if (GetOutlineTextMetrics(dc, sizeof(outlineTextMetric), &outlineTextMetric) > 0) { + m_fontMetrics.setUnitsPerEm(outlineTextMetric.otmEMSquare); + // This is a TrueType font. We might be able to get an accurate xHeight. GLYPHMETRICS glyphMetrics = {0}; MAT2 identityMatrix = {{0, 1}, {0, 0}, {0, 0}, {0, 1}}; @@ -114,7 +116,7 @@ PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri float scaledSize = scaleFactor * fontDescription.computedSize(); winFont.lfHeight = -lroundf(scaledSize); HFONT hfont = CreateFontIndirect(&winFont); - return adoptPtr(new SimpleFontData(FontPlatformData(hfont, scaledSize), isCustomFont(), false)); + return adoptPtr(new SimpleFontData(FontPlatformData(hfont, scaledSize, m_platformData.orientation()), isCustomFont(), false)); } SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const @@ -168,9 +170,28 @@ void SimpleFontData::determinePitch() SelectObject(dc, oldFont); } -FloatRect SimpleFontData::platformBoundsForGlyph(Glyph) const +FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const { - return FloatRect(); + HWndDC hdc(0); + SetGraphicsMode(hdc, GM_ADVANCED); + HGDIOBJ oldFont = SelectObject(hdc, m_platformData.hfont()); + + GLYPHMETRICS gdiMetrics; + static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 }; + if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1) { + if (PlatformSupport::ensureFontLoaded(m_platformData.hfont())) { + // Retry GetTextMetrics. + // FIXME: Handle gracefully the error if this call also fails. + // See http://crbug.com/6401. + if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1) + LOG_ERROR("Unable to get the glyph metrics after second attempt"); + } + } + + SelectObject(hdc, oldFont); + + return FloatRect(gdiMetrics.gmptGlyphOrigin.x, -gdiMetrics.gmptGlyphOrigin.y, + gdiMetrics.gmBlackBoxX, gdiMetrics.gmBlackBoxY); } float SimpleFontData::platformWidthForGlyph(Glyph glyph) const diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp index cce163522..68bfa45b0 100644 --- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp @@ -553,11 +553,6 @@ void TiledLayerChromium::updateTileTextures(const IntRect& paintRect, int left, } } -void TiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& priorityCalc) -{ - setTexturePrioritiesInRect(priorityCalc, visibleContentRect()); -} - namespace { // This picks a small animated layer to be anything less than one viewport. This // is specifically for page transitions which are viewport-sized layers. The extra @@ -592,7 +587,7 @@ void setPriorityForTexture(const CCPriorityCalculator& priorityCalc, } } -void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& priorityCalc, const IntRect& visibleContentRect) +void TiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& priorityCalc) { updateBounds(); resetUpdateState(); @@ -604,7 +599,7 @@ void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& bool smallAnimatedLayer = isSmallAnimatedLayer(this); // Minimally create the tiles in the desired pre-paint rect. - IntRect createTilesRect = idlePaintRect(visibleContentRect); + IntRect createTilesRect = idlePaintRect(); if (!createTilesRect.isEmpty()) { int left, top, right, bottom; m_tiler->contentRectToTileIndices(createTilesRect, left, top, right, bottom); @@ -618,7 +613,7 @@ void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& // Also, minimally create all tiles for small animated layers and also // double-buffer them since we have limited their size to be reasonable. - IntRect doubleBufferedRect = visibleContentRect; + IntRect doubleBufferedRect = visibleContentRect(); if (smallAnimatedLayer) doubleBufferedRect = IntRect(IntPoint::zero(), contentBounds()); @@ -647,7 +642,7 @@ void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& IntRect tileRect = m_tiler->tileRect(tile); tile->dirtyRect = tileRect; LayerTextureUpdater::Texture* backBuffer = tile->texture(); - setPriorityForTexture(priorityCalc, visibleContentRect, tile->dirtyRect, drawsToRoot, smallAnimatedLayer, backBuffer->texture()); + setPriorityForTexture(priorityCalc, visibleContentRect(), tile->dirtyRect, drawsToRoot, smallAnimatedLayer, backBuffer->texture()); OwnPtr<CCPrioritizedTexture> frontBuffer = CCPrioritizedTexture::create(backBuffer->texture()->textureManager(), backBuffer->texture()->size(), backBuffer->texture()->format()); @@ -665,7 +660,7 @@ void TiledLayerChromium::setTexturePrioritiesInRect(const CCPriorityCalculator& if (!tile) continue; IntRect tileRect = m_tiler->tileRect(tile); - setPriorityForTexture(priorityCalc, visibleContentRect, tileRect, drawsToRoot, smallAnimatedLayer, tile->managedTexture()); + setPriorityForTexture(priorityCalc, visibleContentRect(), tileRect, drawsToRoot, smallAnimatedLayer, tile->managedTexture()); } } @@ -680,6 +675,9 @@ Region TiledLayerChromium::visibleContentOpaqueRegion() const void TiledLayerChromium::resetUpdateState() { + m_skipsDraw = false; + m_failedUpdate = false; + CCLayerTilingData::TileMap::const_iterator end = m_tiler->tiles().end(); for (CCLayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begin(); iter != end; ++iter) { UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second.get()); @@ -690,13 +688,11 @@ void TiledLayerChromium::resetUpdateState() } } -void TiledLayerChromium::updateContentRect(CCTextureUpdateQueue& queue, const IntRect& contentRect, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) +void TiledLayerChromium::update(CCTextureUpdateQueue& queue, const CCOcclusionTracker* occlusion, CCRenderingStats& stats) { - m_skipsDraw = false; - m_failedUpdate = false; + ASSERT(!m_skipsDraw && !m_failedUpdate); // Did resetUpdateState get skipped? updateBounds(); - - if (m_tiler->hasEmptyBounds()) + if (m_tiler->hasEmptyBounds() || !drawsContent()) return; bool didPaint = false; @@ -715,12 +711,12 @@ void TiledLayerChromium::updateContentRect(CCTextureUpdateQueue& queue, const In m_failedUpdate = false; } - if (contentRect.isEmpty()) + if (visibleContentRect().isEmpty()) return; // Visible painting. First occlude visible tiles and paint the non-occluded tiles. int left, top, right, bottom; - m_tiler->contentRectToTileIndices(contentRect, left, top, right, bottom); + m_tiler->contentRectToTileIndices(visibleContentRect(), left, top, right, bottom); markOcclusionsAndRequestTextures(left, top, right, bottom, occlusion); m_skipsDraw = !updateTiles(left, top, right, bottom, queue, occlusion, stats, didPaint); if (m_skipsDraw) @@ -729,7 +725,7 @@ void TiledLayerChromium::updateContentRect(CCTextureUpdateQueue& queue, const In return; // If we have already painting everything visible. Do some pre-painting while idle. - IntRect idlePaintContentRect = idlePaintRect(contentRect); + IntRect idlePaintContentRect = idlePaintRect(); if (idlePaintContentRect.isEmpty()) return; @@ -765,13 +761,13 @@ void TiledLayerChromium::updateContentRect(CCTextureUpdateQueue& queue, const In } } -bool TiledLayerChromium::needsIdlePaint(const IntRect& visibleContentRect) +bool TiledLayerChromium::needsIdlePaint() { // Don't trigger more paints if we failed (as we'll just fail again). - if (m_failedUpdate || visibleContentRect.isEmpty() || m_tiler->hasEmptyBounds()) + if (m_failedUpdate || visibleContentRect().isEmpty() || m_tiler->hasEmptyBounds() || !drawsContent()) return false; - IntRect idlePaintContentRect = idlePaintRect(visibleContentRect); + IntRect idlePaintContentRect = idlePaintRect(); if (idlePaintContentRect.isEmpty()) return false; @@ -795,15 +791,15 @@ bool TiledLayerChromium::needsIdlePaint(const IntRect& visibleContentRect) return false; } -IntRect TiledLayerChromium::idlePaintRect(const IntRect& visibleContentRect) +IntRect TiledLayerChromium::idlePaintRect() { // Don't inflate an empty rect. - if (visibleContentRect.isEmpty()) - return visibleContentRect; + if (visibleContentRect().isEmpty()) + return IntRect(); // FIXME: This can be made a lot larger now! We should increase // this slowly while insuring it doesn't cause any perf issues. - IntRect prepaintRect = visibleContentRect; + IntRect prepaintRect = visibleContentRect(); prepaintRect.inflateX(m_tiler->tileSize().width()); prepaintRect.inflateY(m_tiler->tileSize().height() * 2); IntRect contentRect(IntPoint::zero(), contentBounds()); diff --git a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h index 33263e543..2abc11298 100644 --- a/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h +++ b/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h @@ -60,6 +60,8 @@ public: virtual Region visibleContentOpaqueRegion() const OVERRIDE; + virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE; + protected: TiledLayerChromium(); @@ -82,13 +84,9 @@ protected: // Reset state on tiles that will be used for updating the layer. void resetUpdateState(); - // Prepare data needed to update textures that intersect with contentRect. - void updateContentRect(CCTextureUpdateQueue&, const IntRect& contentRect, const CCOcclusionTracker*, CCRenderingStats&); - // After preparing an update, returns true if more painting is needed. - bool needsIdlePaint(const IntRect& visibleContentRect); - - IntRect idlePaintRect(const IntRect& visibleContentRect); + bool needsIdlePaint(); + IntRect idlePaintRect(); bool skipsDraw() const { return m_skipsDraw; } @@ -104,8 +102,6 @@ private: bool tileOnlyNeedsPartialUpdate(UpdatableTile*); bool tileNeedsBufferedUpdate(UpdatableTile*); - void setTexturePrioritiesInRect(const CCPriorityCalculator&, const IntRect& visibleContentRect); - void markOcclusionsAndRequestTextures(int left, int top, int right, int bottom, const CCOcclusionTracker*); bool updateTiles(int left, int top, int right, int bottom, CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&, bool& didPaint); diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp index 8a5d6af9d..fb36b4cae 100644 --- a/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp +++ b/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.cpp @@ -31,6 +31,7 @@ #include "IntRect.h" #include "LayerRendererChromium.h" // For the GLC() macro #include "LayerTextureSubImage.h" +#include <limits.h> #include <public/WebGraphicsContext3D.h> #include <wtf/HashSet.h> @@ -88,13 +89,24 @@ bool CCResourceProvider::inUseByConsumer(ResourceId id) CCResourceProvider::ResourceId CCResourceProvider::createResource(int pool, const IntSize& size, GC3Denum format, TextureUsageHint hint) { + switch (m_defaultResourceType) { + case GLTexture: + return createGLTexture(pool, size, format, hint); + case Bitmap: + ASSERT(format == GraphicsContext3D::RGBA); + return createBitmap(pool, size); + } + + CRASH(); + return 0; +} + +CCResourceProvider::ResourceId CCResourceProvider::createGLTexture(int pool, const IntSize& size, GC3Denum format, TextureUsageHint hint) +{ ASSERT(CCProxy::isImplThread()); unsigned textureId = 0; WebGraphicsContext3D* context3d = m_context->context3D(); - if (!context3d) { - // FIXME: Implement this path for software compositing. - return 0; - } + ASSERT(context3d); GLC(context3d, textureId = context3d->createTexture()); GLC(context3d, context3d->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId)); GLC(context3d, context3d->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR)); @@ -115,12 +127,24 @@ CCResourceProvider::ResourceId CCResourceProvider::createResource(int pool, cons return id; } +CCResourceProvider::ResourceId CCResourceProvider::createBitmap(int pool, const IntSize& size) +{ + ASSERT(CCProxy::isImplThread()); + + uint8_t* pixels = new uint8_t[size.width() * size.height() * 4]; + + ResourceId id = m_nextId++; + Resource resource(pixels, pool, size, GraphicsContext3D::RGBA); + m_resources.add(id, resource); + return id; +} + CCResourceProvider::ResourceId CCResourceProvider::createResourceFromExternalTexture(unsigned textureId) { ASSERT(CCProxy::isImplThread()); + ASSERT(m_context->context3D()); ResourceId id = m_nextId++; - Resource resource; - resource.glId = textureId; + Resource resource(textureId, 0, IntSize(), 0); resource.external = true; m_resources.add(id, resource); return id; @@ -129,15 +153,17 @@ CCResourceProvider::ResourceId CCResourceProvider::createResourceFromExternalTex void CCResourceProvider::deleteResource(ResourceId id) { ASSERT(CCProxy::isImplThread()); - WebGraphicsContext3D* context3d = m_context->context3D(); - if (!context3d) { - // FIXME: Implement this path for software compositing. - return; - } ResourceMap::iterator it = m_resources.find(id); ASSERT(it != m_resources.end() && !it->second.lockedForWrite && !it->second.lockForReadCount); - if (!it->second.external) + + if (it->second.glId && !it->second.external) { + WebGraphicsContext3D* context3d = m_context->context3D(); + ASSERT(context3d); GLC(context3d, context3d->deleteTexture(it->second.glId)); + } + if (it->second.pixels) + delete it->second.pixels; + m_resources.remove(it); } @@ -153,71 +179,68 @@ void CCResourceProvider::deleteOwnedResources(int pool) deleteResource(*it); } -void CCResourceProvider::upload(ResourceId id, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntSize& destOffset) +CCResourceProvider::ResourceType CCResourceProvider::resourceType(ResourceId id) { - ASSERT(CCProxy::isImplThread()); - ASSERT(m_texSubImage.get()); - WebGraphicsContext3D* context3d = m_context->context3D(); - if (!context3d) { - // FIXME: Implement this path for software compositing. - return; - } ResourceMap::iterator it = m_resources.find(id); - ASSERT(it != m_resources.end() && !it->second.lockedForWrite && !it->second.lockForReadCount && !it->second.external); - - context3d->bindTexture(GraphicsContext3D::TEXTURE_2D, it->second.glId); - m_texSubImage->upload(image, imageRect, sourceRect, destOffset, it->second.format, context3d); + ASSERT(it != m_resources.end()); + return it->second.type; } -unsigned CCResourceProvider::lockForWrite(ResourceId id) +void CCResourceProvider::upload(ResourceId id, const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntSize& destOffset) { ASSERT(CCProxy::isImplThread()); ResourceMap::iterator it = m_resources.find(id); ASSERT(it != m_resources.end() && !it->second.lockedForWrite && !it->second.lockForReadCount && !it->second.external); - it->second.lockedForWrite = true; - return it->second.glId; -} -void CCResourceProvider::unlockForWrite(ResourceId id) -{ - ASSERT(CCProxy::isImplThread()); - ResourceMap::iterator it = m_resources.find(id); - ASSERT(it != m_resources.end() && it->second.lockedForWrite && !it->second.external); - it->second.lockedForWrite = false; + if (it->second.glId) { + WebGraphicsContext3D* context3d = m_context->context3D(); + ASSERT(context3d); + ASSERT(m_texSubImage.get()); + context3d->bindTexture(GraphicsContext3D::TEXTURE_2D, it->second.glId); + m_texSubImage->upload(image, imageRect, sourceRect, destOffset, it->second.format, context3d); + } + + if (it->second.pixels) { + SkBitmap srcFull; + srcFull.setConfig(SkBitmap::kARGB_8888_Config, imageRect.width(), imageRect.height()); + srcFull.setPixels(const_cast<uint8_t*>(image)); + SkBitmap srcSubset; + SkIRect skSourceRect = SkIRect::MakeXYWH(sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height()); + skSourceRect.offset(-imageRect.x(), -imageRect.y()); + srcFull.extractSubset(&srcSubset, skSourceRect); + + ScopedWriteLockSoftware lock(this, id); + SkCanvas* dest = lock.skCanvas(); + dest->writePixels(srcSubset, destOffset.width(), destOffset.height()); + } } void CCResourceProvider::flush() { ASSERT(CCProxy::isImplThread()); WebGraphicsContext3D* context3d = m_context->context3D(); - if (!context3d) { - // FIXME: Implement this path for software compositing. - return; - } - context3d->flush(); + if (context3d) + context3d->flush(); } bool CCResourceProvider::shallowFlushIfSupported() { ASSERT(CCProxy::isImplThread()); WebGraphicsContext3D* context3d = m_context->context3D(); - if (!context3d) { - // FIXME: Implement this path for software compositing. + if (!context3d || !m_useShallowFlush) return false; - } - if (m_useShallowFlush) - context3d->shallowFlushCHROMIUM(); - return m_useShallowFlush; + context3d->shallowFlushCHROMIUM(); + return true; } -unsigned CCResourceProvider::lockForRead(ResourceId id) +const CCResourceProvider::Resource* CCResourceProvider::lockForRead(ResourceId id) { ASSERT(CCProxy::isImplThread()); ResourceMap::iterator it = m_resources.find(id); ASSERT(it != m_resources.end() && !it->second.lockedForWrite); - ++(it->second.lockForReadCount); - return it->second.glId; + it->second.lockForReadCount++; + return &it->second; } void CCResourceProvider::unlockForRead(ResourceId id) @@ -225,13 +248,90 @@ void CCResourceProvider::unlockForRead(ResourceId id) ASSERT(CCProxy::isImplThread()); ResourceMap::iterator it = m_resources.find(id); ASSERT(it != m_resources.end() && it->second.lockForReadCount > 0); - --(it->second.lockForReadCount); + it->second.lockForReadCount--; +} + +const CCResourceProvider::Resource* CCResourceProvider::lockForWrite(ResourceId id) +{ + ASSERT(CCProxy::isImplThread()); + ResourceMap::iterator it = m_resources.find(id); + ASSERT(it != m_resources.end() && !it->second.lockedForWrite && !it->second.lockForReadCount && !it->second.external); + it->second.lockedForWrite = true; + return &it->second; +} + +void CCResourceProvider::unlockForWrite(ResourceId id) +{ + ASSERT(CCProxy::isImplThread()); + ResourceMap::iterator it = m_resources.find(id); + ASSERT(it != m_resources.end() && it->second.lockedForWrite && !it->second.external); + it->second.lockedForWrite = false; +} + +CCResourceProvider::ScopedReadLockGL::ScopedReadLockGL(CCResourceProvider* resourceProvider, CCResourceProvider::ResourceId resourceId) + : m_resourceProvider(resourceProvider) + , m_resourceId(resourceId) + , m_textureId(resourceProvider->lockForRead(resourceId)->glId) +{ + ASSERT(m_textureId); +} + +CCResourceProvider::ScopedReadLockGL::~ScopedReadLockGL() +{ + m_resourceProvider->unlockForRead(m_resourceId); +} + +CCResourceProvider::ScopedWriteLockGL::ScopedWriteLockGL(CCResourceProvider* resourceProvider, CCResourceProvider::ResourceId resourceId) + : m_resourceProvider(resourceProvider) + , m_resourceId(resourceId) + , m_textureId(resourceProvider->lockForWrite(resourceId)->glId) +{ + ASSERT(m_textureId); +} + +CCResourceProvider::ScopedWriteLockGL::~ScopedWriteLockGL() +{ + m_resourceProvider->unlockForWrite(m_resourceId); +} + +void CCResourceProvider::populateSkBitmapWithResource(SkBitmap* skBitmap, const Resource* resource) +{ + ASSERT(resource->pixels); + ASSERT(resource->format == GraphicsContext3D::RGBA); + skBitmap->setConfig(SkBitmap::kARGB_8888_Config, resource->size.width(), resource->size.height()); + skBitmap->setPixels(resource->pixels); +} + +CCResourceProvider::ScopedReadLockSoftware::ScopedReadLockSoftware(CCResourceProvider* resourceProvider, CCResourceProvider::ResourceId resourceId) + : m_resourceProvider(resourceProvider) + , m_resourceId(resourceId) +{ + CCResourceProvider::populateSkBitmapWithResource(&m_skBitmap, resourceProvider->lockForRead(resourceId)); +} + +CCResourceProvider::ScopedReadLockSoftware::~ScopedReadLockSoftware() +{ + m_resourceProvider->unlockForRead(m_resourceId); +} + +CCResourceProvider::ScopedWriteLockSoftware::ScopedWriteLockSoftware(CCResourceProvider* resourceProvider, CCResourceProvider::ResourceId resourceId) + : m_resourceProvider(resourceProvider) + , m_resourceId(resourceId) +{ + CCResourceProvider::populateSkBitmapWithResource(&m_skBitmap, resourceProvider->lockForWrite(resourceId)); + m_skCanvas.setBitmapDevice(m_skBitmap); +} + +CCResourceProvider::ScopedWriteLockSoftware::~ScopedWriteLockSoftware() +{ + m_resourceProvider->unlockForWrite(m_resourceId); } CCResourceProvider::CCResourceProvider(CCGraphicsContext* context) : m_context(context) , m_nextId(1) , m_nextChild(1) + , m_defaultResourceType(GLTexture) , m_useTextureStorageExt(false) , m_useTextureUsageHint(false) , m_useShallowFlush(false) @@ -243,10 +343,15 @@ bool CCResourceProvider::initialize() { ASSERT(CCProxy::isImplThread()); WebGraphicsContext3D* context3d = m_context->context3D(); - if (!context3d || !context3d->makeContextCurrent()) { + if (!context3d) { + m_maxTextureSize = INT_MAX; + // FIXME: Implement this path for software compositing. return false; } + if (!context3d->makeContextCurrent()) + return false; + WebKit::WebString extensionsWebString = context3d->getString(GraphicsContext3D::EXTENSIONS); String extensionsString(extensionsWebString.data(), extensionsWebString.length()); Vector<String> extensions; diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h b/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h index e927d292f..ebad4b986 100644 --- a/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h +++ b/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h @@ -30,6 +30,8 @@ #include "CCGraphicsContext.h" #include "GraphicsContext3D.h" #include "IntSize.h" +#include "SkBitmap.h" +#include "SkCanvas.h" #include <wtf/Deque.h> #include <wtf/HashMap.h> #include <wtf/OwnPtr.h> @@ -44,8 +46,6 @@ class WebGraphicsContext3D; namespace WebCore { -class CCScopedLockResourceForRead; -class CCScopedLockResourceForWrite; class IntRect; class LayerTextureSubImage; @@ -58,6 +58,10 @@ public: typedef Vector<ResourceId> ResourceIdArray; typedef HashMap<ResourceId, ResourceId> ResourceIdMap; enum TextureUsageHint { TextureUsageAny, TextureUsageFramebuffer }; + enum ResourceType { + GLTexture = 1, + Bitmap, + }; struct Mailbox { GC3Dbyte name[64]; }; @@ -87,11 +91,19 @@ public: // Producer interface. - // Creates a resource of the given size/format, into the given pool. + void setDefaultResourceType(ResourceType type) { m_defaultResourceType = type; } + ResourceType defaultResourceType() const { return m_defaultResourceType; } + ResourceType resourceType(ResourceId); + + // Creates a resource of the default resource type. ResourceId createResource(int pool, const IntSize&, GC3Denum format, TextureUsageHint); - // Wraps an external texture into a resource. + // You can also explicitly create a specific resource type. + ResourceId createGLTexture(int pool, const IntSize&, GC3Denum format, TextureUsageHint); + ResourceId createBitmap(int pool, const IntSize&); + // Wraps an external texture into a GL resource. ResourceId createResourceFromExternalTexture(unsigned textureId); + void deleteResource(ResourceId); // Deletes all resources owned by a given pool. @@ -147,13 +159,72 @@ public: // Only for testing size_t mailboxCount() const { return m_mailboxes.size(); } -private: - friend class CCScopedLockResourceForRead; - friend class CCScopedLockResourceForWrite; + // The following lock classes are part of the CCResourceProvider API and are + // needed to read and write the resource contents. The user must ensure + // that they only use GL locks on GL resources, etc, and this is enforced + // by assertions. + class ScopedReadLockGL { + WTF_MAKE_NONCOPYABLE(ScopedReadLockGL); + public: + ScopedReadLockGL(CCResourceProvider*, CCResourceProvider::ResourceId); + ~ScopedReadLockGL(); + + unsigned textureId() const { return m_textureId; } + + private: + CCResourceProvider* m_resourceProvider; + CCResourceProvider::ResourceId m_resourceId; + unsigned m_textureId; + }; + + class ScopedWriteLockGL { + WTF_MAKE_NONCOPYABLE(ScopedWriteLockGL); + public: + ScopedWriteLockGL(CCResourceProvider*, CCResourceProvider::ResourceId); + ~ScopedWriteLockGL(); + + unsigned textureId() const { return m_textureId; } + + private: + CCResourceProvider* m_resourceProvider; + CCResourceProvider::ResourceId m_resourceId; + unsigned m_textureId; + }; + + class ScopedReadLockSoftware { + WTF_MAKE_NONCOPYABLE(ScopedReadLockSoftware); + public: + ScopedReadLockSoftware(CCResourceProvider*, CCResourceProvider::ResourceId); + ~ScopedReadLockSoftware(); + + const SkBitmap* skBitmap() const { return &m_skBitmap; } + private: + CCResourceProvider* m_resourceProvider; + CCResourceProvider::ResourceId m_resourceId; + SkBitmap m_skBitmap; + }; + + class ScopedWriteLockSoftware { + WTF_MAKE_NONCOPYABLE(ScopedWriteLockSoftware); + public: + ScopedWriteLockSoftware(CCResourceProvider*, CCResourceProvider::ResourceId); + ~ScopedWriteLockSoftware(); + + SkCanvas* skCanvas() { return &m_skCanvas; } + + private: + CCResourceProvider* m_resourceProvider; + CCResourceProvider::ResourceId m_resourceId; + SkBitmap m_skBitmap; + SkCanvas m_skCanvas; + }; + +private: struct Resource { Resource() : glId(0) + , pixels(0) , pool(0) , lockForReadCount(0) , lockedForWrite(false) @@ -161,9 +232,23 @@ private: , exported(false) , size() , format(0) + , type(static_cast<ResourceType>(0)) { } Resource(unsigned textureId, int pool, const IntSize& size, GC3Denum format) : glId(textureId) + , pixels(0) + , pool(pool) + , lockForReadCount(0) + , lockedForWrite(false) + , external(false) + , exported(false) + , size(size) + , format(format) + , type(GLTexture) + { } + Resource(uint8_t* pixels, int pool, const IntSize& size, GC3Denum format) + : glId(0) + , pixels(pixels) , pool(pool) , lockForReadCount(0) , lockedForWrite(false) @@ -171,8 +256,10 @@ private: , exported(false) , size(size) , format(format) + , type(Bitmap) { } unsigned glId; + uint8_t* pixels; int pool; int lockForReadCount; bool lockedForWrite; @@ -180,6 +267,7 @@ private: bool exported; IntSize size; GC3Denum format; + ResourceType type; }; typedef HashMap<ResourceId, Resource> ResourceMap; struct Child { @@ -192,13 +280,11 @@ private: explicit CCResourceProvider(CCGraphicsContext*); bool initialize(); - // Gets a GL texture id representing the resource, that can be rendered into. - unsigned lockForWrite(ResourceId); - void unlockForWrite(ResourceId); - - // Gets a GL texture id representing the resource, that can be rendered with. - unsigned lockForRead(ResourceId); + const Resource* lockForRead(ResourceId); void unlockForRead(ResourceId); + const Resource* lockForWrite(ResourceId); + void unlockForWrite(ResourceId); + static void populateSkBitmapWithResource(SkBitmap*, const Resource*); bool transferResource(WebKit::WebGraphicsContext3D*, ResourceId, TransferableResource*); void trimMailboxDeque(); @@ -211,6 +297,7 @@ private: Deque<Mailbox> m_mailboxes; + ResourceType m_defaultResourceType; bool m_useTextureStorageExt; bool m_useTextureUsageHint; bool m_useShallowFlush; @@ -218,51 +305,6 @@ private: int m_maxTextureSize; }; -class CCScopedLockResourceForRead { - WTF_MAKE_NONCOPYABLE(CCScopedLockResourceForRead); -public: - CCScopedLockResourceForRead(CCResourceProvider* resourceProvider, CCResourceProvider::ResourceId resourceId) - : m_resourceProvider(resourceProvider) - , m_resourceId(resourceId) - , m_textureId(resourceProvider->lockForRead(resourceId)) - { - ASSERT(m_textureId); - } - - ~CCScopedLockResourceForRead() - { - m_resourceProvider->unlockForRead(m_resourceId); - } - - unsigned textureId() const { return m_textureId; } - -private: - CCResourceProvider* m_resourceProvider; - CCResourceProvider::ResourceId m_resourceId; - unsigned m_textureId; -}; - -class CCScopedLockResourceForWrite { - WTF_MAKE_NONCOPYABLE(CCScopedLockResourceForWrite); -public: - CCScopedLockResourceForWrite(CCResourceProvider* resourceProvider, CCResourceProvider::ResourceId resourceId) - : m_resourceProvider(resourceProvider) - , m_resourceId(resourceId) - , m_textureId(resourceProvider->lockForWrite(resourceId)) { } - - ~CCScopedLockResourceForWrite() - { - m_resourceProvider->unlockForWrite(m_resourceId); - } - - unsigned textureId() const { return m_textureId; } - -private: - CCResourceProvider* m_resourceProvider; - CCResourceProvider::ResourceId m_resourceId; - unsigned m_textureId; -}; - } #endif diff --git a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm index 8a0c32c4f..961284876 100644 --- a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm +++ b/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm @@ -247,15 +247,7 @@ static CTFontDescriptorRef cascadeToLastResortAndDisableSwashesFontDescriptor() // Adding a cascade list breaks the font on Leopard static bool canSetCascadeListForCustomFont() { -#if PLATFORM(CHROMIUM) - static SInt32 systemVersion; - if (!systemVersion) { - if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr) - return false; - } - - return systemVersion >= 0x1060; -#elif PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 +#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 return true; #else return false; diff --git a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp index 17d4ddcef..6836b7db4 100644 --- a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp +++ b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp @@ -61,7 +61,8 @@ static void normalizeSpacesAndMirrorChars(const UChar* source, UChar* destinatio UChar32 character; int nextPosition = position; U16_NEXT(source, nextPosition, length, character); - if (Font::treatAsSpace(character)) + // Don't normalize tabs as they are not treated as spaces for word-end + if (Font::treatAsSpace(character) && character != '\t') character = ' '; else if (Font::treatAsZeroWidthSpace(character)) character = zeroWidthSpace; @@ -121,7 +122,7 @@ void HarfBuzzShaperBase::setNormalizedBuffer(NormalizeMode normalizeMode) bool HarfBuzzShaperBase::isWordEnd(unsigned index) { // This could refer a high-surrogate, but should work. - return index && isCodepointSpace(m_run[index]); + return index && isCodepointSpace(m_normalizedBuffer[index]); } int HarfBuzzShaperBase::determineWordBreakSpacing() diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp index 3bbb6c737..a3c056591 100644 --- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp +++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp @@ -121,8 +121,15 @@ String Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE(Platform3DObject String translatedShaderSource; String shaderInfoLog; + int extraCompileOptions = 0; - bool isValid = compiler.validateShaderSource(entry.source.utf8().data(), shaderType, translatedShaderSource, shaderInfoLog); +#if PLATFORM(MAC) + const char* vendor = reinterpret_cast<const char*>(::glGetString(GL_VENDOR)); + if (vendor && (std::strstr(vendor, "ATI") || std::strstr(vendor, "AMD"))) + extraCompileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS; +#endif + + bool isValid = compiler.validateShaderSource(entry.source.utf8().data(), shaderType, translatedShaderSource, shaderInfoLog, extraCompileOptions); entry.log = shaderInfoLog; entry.isValid = isValid; diff --git a/Source/WebCore/platform/graphics/openvg/PainterOpenVG.cpp b/Source/WebCore/platform/graphics/openvg/PainterOpenVG.cpp index 802978343..123a2fcbf 100644 --- a/Source/WebCore/platform/graphics/openvg/PainterOpenVG.cpp +++ b/Source/WebCore/platform/graphics/openvg/PainterOpenVG.cpp @@ -1114,8 +1114,6 @@ void PainterOpenVG::drawText(VGFont vgFont, Vector<VGuint>& characters, VGfloat* VGbitfield paintModes = 0; - if (m_state->textDrawingMode & TextModeClip) - return; // unsupported for every port except CG at the time of writing if (m_state->textDrawingMode & TextModeFill && !m_state->fillDisabled()) paintModes |= VG_FILL_PATH; if (m_state->textDrawingMode & TextModeStroke && !m_state->strokeDisabled()) diff --git a/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp b/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp index 9ae500775..3e1b99221 100644 --- a/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp +++ b/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp @@ -100,7 +100,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b logFont.lfWeight = bold ? FW_BOLD : FW_DONTCARE; HFONT hfont = CreateFontIndirect(&logFont); - return FontPlatformData(hfont, size); + return FontPlatformData(hfont, size, orientation); #elif OS(UNIX) ASSERT(m_fontReference); return FontPlatformData(m_fontReference, "", size, bold && !m_fontReference->isBold(), italic && !m_fontReference->isItalic(), orientation, textOrientation); diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp index 394688f4a..3cfbd35eb 100644 --- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp +++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp @@ -529,9 +529,6 @@ SkXfermode::Mode PlatformContextSkia::getXfermodeMode() const void PlatformContextSkia::setTextDrawingMode(TextDrawingModeFlags mode) { - // TextModeClip is never used, so we assert that it isn't set: - // https://bugs.webkit.org/show_bug.cgi?id=21898 - ASSERT(!(mode & TextModeClip)); m_state->m_textDrawingMode = mode; } diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk.cpp index 22b54f651..8c4eab13b 100644 --- a/Source/WebCore/platform/gtk/RenderThemeGtk.cpp +++ b/Source/WebCore/platform/gtk/RenderThemeGtk.cpp @@ -28,6 +28,7 @@ #include "CSSValueKeywords.h" #include "FileList.h" #include "FileSystem.h" +#include "FontDescription.h" #include <wtf/gobject/GOwnPtr.h> #include "Gradient.h" #include "GraphicsContext.h" diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp index 7012d3d26..1c33e8cb4 100644 --- a/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp +++ b/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp @@ -32,6 +32,7 @@ #undef GTK_DISABLE_DEPRECATED #include "CSSValueKeywords.h" +#include "Font.h" #include "GraphicsContext.h" #include "GtkVersioning.h" #include "HTMLNames.h" diff --git a/Source/WebCore/platform/mac/HTMLConverter.mm b/Source/WebCore/platform/mac/HTMLConverter.mm index 67be0059c..bb6e743b6 100644 --- a/Source/WebCore/platform/mac/HTMLConverter.mm +++ b/Source/WebCore/platform/mac/HTMLConverter.mm @@ -36,6 +36,7 @@ #import "DOMPrivate.h" #import "DOMRangeInternal.h" #import "Element.h" +#import "Font.h" #import "Frame.h" #import "HTMLNames.h" #import "HTMLParserIdioms.h" diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm index 600dee583..a5b512e84 100644 --- a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm +++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm @@ -642,6 +642,24 @@ static bool scrollAnimationEnabledForSystem() #endif } +#if ENABLE(RUBBER_BANDING) +static bool rubberBandingEnabledForSystem() +{ + static bool initialized = false; + static bool enabled = true; + // Caches the result, which is consistent with other apps like the Finder, which all + // require a restart after changing this default. + if (!initialized) { + // Uses -objectForKey: and not -boolForKey: in order to default to true if the value wasn't set. + id value = [[NSUserDefaults standardUserDefaults] objectForKey:@"NSScrollViewRubberbanding"]; + if ([value isKindOfClass:[NSNumber class]]) + enabled = [value boolValue]; + initialized = true; + } + return enabled; +} +#endif + bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier) { m_haveScrolledSincePageLoad = true; @@ -981,7 +999,7 @@ bool ScrollAnimatorMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent) { m_haveScrolledSincePageLoad = true; - if (!wheelEvent.hasPreciseScrollingDeltas()) + if (!wheelEvent.hasPreciseScrollingDeltas() || !rubberBandingEnabledForSystem()) return ScrollAnimator::handleWheelEvent(wheelEvent); // FIXME: This is somewhat roundabout hack to allow forwarding wheel events diff --git a/Source/WebCore/platform/mediastream/RTCIceCandidateDescriptor.cpp b/Source/WebCore/platform/mediastream/RTCIceCandidateDescriptor.cpp new file mode 100644 index 000000000..34bb4bece --- /dev/null +++ b/Source/WebCore/platform/mediastream/RTCIceCandidateDescriptor.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if ENABLE(MEDIA_STREAM) + +#include "RTCIceCandidateDescriptor.h" + +namespace WebCore { + +PassRefPtr<RTCIceCandidateDescriptor> RTCIceCandidateDescriptor::create(const String& candidate, const String& sdpMid, unsigned short sdpMLineIndex) +{ + return adoptRef(new RTCIceCandidateDescriptor(candidate, sdpMid, sdpMLineIndex)); +} + +RTCIceCandidateDescriptor::RTCIceCandidateDescriptor(const String& candidate, const String& sdpMid, unsigned short sdpMLineIndex) + : m_candidate(candidate) + , m_sdpMid(sdpMid) + , m_sdpMLineIndex(sdpMLineIndex) +{ +} + +RTCIceCandidateDescriptor::~RTCIceCandidateDescriptor() +{ +} + +} // namespace WebCore + +#endif // ENABLE(MEDIA_STREAM) diff --git a/Source/WebCore/platform/mediastream/RTCIceCandidateDescriptor.h b/Source/WebCore/platform/mediastream/RTCIceCandidateDescriptor.h new file mode 100644 index 000000000..b5af1e432 --- /dev/null +++ b/Source/WebCore/platform/mediastream/RTCIceCandidateDescriptor.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RTCIceCandidateDescriptor_h +#define RTCIceCandidateDescriptor_h + +#if ENABLE(MEDIA_STREAM) + +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> +#include <wtf/text/WTFString.h> + +namespace WebCore { + +class RTCIceCandidateDescriptor : public RefCounted<RTCIceCandidateDescriptor> { +public: + static PassRefPtr<RTCIceCandidateDescriptor> create(const String& candidate, const String& sdpMid, unsigned short sdpMLineIndex); + virtual ~RTCIceCandidateDescriptor(); + + const String& candidate() { return m_candidate; } + const String& sdpMid() { return m_sdpMid; } + unsigned short sdpMLineIndex() { return m_sdpMLineIndex; } + +private: + RTCIceCandidateDescriptor(const String& candidate, const String& sdpMid, unsigned short sdpMLineIndex); + + String m_candidate; + String m_sdpMid; + unsigned short m_sdpMLineIndex; +}; + +} // namespace WebCore + +#endif // ENABLE(MEDIA_STREAM) + +#endif // RTCIceCandidateDescriptor_h diff --git a/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.cpp b/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.cpp new file mode 100644 index 000000000..9178676b1 --- /dev/null +++ b/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if ENABLE(MEDIA_STREAM) + +#include "RTCSessionDescriptionDescriptor.h" + +namespace WebCore { + +PassRefPtr<RTCSessionDescriptionDescriptor> RTCSessionDescriptionDescriptor::create(const String& type, const String& sdp) +{ + return adoptRef(new RTCSessionDescriptionDescriptor(type, sdp)); +} + +RTCSessionDescriptionDescriptor::RTCSessionDescriptionDescriptor(const String& type, const String& sdp) + : m_type(type) + , m_sdp(sdp) +{ +} + +RTCSessionDescriptionDescriptor::~RTCSessionDescriptionDescriptor() +{ +} + +} // namespace WebCore + +#endif // ENABLE(MEDIA_STREAM) diff --git a/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h b/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h new file mode 100644 index 000000000..04e34b78d --- /dev/null +++ b/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Google Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RTCSessionDescriptionDescriptor_h +#define RTCSessionDescriptionDescriptor_h + +#if ENABLE(MEDIA_STREAM) + +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> +#include <wtf/text/WTFString.h> + +namespace WebCore { + +class RTCSessionDescriptionDescriptor : public RefCounted<RTCSessionDescriptionDescriptor> { +public: + static PassRefPtr<RTCSessionDescriptionDescriptor> create(const String& type, const String& sdp); + virtual ~RTCSessionDescriptionDescriptor(); + + const String& type() { return m_type; } + void setType(const String& type) { m_type = type; } + + const String& sdp() { return m_sdp; } + void setSdp(const String& sdp) { m_sdp = sdp; } + +private: + RTCSessionDescriptionDescriptor(const String& type, const String& sdp); + + String m_type; + String m_sdp; +}; + +} // namespace WebCore + +#endif // ENABLE(MEDIA_STREAM) + +#endif // RTCSessionDescriptionDescriptor_h diff --git a/Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp b/Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp index b89be72eb..851391035 100644 --- a/Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp +++ b/Source/WebCore/platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp @@ -56,8 +56,7 @@ RTCPeerConnectionHandlerChromium::~RTCPeerConnectionHandlerChromium() bool RTCPeerConnectionHandlerChromium::initialize() { m_webHandler = adoptPtr(WebKit::Platform::current()->createRTCPeerConnectionHandler(this)); - // FIXME: Change the default value to false once the mock WebRTCPeerConnectionHandler has landed. - return m_webHandler ? m_webHandler->initialize() : true; + return m_webHandler ? m_webHandler->initialize() : false; } } // namespace WebCore diff --git a/Source/WebCore/platform/network/blackberry/rss/RSSFilterStream.cpp b/Source/WebCore/platform/network/blackberry/rss/RSSFilterStream.cpp index 58915bd13..a7e50446e 100644 --- a/Source/WebCore/platform/network/blackberry/rss/RSSFilterStream.cpp +++ b/Source/WebCore/platform/network/blackberry/rss/RSSFilterStream.cpp @@ -50,15 +50,6 @@ static const char* const s_contentEncodingHeaderKey = "Content-Encoding"; static const char* const s_contentLengthHeaderKey = "Content-Length"; static const char* const s_contentTypeHeaderKey = "Content-Type"; -static const char* const s_atom10VersionKey = "xmlns"; -static const char* const s_atom10VersionValue = "http://www.w3.org/2005/Atom"; -static const char* const s_rss10VersionKey = "xmlns"; -static const char* const s_rss10VersionValue = "http://purl.org/rss/1.0/"; -static const char* const s_rss20VersionKey = "version"; -static const char* const s_rss20VersionValue = "2.0"; -static const char* const s_rssXmlVersionKey = "version"; -static const char* const s_rssXmlVersionValue = "1.0"; - static int isASCIISpaceLowerByte(int ch) { return isASCIISpace<int>(ch & 0xff); @@ -239,7 +230,7 @@ static PassOwnPtr<RSSParserBase> createParser(RSSFilterStream::ResourceType type case RSSFilterStream::TypeRSS20: return adoptPtr(new RSS20Parser()); default: - // The following code is just for compiler, it should never reach here. + ASSERT_NOT_REACHED(); return adoptPtr(new RSS20Parser()); } } @@ -317,8 +308,7 @@ static bool findXMLLanguagePosition(const char* str, const char*& langStart, con static const char* defaultEncodingForLanguage(const char* language) { - if (!strcasecmp(language, "en") - || !strcasecmp(language, "en-US")) + if (!strcasecmp(language, "en") || !strcasecmp(language, "en-US")) return s_latin1EncodingName; if (!strcasecmp(language, "zh-cn")) return s_gbkEncodingName; @@ -330,7 +320,6 @@ static bool isTranscodingNeeded(const std::string& encoding) { // When there's no encoding information, or the encoding can not be found in all encodings // supported in our phone, we will try to transcode the content anyway, supposed to ASCII. - if (encoding.empty()) return true; diff --git a/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp b/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp index 520d68578..57a6fb2c8 100644 --- a/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp +++ b/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp @@ -265,15 +265,6 @@ void ResourceRequest::setHTTPPipeliningEnabled(bool flag) s_httpPipeliningEnabled = flag; } -#if USE(CFNETWORK) || PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 -static inline bool readBooleanPreference(CFStringRef key) -{ - Boolean keyExistsAndHasValidFormat; - Boolean result = CFPreferencesGetAppBooleanValue(key, kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat); - return keyExistsAndHasValidFormat ? result : false; -} -#endif - unsigned initializeMaximumHTTPConnectionCountPerHost() { static const unsigned preferredConnectionCount = 6; @@ -284,8 +275,10 @@ unsigned initializeMaximumHTTPConnectionCountPerHost() #if USE(CFNETWORK) || PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 static const unsigned unlimitedConnectionCount = 10000; - if (!ResourceRequest::httpPipeliningEnabled() && readBooleanPreference(CFSTR("WebKitEnableHTTPPipelining"))) - ResourceRequest::setHTTPPipeliningEnabled(true); + Boolean keyExistsAndHasValidFormat = false; + Boolean prefValue = CFPreferencesGetAppBooleanValue(CFSTR("WebKitEnableHTTPPipelining"), kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat); + if (keyExistsAndHasValidFormat) + ResourceRequest::setHTTPPipeliningEnabled(prefValue); if (ResourceRequest::httpPipeliningEnabled()) { wkSetHTTPPipeliningMaximumPriority(toHTTPPipeliningPriority(ResourceLoadPriorityHighest)); diff --git a/Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp b/Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp index f3f60e687..11a3ef2d3 100644 --- a/Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp +++ b/Source/WebCore/platform/text/gtk/TextCheckerEnchant.cpp @@ -155,14 +155,12 @@ Vector<String> TextCheckerEnchant::getGuessesForWord(const String& word) return guesses; } -void TextCheckerEnchant::updateSpellCheckingLanguages(const String& languages) +void TextCheckerEnchant::updateSpellCheckingLanguages(const Vector<String>& languages) { Vector<EnchantDict*> spellDictionaries; if (!languages.isEmpty()) { - Vector<String> languagesVector; - languages.split(static_cast<UChar>(','), languagesVector); - for (Vector<String>::const_iterator iter = languagesVector.begin(); iter != languagesVector.end(); ++iter) { + for (Vector<String>::const_iterator iter = languages.begin(); iter != languages.end(); ++iter) { CString currentLanguage = iter->utf8(); if (enchant_broker_dict_exists(m_broker, currentLanguage.data())) { EnchantDict* dict = enchant_broker_request_dict(m_broker, currentLanguage.data()); @@ -188,24 +186,21 @@ void TextCheckerEnchant::updateSpellCheckingLanguages(const String& languages) m_enchantDictionaries = spellDictionaries; } -String TextCheckerEnchant::getSpellCheckingLanguages() +Vector<String> TextCheckerEnchant::getSpellCheckingLanguages() { + Vector<String> languages; if (m_enchantDictionaries.isEmpty()) - return String(); + return languages; // Get a Vector<CString> with the list of languages in use. Vector<CString> currentDictionaries; for (Vector<EnchantDict*>::const_iterator iter = m_enchantDictionaries.begin(); iter != m_enchantDictionaries.end(); ++iter) enchant_dict_describe(*iter, enchantDictDescribeCallback, ¤tDictionaries); - // Build the result String; - StringBuilder builder; - for (Vector<CString>::const_iterator iter = currentDictionaries.begin(); iter != currentDictionaries.end(); ++iter) { - if (iter != currentDictionaries.begin()) - builder.append(","); - builder.append(String::fromUTF8(iter->data())); - } - return builder.toString(); + for (Vector<CString>::const_iterator iter = currentDictionaries.begin(); iter != currentDictionaries.end(); ++iter) + languages.append(String::fromUTF8(iter->data())); + + return languages; } void TextCheckerEnchant::freeEnchantBrokerDictionaries() diff --git a/Source/WebCore/platform/text/gtk/TextCheckerEnchant.h b/Source/WebCore/platform/text/gtk/TextCheckerEnchant.h index e7a980978..1780b454d 100644 --- a/Source/WebCore/platform/text/gtk/TextCheckerEnchant.h +++ b/Source/WebCore/platform/text/gtk/TextCheckerEnchant.h @@ -41,8 +41,8 @@ public: void learnWord(const String&); void checkSpellingOfString(const String&, int& misspellingLocation, int& misspellingLength); Vector<String> getGuessesForWord(const String&); - void updateSpellCheckingLanguages(const String& languages); - String getSpellCheckingLanguages(); + void updateSpellCheckingLanguages(const Vector<String>& languages); + Vector<String> getSpellCheckingLanguages(); private: TextCheckerEnchant(); diff --git a/Source/WebCore/rendering/EllipsisBox.cpp b/Source/WebCore/rendering/EllipsisBox.cpp index 7290cb25f..c25673d93 100644 --- a/Source/WebCore/rendering/EllipsisBox.cpp +++ b/Source/WebCore/rendering/EllipsisBox.cpp @@ -21,6 +21,7 @@ #include "EllipsisBox.h" #include "Document.h" +#include "Font.h" #include "GraphicsContext.h" #include "HitTestResult.h" #include "InlineTextBox.h" diff --git a/Source/WebCore/rendering/FlowThreadController.cpp b/Source/WebCore/rendering/FlowThreadController.cpp index dc9432c76..476c924b8 100644 --- a/Source/WebCore/rendering/FlowThreadController.cpp +++ b/Source/WebCore/rendering/FlowThreadController.cpp @@ -32,7 +32,9 @@ #include "FlowThreadController.h" #include "RenderFlowThread.h" +#include "RenderFlowThreadContainer.h" #include "RenderNamedFlowThread.h" +#include "StyleInheritedData.h" #include "WebKitNamedFlow.h" #include "WebKitNamedFlowCollection.h" #include <wtf/text/AtomicString.h> @@ -47,6 +49,7 @@ PassOwnPtr<FlowThreadController> FlowThreadController::create(RenderView* view) FlowThreadController::FlowThreadController(RenderView* view) : m_view(view) , m_currentRenderFlowThread(0) + , m_flowThreadContainer(0) , m_isRenderNamedFlowThreadOrderDirty(false) { } @@ -57,6 +60,11 @@ FlowThreadController::~FlowThreadController() RenderNamedFlowThread* FlowThreadController::ensureRenderFlowThreadWithName(const AtomicString& name) { + if (!m_flowThreadContainer) { + m_flowThreadContainer = new (m_view->renderArena()) RenderFlowThreadContainer(m_view->document()); + m_flowThreadContainer->setStyle(RenderFlowThread::createFlowThreadStyle(m_view->style())); + m_view->addChild(m_flowThreadContainer); + } if (!m_renderNamedFlowThreadList) m_renderNamedFlowThreadList = adoptPtr(new RenderNamedFlowThreadList()); else { @@ -76,14 +84,23 @@ RenderNamedFlowThread* FlowThreadController::ensureRenderFlowThreadWithName(cons flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(m_view->style())); m_renderNamedFlowThreadList->add(flowRenderer); - // Keep the flow renderer as a child of RenderView. - m_view->addChild(flowRenderer); + // Keep the flow renderer as a child of RenderFlowThreadContainer. + m_flowThreadContainer->addChild(flowRenderer); setIsRenderNamedFlowThreadOrderDirty(true); return flowRenderer; } +void FlowThreadController::styleDidChange() +{ + RenderStyle* viewStyle = m_view->style(); + for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) { + RenderNamedFlowThread* flowRenderer = *iter; + flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(viewStyle)); + } +} + void FlowThreadController::layoutRenderNamedFlowThreads() { ASSERT(m_renderNamedFlowThreadList); diff --git a/Source/WebCore/rendering/FlowThreadController.h b/Source/WebCore/rendering/FlowThreadController.h index d48c87972..58edb2cf1 100644 --- a/Source/WebCore/rendering/FlowThreadController.h +++ b/Source/WebCore/rendering/FlowThreadController.h @@ -37,6 +37,7 @@ namespace WebCore { class RenderFlowThread; +class RenderFlowThreadContainer; class RenderNamedFlowThread; typedef ListHashSet<RenderNamedFlowThread*> RenderNamedFlowThreadList; @@ -61,10 +62,10 @@ public: const RenderNamedFlowThreadList* renderNamedFlowThreadList() const { return m_renderNamedFlowThreadList.get(); } bool hasRenderNamedFlowThreads() const { return m_renderNamedFlowThreadList && !m_renderNamedFlowThreadList->isEmpty(); } void layoutRenderNamedFlowThreads(); + void styleDidChange(); void registerNamedFlowContentNode(Node*, RenderNamedFlowThread*); void unregisterNamedFlowContentNode(Node*); - void removeFlowThread(RenderNamedFlowThread*); protected: @@ -73,6 +74,7 @@ protected: private: RenderView* m_view; RenderFlowThread* m_currentRenderFlowThread; + RenderFlowThreadContainer* m_flowThreadContainer; bool m_isRenderNamedFlowThreadOrderDirty; OwnPtr<RenderNamedFlowThreadList> m_renderNamedFlowThreadList; // maps a content node to its render flow thread. diff --git a/Source/WebCore/rendering/InlineBox.cpp b/Source/WebCore/rendering/InlineBox.cpp index 08bfd6970..be3c9c7cf 100644 --- a/Source/WebCore/rendering/InlineBox.cpp +++ b/Source/WebCore/rendering/InlineBox.cpp @@ -20,6 +20,7 @@ #include "config.h" #include "InlineBox.h" +#include "FontMetrics.h" #include "Frame.h" #include "HitTestResult.h" #include "InlineFlowBox.h" diff --git a/Source/WebCore/rendering/InlineFlowBox.cpp b/Source/WebCore/rendering/InlineFlowBox.cpp index a96f61225..c3da10025 100644 --- a/Source/WebCore/rendering/InlineFlowBox.cpp +++ b/Source/WebCore/rendering/InlineFlowBox.cpp @@ -24,6 +24,7 @@ #include "CSSPropertyNames.h" #include "Document.h" #include "EllipsisBox.h" +#include "Font.h" #include "GraphicsContext.h" #include "InlineTextBox.h" #include "HitTestResult.h" diff --git a/Source/WebCore/rendering/InlineFlowBox.h b/Source/WebCore/rendering/InlineFlowBox.h index 20f59d723..32839f15f 100644 --- a/Source/WebCore/rendering/InlineFlowBox.h +++ b/Source/WebCore/rendering/InlineFlowBox.h @@ -31,8 +31,11 @@ class HitTestRequest; class HitTestResult; class InlineTextBox; class RenderLineBoxList; +class SimpleFontData; class VerticalPositionCache; +struct GlyphOverflow; + typedef HashMap<const InlineTextBox*, pair<Vector<const SimpleFontData*>, GlyphOverflow> > GlyphOverflowAndFallbackFontsMap; class InlineFlowBox : public InlineBox { diff --git a/Source/WebCore/rendering/Pagination.h b/Source/WebCore/rendering/Pagination.h new file mode 100644 index 000000000..1afad696c --- /dev/null +++ b/Source/WebCore/rendering/Pagination.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2012 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef Pagination_h +#define Pagination_h + +namespace WebCore { + +struct Pagination { + enum Mode { Unpaginated, LeftToRightPaginated, RightToLeftPaginated, TopToBottomPaginated, BottomToTopPaginated }; + + Pagination() + : mode(Unpaginated) + , behavesLikeColumns(false) + , pageLength(0) + , gap(0) + { + }; + + bool operator==(const Pagination& other) const + { + return mode == other.mode && behavesLikeColumns == other.behavesLikeColumns && pageLength == other.pageLength && gap == other.gap; + } + + bool operator!=(const Pagination& other) const + { + return mode != other.mode || behavesLikeColumns != other.behavesLikeColumns || pageLength != other.pageLength || gap != other.gap; + } + + Mode mode; + bool behavesLikeColumns; + unsigned pageLength; + unsigned gap; +}; + +} // namespace WebCore + +#endif diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp index aa71af50c..a4158f4e1 100755 --- a/Source/WebCore/rendering/RenderBlock.cpp +++ b/Source/WebCore/rendering/RenderBlock.cpp @@ -3080,31 +3080,6 @@ void RenderBlock::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paintOffs } } -void RenderBlock::paintEllipsisBoxes(PaintInfo& paintInfo, const LayoutPoint& paintOffset) -{ - if (!paintInfo.shouldPaintWithinRoot(this) || !firstLineBox()) - return; - - if (style()->visibility() == VISIBLE && paintInfo.phase == PaintPhaseForeground) { - // We can check the first box and last box and avoid painting if we don't - // intersect. - LayoutUnit yPos = paintOffset.y() + firstLineBox()->y(); - LayoutUnit h = lastLineBox()->y() + lastLineBox()->logicalHeight() - firstLineBox()->y(); - if (yPos >= paintInfo.rect.maxY() || yPos + h <= paintInfo.rect.y()) - return; - - // See if our boxes intersect with the dirty rect. If so, then we paint - // them. Note that boxes can easily overlap, so we can't make any assumptions - // based off positions of our first line box or our last line box. - for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { - yPos = paintOffset.y() + curr->y(); - h = curr->logicalHeight(); - if (curr->ellipsisBox() && yPos < paintInfo.rect.maxY() && yPos + h > paintInfo.rect.y()) - curr->paintEllipsisBox(paintInfo, paintOffset, curr->lineTop(), curr->lineBottom()); - } - } -} - RenderInline* RenderBlock::inlineElementContinuation() const { RenderBoxModelObject* continuation = this->continuation(); @@ -5139,8 +5114,12 @@ void RenderBlock::calcColumnWidth() bool RenderBlock::requiresColumns(int desiredColumnCount) const { + // If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating + // in the RenderView instead. + bool isPaginated = (style()->overflowY() == OPAGEDX || style()->overflowY() == OPAGEDY) && !(isRoot() || isBody()); + return firstChild() - && (desiredColumnCount != 1 || !style()->hasAutoColumnWidth() || !style()->hasInlineColumnAxis()) + && (desiredColumnCount != 1 || !style()->hasAutoColumnWidth() || !style()->hasInlineColumnAxis() || isPaginated) && !firstChild()->isAnonymousColumnsBlock() && !firstChild()->isAnonymousColumnSpanBlock(); } @@ -5171,6 +5150,32 @@ void RenderBlock::setDesiredColumnCountAndWidth(int count, LayoutUnit width) } } +void RenderBlock::updateColumnInfoFromStyle(RenderStyle* style) +{ + if (!hasColumns()) + return; + + ColumnInfo* info = gColumnInfoMap->get(this); + + bool needsLayout = false; + ColumnInfo::Axis oldAxis = info->progressionAxis(); + ColumnInfo::Axis newAxis = style->hasInlineColumnAxis() ? ColumnInfo::InlineAxis : ColumnInfo::BlockAxis; + if (oldAxis != newAxis) { + info->setProgressionAxis(newAxis); + needsLayout = true; + } + + bool oldProgressionIsReversed = info->progressionIsReversed(); + bool newProgressionIsReversed = style->columnProgression() == ReverseColumnProgression; + if (oldProgressionIsReversed != newProgressionIsReversed) { + info->setProgressionIsReversed(newProgressionIsReversed); + needsLayout = true; + } + + if (needsLayout) + setNeedsLayoutAndPrefWidthsRecalc(); +} + LayoutUnit RenderBlock::desiredColumnWidth() const { if (!hasColumns()) diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h index 11b698b45..a31b26ed6 100644 --- a/Source/WebCore/rendering/RenderBlock.h +++ b/Source/WebCore/rendering/RenderBlock.h @@ -266,6 +266,8 @@ public: ColumnInfo* columnInfo() const; int columnGap() const; + + void updateColumnInfoFromStyle(RenderStyle*); // These two functions take the ColumnInfo* to avoid repeated lookups of the info in the global HashMap. unsigned columnCount(ColumnInfo*) const; @@ -743,7 +745,6 @@ private: void paintContents(PaintInfo&, const LayoutPoint&); void paintColumnContents(PaintInfo&, const LayoutPoint&, bool paintFloats = false); void paintColumnRules(PaintInfo&, const LayoutPoint&); - void paintEllipsisBoxes(PaintInfo&, const LayoutPoint&); void paintSelection(PaintInfo&, const LayoutPoint&); void paintCaret(PaintInfo&, const LayoutPoint&, CaretType); diff --git a/Source/WebCore/rendering/RenderButton.cpp b/Source/WebCore/rendering/RenderButton.cpp index 5477f9e50..7103e6e50 100644 --- a/Source/WebCore/rendering/RenderButton.cpp +++ b/Source/WebCore/rendering/RenderButton.cpp @@ -27,6 +27,7 @@ #include "HTMLNames.h" #include "RenderTextFragment.h" #include "RenderTheme.h" +#include "StyleInheritedData.h" namespace WebCore { diff --git a/Source/WebCore/rendering/RenderCombineText.cpp b/Source/WebCore/rendering/RenderCombineText.cpp index c79886a9d..123661e4d 100644 --- a/Source/WebCore/rendering/RenderCombineText.cpp +++ b/Source/WebCore/rendering/RenderCombineText.cpp @@ -22,6 +22,7 @@ #include "RenderCombineText.h" #include "RenderBlock.h" +#include "StyleInheritedData.h" namespace WebCore { diff --git a/Source/WebCore/rendering/RenderCombineText.h b/Source/WebCore/rendering/RenderCombineText.h index 406c3f6a3..1433aa005 100644 --- a/Source/WebCore/rendering/RenderCombineText.h +++ b/Source/WebCore/rendering/RenderCombineText.h @@ -21,6 +21,7 @@ #ifndef RenderCombineText_h #define RenderCombineText_h +#include "Font.h" #include "RenderText.h" namespace WebCore { diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp index 9c5587979..8fa73ae4f 100644 --- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp +++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp @@ -25,6 +25,7 @@ #include "config.h" #include "RenderDeprecatedFlexibleBox.h" +#include "Font.h" #include "LayoutRepainter.h" #include "RenderLayer.h" #include "RenderView.h" diff --git a/Source/WebCore/rendering/RenderEmbeddedObject.h b/Source/WebCore/rendering/RenderEmbeddedObject.h index be854c1ed..6edc9bfb7 100644 --- a/Source/WebCore/rendering/RenderEmbeddedObject.h +++ b/Source/WebCore/rendering/RenderEmbeddedObject.h @@ -28,6 +28,7 @@ namespace WebCore { class MouseEvent; +class TextRun; // Renderer for embeds and objects, often, but not always, rendered via plug-ins. // For example, <embed src="foo.html"> does not invoke a plug-in. diff --git a/Source/WebCore/rendering/RenderFileUploadControl.cpp b/Source/WebCore/rendering/RenderFileUploadControl.cpp index bac5b59c7..de9564456 100644 --- a/Source/WebCore/rendering/RenderFileUploadControl.cpp +++ b/Source/WebCore/rendering/RenderFileUploadControl.cpp @@ -23,6 +23,7 @@ #include "ElementShadow.h" #include "FileList.h" +#include "Font.h" #include "GraphicsContext.h" #include "HTMLInputElement.h" #include "HTMLNames.h" diff --git a/Source/WebCore/rendering/RenderFlowThreadContainer.cpp b/Source/WebCore/rendering/RenderFlowThreadContainer.cpp new file mode 100644 index 000000000..680ac4ec0 --- /dev/null +++ b/Source/WebCore/rendering/RenderFlowThreadContainer.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "config.h" + +#include "RenderFlowThreadContainer.h" + +namespace WebCore { + +RenderFlowThreadContainer::RenderFlowThreadContainer(Node* node) +: RenderFlowThread(node) +{ +} + +void RenderFlowThreadContainer::layout() +{ + ASSERT(needsLayout()); + setNeedsLayout(false); +} + +} // namespace WebCore diff --git a/Source/WebCore/rendering/RenderFlowThreadContainer.h b/Source/WebCore/rendering/RenderFlowThreadContainer.h new file mode 100644 index 000000000..5a958ce3a --- /dev/null +++ b/Source/WebCore/rendering/RenderFlowThreadContainer.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef RenderFlowThreadContainer_h +#define RenderFlowThreadContainer_h + + +#include "RenderFlowThread.h" + +namespace WebCore { + +class RenderFlowThreadContainer: public RenderFlowThread { +public: + RenderFlowThreadContainer(Node*); + virtual ~RenderFlowThreadContainer() { }; + + virtual void layout() OVERRIDE; + virtual bool isRenderFlowThreadContainer() const OVERRIDE { return true; } + +private: + virtual const char* renderName() const { return "RenderFlowThreadContainer"; } +}; + +} // namespace WebCore + +#endif // RenderFlowThread_h diff --git a/Source/WebCore/rendering/RenderFullScreen.h b/Source/WebCore/rendering/RenderFullScreen.h index a675c5f09..a54ac1561 100644 --- a/Source/WebCore/rendering/RenderFullScreen.h +++ b/Source/WebCore/rendering/RenderFullScreen.h @@ -28,6 +28,7 @@ #if ENABLE(FULLSCREEN_API) #include "RenderDeprecatedFlexibleBox.h" +#include "StyleInheritedData.h" namespace WebCore { diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp index 48ea05470..f399abc4d 100644 --- a/Source/WebCore/rendering/RenderImage.cpp +++ b/Source/WebCore/rendering/RenderImage.cpp @@ -29,6 +29,7 @@ #include "RenderImage.h" #include "BitmapImage.h" +#include "Font.h" #include "FontCache.h" #include "Frame.h" #include "FrameSelection.h" diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp index 35ba973bd..d58bfc1ab 100644 --- a/Source/WebCore/rendering/RenderInline.cpp +++ b/Source/WebCore/rendering/RenderInline.cpp @@ -36,6 +36,7 @@ #include "RenderLayer.h" #include "RenderTheme.h" #include "RenderView.h" +#include "StyleInheritedData.h" #include "TransformState.h" #include "VisiblePosition.h" diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index fe75262c8..661d0eb08 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -4777,7 +4777,7 @@ bool RenderLayer::shouldBeNormalFlowOnly() const || renderer()->isVideo() || renderer()->isEmbeddedObject() || renderer()->isRenderIFrame() - || renderer()->style()->specifiesColumns()) + || (renderer()->style()->specifiesColumns() && !isRootLayer())) && !renderer()->isOutOfFlowPositioned() && !renderer()->isRelPositioned() && !renderer()->hasTransform() diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp index ef6147f26..89d99b3e2 100644 --- a/Source/WebCore/rendering/RenderListItem.cpp +++ b/Source/WebCore/rendering/RenderListItem.cpp @@ -29,6 +29,7 @@ #include "HTMLOListElement.h" #include "RenderListMarker.h" #include "RenderView.h" +#include "StyleInheritedData.h" #include <wtf/StdLibExtras.h> #include <wtf/text/StringBuilder.h> diff --git a/Source/WebCore/rendering/RenderListMarker.cpp b/Source/WebCore/rendering/RenderListMarker.cpp index 0d2f48dd5..04d8632a8 100644 --- a/Source/WebCore/rendering/RenderListMarker.cpp +++ b/Source/WebCore/rendering/RenderListMarker.cpp @@ -27,6 +27,7 @@ #include "CachedImage.h" #include "Document.h" +#include "Font.h" #include "GraphicsContext.h" #include "RenderLayer.h" #include "RenderListItem.h" diff --git a/Source/WebCore/rendering/RenderMultiColumnBlock.cpp b/Source/WebCore/rendering/RenderMultiColumnBlock.cpp index 177a1676a..9f6bdefb4 100644 --- a/Source/WebCore/rendering/RenderMultiColumnBlock.cpp +++ b/Source/WebCore/rendering/RenderMultiColumnBlock.cpp @@ -27,6 +27,7 @@ #include "RenderMultiColumnBlock.h" #include "RenderMultiColumnFlowThread.h" #include "RenderMultiColumnSet.h" +#include "StyleInheritedData.h" using namespace std; diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp index 23d6cb8ac..391c11988 100755 --- a/Source/WebCore/rendering/RenderObject.cpp +++ b/Source/WebCore/rendering/RenderObject.cpp @@ -640,9 +640,9 @@ void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderOb if (!container && !object->isRenderView()) return; if (!last->isText() && last->style()->isOutOfFlowPositioned()) { - bool willSkipRelativelyPositionedInlines = !object->isRenderBlock() || object->isAnonymousBlock(); - // Skip relatively positioned inlines and anonymous blocks to get to the enclosing RenderBlock. - while (object && (!object->isRenderBlock() || object->isAnonymousBlock())) + bool willSkipRelativelyPositionedInlines = !object->isRenderBlock() || object->isAnonymousBlock() || object->isRenderFlowThreadContainer(); + // Skip relatively positioned inlines and anonymous blocks (and the flow threads container) to get to the enclosing RenderBlock. + while (object && (!object->isRenderBlock() || object->isAnonymousBlock() || object->isRenderFlowThreadContainer())) object = object->container(); if (!object || object->posChildNeedsLayout()) return; diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h index 266c83891..3ca2a2255 100644 --- a/Source/WebCore/rendering/RenderObject.h +++ b/Source/WebCore/rendering/RenderObject.h @@ -369,6 +369,7 @@ public: #endif virtual bool isRenderFlowThread() const { return false; } + virtual bool isRenderFlowThreadContainer() const { return false; } virtual bool isRenderNamedFlowThread() const { return false; } virtual bool isRenderMultiColumnBlock() const { return false; } diff --git a/Source/WebCore/rendering/RenderRegion.h b/Source/WebCore/rendering/RenderRegion.h index 93c0fc08b..5f22a75a7 100644 --- a/Source/WebCore/rendering/RenderRegion.h +++ b/Source/WebCore/rendering/RenderRegion.h @@ -31,6 +31,7 @@ #define RenderRegion_h #include "RenderReplaced.h" +#include "StyleInheritedData.h" namespace WebCore { diff --git a/Source/WebCore/rendering/RenderRuby.cpp b/Source/WebCore/rendering/RenderRuby.cpp index 390db2f56..e7b859f70 100644 --- a/Source/WebCore/rendering/RenderRuby.cpp +++ b/Source/WebCore/rendering/RenderRuby.cpp @@ -34,6 +34,7 @@ #include "RenderRubyRun.h" #include "RenderStyle.h" +#include "StyleInheritedData.h" #include <wtf/RefPtr.h> namespace WebCore { diff --git a/Source/WebCore/rendering/RenderRubyRun.cpp b/Source/WebCore/rendering/RenderRubyRun.cpp index 9c27375df..65d764a9b 100644 --- a/Source/WebCore/rendering/RenderRubyRun.cpp +++ b/Source/WebCore/rendering/RenderRubyRun.cpp @@ -36,6 +36,7 @@ #include "RenderRubyText.h" #include "RenderText.h" #include "RenderView.h" +#include "StyleInheritedData.h" using namespace std; diff --git a/Source/WebCore/rendering/RenderScrollbar.cpp b/Source/WebCore/rendering/RenderScrollbar.cpp index f8e33c650..216c5f8d8 100644 --- a/Source/WebCore/rendering/RenderScrollbar.cpp +++ b/Source/WebCore/rendering/RenderScrollbar.cpp @@ -31,6 +31,7 @@ #include "RenderPart.h" #include "RenderScrollbarPart.h" #include "RenderScrollbarTheme.h" +#include "StyleInheritedData.h" namespace WebCore { diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp index 2cda8dcc7..77428c499 100644 --- a/Source/WebCore/rendering/RenderTable.cpp +++ b/Source/WebCore/rendering/RenderTable.cpp @@ -41,6 +41,7 @@ #include "RenderTableCol.h" #include "RenderTableSection.h" #include "RenderView.h" +#include "StyleInheritedData.h" using namespace std; diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp index 3f304e284..0cefc75a8 100644 --- a/Source/WebCore/rendering/RenderTableCell.cpp +++ b/Source/WebCore/rendering/RenderTableCell.cpp @@ -33,6 +33,7 @@ #include "PaintInfo.h" #include "RenderTableCol.h" #include "RenderView.h" +#include "StyleInheritedData.h" #include "TransformState.h" using namespace std; diff --git a/Source/WebCore/rendering/RenderTableRow.cpp b/Source/WebCore/rendering/RenderTableRow.cpp index 7ca33ad61..7dc05fa56 100644 --- a/Source/WebCore/rendering/RenderTableRow.cpp +++ b/Source/WebCore/rendering/RenderTableRow.cpp @@ -32,6 +32,7 @@ #include "PaintInfo.h" #include "RenderTableCell.h" #include "RenderView.h" +#include "StyleInheritedData.h" namespace WebCore { diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp index 2644a8438..a906a2ef8 100644 --- a/Source/WebCore/rendering/RenderTableSection.cpp +++ b/Source/WebCore/rendering/RenderTableSection.cpp @@ -34,6 +34,7 @@ #include "RenderTableCol.h" #include "RenderTableRow.h" #include "RenderView.h" +#include "StyleInheritedData.h" #include <limits> #include <wtf/HashSet.h> #include <wtf/Vector.h> diff --git a/Source/WebCore/rendering/RenderTextControl.cpp b/Source/WebCore/rendering/RenderTextControl.cpp index 1964d9171..3bc25b897 100644 --- a/Source/WebCore/rendering/RenderTextControl.cpp +++ b/Source/WebCore/rendering/RenderTextControl.cpp @@ -27,6 +27,7 @@ #include "RenderText.h" #include "RenderTheme.h" #include "ScrollbarTheme.h" +#include "StyleInheritedData.h" #include "TextIterator.h" #include "VisiblePosition.h" #include <wtf/unicode/CharacterNames.h> diff --git a/Source/WebCore/rendering/RenderTextControlMultiLine.cpp b/Source/WebCore/rendering/RenderTextControlMultiLine.cpp index a46327e65..96997d0ed 100644 --- a/Source/WebCore/rendering/RenderTextControlMultiLine.cpp +++ b/Source/WebCore/rendering/RenderTextControlMultiLine.cpp @@ -27,6 +27,7 @@ #include "HTMLTextAreaElement.h" #include "HitTestResult.h" #include "ShadowRoot.h" +#include "StyleInheritedData.h" #include "TextControlInnerElements.h" namespace WebCore { diff --git a/Source/WebCore/rendering/RenderTextTrackCue.cpp b/Source/WebCore/rendering/RenderTextTrackCue.cpp new file mode 100644 index 000000000..ef8edda64 --- /dev/null +++ b/Source/WebCore/rendering/RenderTextTrackCue.cpp @@ -0,0 +1,230 @@ +/* + * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if ENABLE(VIDEO_TRACK) + +#include "RenderTextTrackCue.h" + +#include "TextTrackCue.h" + +namespace WebCore { + +RenderTextTrackCue::RenderTextTrackCue(TextTrackCueBox* node) + : RenderBlock(static_cast<Node*>(node)) + , m_cue(node->getCue()) +{ +} + +void RenderTextTrackCue::layout() +{ + RenderBlock::layout(); + + LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode()); + if (m_cue->snapToLines()) + repositionCueSnapToLinesSet(); + else + repositionCueSnapToLinesNotSet(); + statePusher.pop(); +} + +bool RenderTextTrackCue::initializeLayoutParameters(InlineFlowBox*& firstLineBox, LayoutUnit& step, LayoutUnit& position) +{ + ASSERT(firstChild()); + + RenderBlock* parentBlock = containingBlock(); + firstLineBox = toRenderInline(firstChild())->firstLineBox(); + + // 1. Horizontal: Let step be the height of the first line box in boxes. + // Vertical: Let step be the width of the first line box in boxes. + step = m_cue->getWritingDirection() == TextTrackCue::Horizontal ? firstLineBox->height() : firstLineBox->width(); + + // 2. If step is zero, then jump to the step labeled done positioning below. + if (!step) + return false; + + // 3. Let line position be the text track cue computed line position. + int linePosition = m_cue->calculateComputedLinePosition(); + + // 4. Vertical Growing Left: Add one to line position then negate it. + if (m_cue->getWritingDirection() == TextTrackCue::VerticalGrowingLeft) + linePosition = -(linePosition + 1); + + // 5. Let position be the result of multiplying step and line position. + position = step * linePosition; + + // 6. Vertical Growing Left: Decrease position by the width of the + // bounding box of the boxes in boxes, then increase position by step. + if (m_cue->getWritingDirection() == TextTrackCue::VerticalGrowingLeft) { + position -= width(); + position += step; + } + + // 7. If line position is less than zero... + if (linePosition < 0) { + // Horizontal / Vertical: ... then increase position by the + // height / width of the video's rendering area ... + position += m_cue->getWritingDirection() == TextTrackCue::Horizontal ? parentBlock->height() : parentBlock->width(); + + // ... and negate step. + step = -step; + } + + return true; +} + +void RenderTextTrackCue::placeBoxInDefaultPosition(LayoutUnit position, bool& switched) +{ + // 8. Move all boxes in boxes ... + if (m_cue->getWritingDirection() == TextTrackCue::Horizontal) + // Horizontal: ... down by the distance given by position + setY(y() + position); + else + // Vertical: ... right by the distance given by position + setX(x() + position); + + // 9. Default: Remember the position of all the boxes in boxes as their + // default position. + m_fallbackPosition = FloatPoint(x(), y()); + + // 10. Let switched be false. + switched = false; +} + +bool RenderTextTrackCue::isOutside() const +{ + return !containingBlock()->absoluteBoundingBoxRect().contains(absoluteBoundingBoxRect()); +} + +bool RenderTextTrackCue::isOverlapping() const +{ + for (RenderObject* box = previousSibling(); box; box = box->previousSibling()) { + IntRect boxRect = box->absoluteBoundingBoxRect(); + + if (absoluteBoundingBoxRect().intersects(boxRect)) + return true; + } + + return false; +} + +bool RenderTextTrackCue::shouldSwitchDirection(InlineFlowBox* firstLineBox, LayoutUnit step) const +{ + LayoutUnit top = y(); + LayoutUnit left = x(); + LayoutUnit bottom = top + firstLineBox->height(); + LayoutUnit right = left + firstLineBox->width(); + + // 12. Horizontal: If step is negative and the top of the first line + // box in boxes is now above the top of the video's rendering area, + // or if step is positive and the bottom of the first line box in + // boxes is now below the bottom of the video's rendering area, jump + // to the step labeled switch direction. + LayoutUnit parentHeight = containingBlock()->height(); + if (m_cue->getWritingDirection() == TextTrackCue::Horizontal && ((step < 0 && top < 0) || (step > 0 && bottom > parentHeight))) + return true; + + // 12. Vertical: If step is negative and the left edge of the first line + // box in boxes is now to the left of the left edge of the video's + // rendering area, or if step is positive and the right edge of the + // first line box in boxes is now to the right of the right edge of + // the video's rendering area, jump to the step labeled switch direction. + LayoutUnit parentWidth = containingBlock()->width(); + if (m_cue->getWritingDirection() != TextTrackCue::Horizontal && ((step < 0 && left < 0) || (step > 0 && right > parentWidth))) + return true; + + return false; +} + +void RenderTextTrackCue::moveBoxesByStep(LayoutUnit step) +{ + // 13. Horizontal: Move all the boxes in boxes down by the distance + // given by step. (If step is negative, then this will actually + // result in an upwards movement of the boxes in absolute terms.) + if (m_cue->getWritingDirection() == TextTrackCue::Horizontal) + setY(y() + step); + + // 13. Vertical: Move all the boxes in boxes right by the distance + // given by step. (If step is negative, then this will actually + // result in a leftwards movement of the boxes in absolute terms.) + else + setX(x() + step); +} + +bool RenderTextTrackCue::switchDirection(bool& switched, LayoutUnit& step) +{ + // 15. Switch direction: Move all the boxes in boxes back to their + // default position as determined in the step above labeled default. + setX(m_fallbackPosition.x()); + setY(m_fallbackPosition.y()); + + // 16. If switched is true, jump to the step labeled done + // positioning below. + if (switched) + return false; + + // 17. Negate step. + step = -step; + + // 18. Set switched to true. + switched = true; + return true; +} + +void RenderTextTrackCue::repositionCueSnapToLinesSet() +{ + InlineFlowBox* firstLineBox; + LayoutUnit step; + LayoutUnit position; + if (!initializeLayoutParameters(firstLineBox, step, position)) + return; + + bool switched; + placeBoxInDefaultPosition(position, switched); + + // 11. Step loop: If none of the boxes in boxes would overlap any of the boxes + // in output and all the boxes in output are within the video's rendering area + // then jump to the step labeled done positioning. + while (isOutside() || isOverlapping()) { + if (!shouldSwitchDirection(firstLineBox, step)) + // 13. Move all the boxes in boxes ... + // 14. Jump back to the step labeled step loop. + moveBoxesByStep(step); + else if (!switchDirection(switched, step)) + break; + + // 19. Jump back to the step labeled step loop. + } +} + +void RenderTextTrackCue::repositionCueSnapToLinesNotSet() +{ + // FIXME: Implement overlapping detection when snap-to-lines is not set. http://wkb.ug/84296 +} + +} // namespace WebCore + +#endif diff --git a/Source/WebCore/rendering/RenderTextTrackCue.h b/Source/WebCore/rendering/RenderTextTrackCue.h new file mode 100644 index 000000000..8973ad8a7 --- /dev/null +++ b/Source/WebCore/rendering/RenderTextTrackCue.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef RenderTextTrackCue_h +#define RenderTextTrackCue_h + +#if ENABLE(VIDEO_TRACK) + +#include "FloatPoint.h" +#include "RenderBlock.h" +#include "RenderInline.h" +#include "RenderView.h" + +namespace WebCore { + +class TextTrackCueBox; + +class RenderTextTrackCue : public RenderBlock { +public: + explicit RenderTextTrackCue(TextTrackCueBox*); + +private: + virtual void layout() OVERRIDE; + + bool isOutside() const; + bool isOverlapping() const; + bool shouldSwitchDirection(InlineFlowBox*, LayoutUnit) const; + + void moveBoxesByStep(LayoutUnit); + bool switchDirection(bool&, LayoutUnit&); + + bool initializeLayoutParameters(InlineFlowBox*&, LayoutUnit&, LayoutUnit&); + void placeBoxInDefaultPosition(LayoutUnit, bool&); + void repositionCueSnapToLinesSet(); + + void repositionCueSnapToLinesNotSet(); + + TextTrackCue* m_cue; + FloatPoint m_fallbackPosition; +}; + +} // namespace WebCore + +#endif +#endif // RenderTextTrackCue_h diff --git a/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp b/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp index 3eaae4111..0a58af605 100644 --- a/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp +++ b/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp @@ -25,6 +25,7 @@ #include "RenderThemeChromiumSkia.h" #include "CSSValueKeywords.h" +#include "Font.h" #include "GraphicsContext.h" #include "HTMLMediaElement.h" #include "HTMLNames.h" diff --git a/Source/WebCore/rendering/RenderThemeWinCE.cpp b/Source/WebCore/rendering/RenderThemeWinCE.cpp index 188cd90b9..c5750f4bc 100644 --- a/Source/WebCore/rendering/RenderThemeWinCE.cpp +++ b/Source/WebCore/rendering/RenderThemeWinCE.cpp @@ -27,6 +27,7 @@ #include "CSSStyleSheet.h" #include "CSSValueKeywords.h" #include "Document.h" +#include "FontMetrics.h" #include "GraphicsContext.h" #if ENABLE(VIDEO) #include "HTMLMediaElement.h" diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp index 048f6e1ce..02b54c660 100644 --- a/Source/WebCore/rendering/RenderView.cpp +++ b/Source/WebCore/rendering/RenderView.cpp @@ -38,6 +38,7 @@ #include "RenderSelectionInfo.h" #include "RenderWidget.h" #include "RenderWidgetProtector.h" +#include "StyleInheritedData.h" #include "TransformState.h" #if USE(ACCELERATED_COMPOSITING) @@ -217,12 +218,9 @@ void RenderView::mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, Transfo bool RenderView::requiresColumns(int desiredColumnCount) const { - if (m_frameView) { - if (Frame* frame = m_frameView->frame()) { - if (Page* page = frame->page()) - return frame == page->mainFrame() && page->pagination().mode != Page::Pagination::Unpaginated; - } - } + if (m_frameView) + return m_frameView->pagination().mode != Pagination::Unpaginated; + return RenderBlock::requiresColumns(desiredColumnCount); } @@ -230,24 +228,17 @@ void RenderView::calcColumnWidth() { int columnWidth = contentLogicalWidth(); if (m_frameView && style()->hasInlineColumnAxis()) { - if (Frame* frame = m_frameView->frame()) { - if (Page* page = frame->page()) { - if (int pageLength = page->pagination().pageLength) - columnWidth = pageLength; - } - } + if (int pageLength = m_frameView->pagination().pageLength) + columnWidth = pageLength; } setDesiredColumnCountAndWidth(1, columnWidth); } ColumnInfo::PaginationUnit RenderView::paginationUnit() const { - if (m_frameView) { - if (Frame* frame = m_frameView->frame()) { - if (Page* page = frame->page()) - return (frame == page->mainFrame() && page->pagination().behavesLikeColumns) ? ColumnInfo::Column : ColumnInfo::Page; - } - } + if (m_frameView) + return m_frameView->pagination().behavesLikeColumns ? ColumnInfo::Column : ColumnInfo::Page; + return ColumnInfo::Page; } @@ -799,14 +790,8 @@ int RenderView::viewLogicalHeight() const int height = style()->isHorizontalWritingMode() ? viewHeight() : viewWidth(); if (hasColumns() && !style()->hasInlineColumnAxis()) { - if (Frame* frame = m_frameView->frame()) { - if (Page* page = frame->page()) { - if (frame == page->mainFrame()) { - if (int pageLength = page->pagination().pageLength) - height = pageLength; - } - } - } + if (int pageLength = m_frameView->pagination().pageLength) + height = pageLength; } return height; @@ -928,13 +913,8 @@ CustomFilterGlobalContext* RenderView::customFilterGlobalContext() void RenderView::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBlock::styleDidChange(diff, oldStyle); - - for (RenderObject* renderer = firstChild(); renderer; renderer = renderer->nextSibling()) { - if (renderer->isRenderNamedFlowThread()) { - RenderNamedFlowThread* flowRenderer = toRenderNamedFlowThread(renderer); - flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(style())); - } - } + if (hasRenderNamedFlowThreads()) + flowThreadController()->styleDidChange(); } bool RenderView::hasRenderNamedFlowThreads() const diff --git a/Source/WebCore/rendering/TextAutosizer.cpp b/Source/WebCore/rendering/TextAutosizer.cpp index 9e0f2a47d..6122962b2 100644 --- a/Source/WebCore/rendering/TextAutosizer.cpp +++ b/Source/WebCore/rendering/TextAutosizer.cpp @@ -31,6 +31,7 @@ #include "RenderText.h" #include "RenderView.h" #include "Settings.h" +#include "StyleInheritedData.h" namespace WebCore { diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h index 25ec75039..cd1e26cb2 100644 --- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h +++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h @@ -30,6 +30,7 @@ #if ENABLE(MATHML) #include "RenderBlock.h" +#include "StyleInheritedData.h" #define ENABLE_DEBUG_MATH_LAYOUT 0 diff --git a/Source/WebCore/rendering/style/KeyframeList.h b/Source/WebCore/rendering/style/KeyframeList.h index 5101b0689..6193fa67d 100644 --- a/Source/WebCore/rendering/style/KeyframeList.h +++ b/Source/WebCore/rendering/style/KeyframeList.h @@ -26,6 +26,7 @@ #define KeyframeList_h #include "CSSPropertyNames.h" +#include "StyleInheritedData.h" #include <wtf/Vector.h> #include <wtf/HashSet.h> #include <wtf/RefPtr.h> diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp index 72a438961..37d98904e 100644 --- a/Source/WebCore/rendering/style/RenderStyle.cpp +++ b/Source/WebCore/rendering/style/RenderStyle.cpp @@ -26,6 +26,7 @@ #include "ContentData.h" #include "CursorList.h" #include "CSSPropertyNames.h" +#include "Font.h" #include "FontSelector.h" #include "MemoryInstrumentation.h" #include "QuotesData.h" @@ -34,6 +35,7 @@ #include "ScaleTransformOperation.h" #include "ShadowData.h" #include "StyleImage.h" +#include "StyleInheritedData.h" #include "StyleResolver.h" #if ENABLE(TOUCH_EVENTS) #include "RenderTheme.h" diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h index 0925f80b7..011950c8e 100644 --- a/Source/WebCore/rendering/style/RenderStyle.h +++ b/Source/WebCore/rendering/style/RenderStyle.h @@ -35,7 +35,8 @@ #include "CounterDirectives.h" #include "DataRef.h" #include "FillLayer.h" -#include "Font.h" +#include "FontBaseline.h" +#include "FontDescription.h" #include "GraphicsTypes.h" #include "Length.h" #include "LengthBox.h" @@ -53,7 +54,6 @@ #include "StyleFlexibleBoxData.h" #include "StyleGridData.h" #include "StyleGridItemData.h" -#include "StyleInheritedData.h" #include "StyleMarqueeData.h" #include "StyleMultiColData.h" #include "StyleRareInheritedData.h" @@ -104,11 +104,14 @@ using std::max; class BorderData; class CounterContent; class CursorList; +class Font; +class FontMetrics; class IntRect; class MemoryObjectInfo; class Pair; class ShadowData; class StyleImage; +class StyleInheritedData; class StyleResolver; class TransformationMatrix; diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h index b0c330d13..880b62243 100644 --- a/Source/WebCore/rendering/style/RenderStyleConstants.h +++ b/Source/WebCore/rendering/style/RenderStyleConstants.h @@ -114,7 +114,7 @@ enum EBoxSizing { CONTENT_BOX, BORDER_BOX }; // Random visual rendering model attributes. Not inherited. enum EOverflow { - OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OMARQUEE + OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OMARQUEE, OPAGEDX, OPAGEDY }; enum EVerticalAlign { diff --git a/Source/WebCore/rendering/style/StyleInheritedData.cpp b/Source/WebCore/rendering/style/StyleInheritedData.cpp index ad14cbbfa..021740f15 100644 --- a/Source/WebCore/rendering/style/StyleInheritedData.cpp +++ b/Source/WebCore/rendering/style/StyleInheritedData.cpp @@ -20,7 +20,7 @@ */ #include "config.h" -#include "StyleRareInheritedData.h" +#include "StyleInheritedData.h" #include "RenderStyle.h" #include "StyleImage.h" diff --git a/Source/WebCore/rendering/svg/RenderSVGBlock.cpp b/Source/WebCore/rendering/svg/RenderSVGBlock.cpp index c4f9a284d..361279415 100644 --- a/Source/WebCore/rendering/svg/RenderSVGBlock.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGBlock.cpp @@ -27,6 +27,7 @@ #include "RenderSVGResource.h" #include "SVGElement.h" #include "SVGResourcesCache.h" +#include "StyleInheritedData.h" namespace WebCore { diff --git a/Source/WebCore/rendering/svg/RenderSVGInlineText.h b/Source/WebCore/rendering/svg/RenderSVGInlineText.h index ab81ca99f..7643cf1ab 100644 --- a/Source/WebCore/rendering/svg/RenderSVGInlineText.h +++ b/Source/WebCore/rendering/svg/RenderSVGInlineText.h @@ -23,6 +23,7 @@ #define RenderSVGInlineText_h #if ENABLE(SVG) +#include "Font.h" #include "RenderText.h" #include "SVGTextLayoutAttributes.h" diff --git a/Source/WebCore/svg/SVGLengthContext.cpp b/Source/WebCore/svg/SVGLengthContext.cpp index d33de3456..51b4900fc 100644 --- a/Source/WebCore/svg/SVGLengthContext.cpp +++ b/Source/WebCore/svg/SVGLengthContext.cpp @@ -27,6 +27,7 @@ #include "CSSHelper.h" #include "ExceptionCode.h" +#include "FontMetrics.h" #include "Frame.h" #include "RenderPart.h" #include "RenderSVGRoot.h" diff --git a/Source/WebCore/svg/SVGTRefElement.cpp b/Source/WebCore/svg/SVGTRefElement.cpp index cc3b55488..f74e01151 100644 --- a/Source/WebCore/svg/SVGTRefElement.cpp +++ b/Source/WebCore/svg/SVGTRefElement.cpp @@ -36,6 +36,7 @@ #include "SVGDocument.h" #include "SVGElementInstance.h" #include "SVGNames.h" +#include "StyleInheritedData.h" #include "Text.h" #include "XLinkNames.h" diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp index 063027870..cd673982c 100755 --- a/Source/WebCore/testing/InternalSettings.cpp +++ b/Source/WebCore/testing/InternalSettings.cpp @@ -160,7 +160,7 @@ void InternalSettings::reset() { TextRun::setAllowsRoundingHacks(false); setUserPreferredLanguages(Vector<String>()); - page()->setPagination(Page::Pagination()); + page()->setPagination(Pagination()); page()->setPageScaleFactor(1, IntPoint(0, 0)); #if ENABLE(PAGE_POPUP) m_pagePopupDriver.clear(); @@ -565,17 +565,17 @@ void InternalSettings::setPagination(const String& mode, int gap, int pageLength return; } - Page::Pagination pagination; + Pagination pagination; if (mode == "Unpaginated") - pagination.mode = Page::Pagination::Unpaginated; + pagination.mode = Pagination::Unpaginated; else if (mode == "LeftToRightPaginated") - pagination.mode = Page::Pagination::LeftToRightPaginated; + pagination.mode = Pagination::LeftToRightPaginated; else if (mode == "RightToLeftPaginated") - pagination.mode = Page::Pagination::RightToLeftPaginated; + pagination.mode = Pagination::RightToLeftPaginated; else if (mode == "TopToBottomPaginated") - pagination.mode = Page::Pagination::TopToBottomPaginated; + pagination.mode = Pagination::TopToBottomPaginated; else if (mode == "BottomToTopPaginated") - pagination.mode = Page::Pagination::BottomToTopPaginated; + pagination.mode = Pagination::BottomToTopPaginated; else { ec = SYNTAX_ERR; return; diff --git a/Source/WebCore/workers/DedicatedWorkerContext.cpp b/Source/WebCore/workers/DedicatedWorkerContext.cpp index d31da76cb..769de8cda 100644 --- a/Source/WebCore/workers/DedicatedWorkerContext.cpp +++ b/Source/WebCore/workers/DedicatedWorkerContext.cpp @@ -42,15 +42,15 @@ namespace WebCore { // static -PassRefPtr<DedicatedWorkerContext> DedicatedWorkerContext::create(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) +PassRefPtr<DedicatedWorkerContext> DedicatedWorkerContext::create(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin) { - RefPtr<DedicatedWorkerContext> context = adoptRef(new DedicatedWorkerContext(url, userAgent, settings, thread)); + RefPtr<DedicatedWorkerContext> context = adoptRef(new DedicatedWorkerContext(url, userAgent, settings, thread, topOrigin)); context->applyContentSecurityPolicyFromString(contentSecurityPolicy, contentSecurityPolicyType); return context.release(); } -DedicatedWorkerContext::DedicatedWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, DedicatedWorkerThread* thread) - : WorkerContext(url, userAgent, settings, thread) +DedicatedWorkerContext::DedicatedWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, DedicatedWorkerThread* thread, PassRefPtr<SecurityOrigin> topOrigin) + : WorkerContext(url, userAgent, settings, thread, topOrigin) { } diff --git a/Source/WebCore/workers/DedicatedWorkerContext.h b/Source/WebCore/workers/DedicatedWorkerContext.h index fdd1189c5..12f7ca209 100644 --- a/Source/WebCore/workers/DedicatedWorkerContext.h +++ b/Source/WebCore/workers/DedicatedWorkerContext.h @@ -44,7 +44,7 @@ namespace WebCore { class DedicatedWorkerContext : public WorkerContext { public: typedef WorkerContext Base; - static PassRefPtr<DedicatedWorkerContext> create(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, DedicatedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType); + static PassRefPtr<DedicatedWorkerContext> create(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, DedicatedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin); virtual bool isDedicatedWorkerContext() const { return true; } @@ -63,7 +63,7 @@ namespace WebCore { DedicatedWorkerThread* thread(); private: - DedicatedWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, DedicatedWorkerThread*); + DedicatedWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, DedicatedWorkerThread*, PassRefPtr<SecurityOrigin> topOrigin); }; } // namespace WebCore diff --git a/Source/WebCore/workers/DedicatedWorkerThread.cpp b/Source/WebCore/workers/DedicatedWorkerThread.cpp index 81a4edf2b..738d2c054 100644 --- a/Source/WebCore/workers/DedicatedWorkerThread.cpp +++ b/Source/WebCore/workers/DedicatedWorkerThread.cpp @@ -39,13 +39,13 @@ namespace WebCore { -PassRefPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) +PassRefPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) { - return adoptRef(new DedicatedWorkerThread(scriptURL, userAgent, settings, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType)); + return adoptRef(new DedicatedWorkerThread(scriptURL, userAgent, settings, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)); } -DedicatedWorkerThread::DedicatedWorkerThread(const KURL& url, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) - : WorkerThread(url, userAgent, settings, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType) +DedicatedWorkerThread::DedicatedWorkerThread(const KURL& url, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) + : WorkerThread(url, userAgent, settings, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin) , m_workerObjectProxy(workerObjectProxy) { } @@ -54,9 +54,9 @@ DedicatedWorkerThread::~DedicatedWorkerThread() { } -PassRefPtr<WorkerContext> DedicatedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) +PassRefPtr<WorkerContext> DedicatedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin> topOrigin) { - return DedicatedWorkerContext::create(url, userAgent, settings, this, contentSecurityPolicy, contentSecurityPolicyType); + return DedicatedWorkerContext::create(url, userAgent, settings, this, contentSecurityPolicy, contentSecurityPolicyType, topOrigin); } void DedicatedWorkerThread::runEventLoop() diff --git a/Source/WebCore/workers/DedicatedWorkerThread.h b/Source/WebCore/workers/DedicatedWorkerThread.h index 5aa13d0d1..5d94072be 100644 --- a/Source/WebCore/workers/DedicatedWorkerThread.h +++ b/Source/WebCore/workers/DedicatedWorkerThread.h @@ -41,16 +41,16 @@ namespace WebCore { class DedicatedWorkerThread : public WorkerThread { public: - static PassRefPtr<DedicatedWorkerThread> create(const KURL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); + static PassRefPtr<DedicatedWorkerThread> create(const KURL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, const SecurityOrigin* topOrigin); WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; } ~DedicatedWorkerThread(); protected: - virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); + virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin); virtual void runEventLoop(); private: - DedicatedWorkerThread(const KURL&, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); + DedicatedWorkerThread(const KURL&, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, const SecurityOrigin* topOrigin); WorkerObjectProxy& m_workerObjectProxy; }; diff --git a/Source/WebCore/workers/SharedWorkerContext.cpp b/Source/WebCore/workers/SharedWorkerContext.cpp index cbd2a340a..7997002ac 100644 --- a/Source/WebCore/workers/SharedWorkerContext.cpp +++ b/Source/WebCore/workers/SharedWorkerContext.cpp @@ -59,7 +59,7 @@ PassRefPtr<SharedWorkerContext> SharedWorkerContext::create(const String& name, } SharedWorkerContext::SharedWorkerContext(const String& name, const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, SharedWorkerThread* thread) - : WorkerContext(url, userAgent, settings, thread) + : WorkerContext(url, userAgent, settings, thread, 0) , m_name(name) { } diff --git a/Source/WebCore/workers/SharedWorkerThread.cpp b/Source/WebCore/workers/SharedWorkerThread.cpp index d39b3351d..5631587ad 100644 --- a/Source/WebCore/workers/SharedWorkerThread.cpp +++ b/Source/WebCore/workers/SharedWorkerThread.cpp @@ -44,7 +44,7 @@ PassRefPtr<SharedWorkerThread> SharedWorkerThread::create(const String& name, co } SharedWorkerThread::SharedWorkerThread(const String& name, const KURL& url, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) - : WorkerThread(url, userAgent, settings, sourceCode, workerLoaderProxy, workerReportingProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType) + : WorkerThread(url, userAgent, settings, sourceCode, workerLoaderProxy, workerReportingProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType, 0) , m_name(name.isolatedCopy()) { } @@ -53,7 +53,7 @@ SharedWorkerThread::~SharedWorkerThread() { } -PassRefPtr<WorkerContext> SharedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) +PassRefPtr<WorkerContext> SharedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, PassRefPtr<SecurityOrigin>) { return SharedWorkerContext::create(m_name, url, userAgent, settings, this, contentSecurityPolicy, contentSecurityPolicyType); } diff --git a/Source/WebCore/workers/SharedWorkerThread.h b/Source/WebCore/workers/SharedWorkerThread.h index c343824eb..c383313f7 100644 --- a/Source/WebCore/workers/SharedWorkerThread.h +++ b/Source/WebCore/workers/SharedWorkerThread.h @@ -43,7 +43,7 @@ namespace WebCore { ~SharedWorkerThread(); protected: - virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); + virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin); private: SharedWorkerThread(const String& name, const KURL&, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); diff --git a/Source/WebCore/workers/WorkerContext.cpp b/Source/WebCore/workers/WorkerContext.cpp index e5bd15ea6..d7eaf5db4 100644 --- a/Source/WebCore/workers/WorkerContext.cpp +++ b/Source/WebCore/workers/WorkerContext.cpp @@ -85,7 +85,7 @@ public: virtual bool isCleanupTask() const { return true; } }; -WorkerContext::WorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, WorkerThread* thread) +WorkerContext::WorkerContext(const KURL& url, const String& userAgent, PassOwnPtr<GroupSettings> settings, WorkerThread* thread, PassRefPtr<SecurityOrigin> topOrigin) : m_url(url) , m_userAgent(userAgent) , m_groupSettings(settings) @@ -96,6 +96,7 @@ WorkerContext::WorkerContext(const KURL& url, const String& userAgent, PassOwnPt #endif , m_closing(false) , m_eventQueue(WorkerEventQueue::create(this)) + , m_topOrigin(topOrigin) { setSecurityOrigin(SecurityOrigin::create(url)); } diff --git a/Source/WebCore/workers/WorkerContext.h b/Source/WebCore/workers/WorkerContext.h index 34819d07c..a6d60c814 100644 --- a/Source/WebCore/workers/WorkerContext.h +++ b/Source/WebCore/workers/WorkerContext.h @@ -138,8 +138,10 @@ namespace WebCore { void unregisterObserver(Observer*); void notifyObserversOfStop(); + const SecurityOrigin* topOrigin() const { return m_topOrigin.get(); } + protected: - WorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, WorkerThread*); + WorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, WorkerThread*, PassRefPtr<SecurityOrigin> topOrigin); void applyContentSecurityPolicyFromString(const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>); @@ -183,6 +185,8 @@ namespace WebCore { HashSet<Observer*> m_workerObservers; OwnPtr<WorkerEventQueue> m_eventQueue; + + RefPtr<SecurityOrigin> m_topOrigin; }; } // namespace WebCore diff --git a/Source/WebCore/workers/WorkerMessagingProxy.cpp b/Source/WebCore/workers/WorkerMessagingProxy.cpp index 6f839f0a6..c35d8e8aa 100644 --- a/Source/WebCore/workers/WorkerMessagingProxy.cpp +++ b/Source/WebCore/workers/WorkerMessagingProxy.cpp @@ -280,8 +280,9 @@ void WorkerMessagingProxy::startWorkerContext(const KURL& scriptURL, const Strin if (document->page()) settings = document->page()->group().groupSettings(); RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, settings, sourceCode, *this, *this, startMode, - m_scriptExecutionContext->contentSecurityPolicy()->deprecatedHeader(), - m_scriptExecutionContext->contentSecurityPolicy()->deprecatedHeaderType()); + document->contentSecurityPolicy()->deprecatedHeader(), + document->contentSecurityPolicy()->deprecatedHeaderType(), + document->topDocument()->securityOrigin()); workerThreadCreated(thread); thread->start(); InspectorInstrumentation::didStartWorkerContext(m_scriptExecutionContext.get(), this, scriptURL); diff --git a/Source/WebCore/workers/WorkerThread.cpp b/Source/WebCore/workers/WorkerThread.cpp index bd0355c41..d18c90dca 100644 --- a/Source/WebCore/workers/WorkerThread.cpp +++ b/Source/WebCore/workers/WorkerThread.cpp @@ -71,9 +71,9 @@ unsigned WorkerThread::workerThreadCount() struct WorkerThreadStartupData { WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED; public: - static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) + static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) { - return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType)); + return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)); } KURL m_scriptURL; @@ -83,17 +83,19 @@ public: WorkerThreadStartMode m_startMode; String m_contentSecurityPolicy; ContentSecurityPolicy::HeaderType m_contentSecurityPolicyType; + RefPtr<SecurityOrigin> m_topOrigin; private: - WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType); + WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin); }; -WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) +WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) : m_scriptURL(scriptURL.copy()) , m_userAgent(userAgent.isolatedCopy()) , m_sourceCode(sourceCode.isolatedCopy()) , m_startMode(startMode) , m_contentSecurityPolicy(contentSecurityPolicy.isolatedCopy()) , m_contentSecurityPolicyType(contentSecurityPolicyType) + , m_topOrigin(topOrigin ? topOrigin->isolatedCopy() : 0) { if (!settings) return; @@ -104,11 +106,11 @@ WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const St m_groupSettings->setIndexedDBDatabasePath(settings->indexedDBDatabasePath().isolatedCopy()); } -WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType) +WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) : m_threadID(0) , m_workerLoaderProxy(workerLoaderProxy) , m_workerReportingProxy(workerReportingProxy) - , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType)) + , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)) #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) , m_notificationClient(0) #endif @@ -146,7 +148,7 @@ void WorkerThread::workerThread() { { MutexLocker lock(m_threadCreationMutex); - m_workerContext = createWorkerContext(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_groupSettings.release(), m_startupData->m_contentSecurityPolicy, m_startupData->m_contentSecurityPolicyType); + m_workerContext = createWorkerContext(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_groupSettings.release(), m_startupData->m_contentSecurityPolicy, m_startupData->m_contentSecurityPolicyType, m_startupData->m_topOrigin.release()); if (m_runLoop.terminated()) { // The worker was terminated before the thread had a chance to run. Since the context didn't exist yet, diff --git a/Source/WebCore/workers/WorkerThread.h b/Source/WebCore/workers/WorkerThread.h index 670e3cd1c..dc3072fcb 100644 --- a/Source/WebCore/workers/WorkerThread.h +++ b/Source/WebCore/workers/WorkerThread.h @@ -31,6 +31,7 @@ #include "ContentSecurityPolicy.h" #include "GroupSettings.h" +#include "SecurityOrigin.h" #include "WorkerRunLoop.h" #include <wtf/Forward.h> #include <wtf/OwnPtr.h> @@ -69,10 +70,10 @@ namespace WebCore { #endif protected: - WorkerThread(const KURL&, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType); + WorkerThread(const KURL&, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, const SecurityOrigin* topOrigin); // Factory method for creating a new worker context for the thread. - virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType) = 0; + virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType, PassRefPtr<SecurityOrigin> topOrigin) = 0; // Executes the event loop for the worker thread. Derived classes can override to perform actions before/after entering the event loop. virtual void runEventLoop(); |