diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
| commit | 43a42f108af6bcbd91f2672731c3047c26213af1 (patch) | |
| tree | 7fa092e5f5d873c72f2486a70e26be26f7a38bec /Source/WebCore | |
| parent | d9cf437c840c6eb7417bdd97e6c40979255d3158 (diff) | |
| download | qtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz | |
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Source/WebCore')
365 files changed, 7226 insertions, 1329 deletions
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt index 7637c6f2b..78f9898df 100644 --- a/Source/WebCore/CMakeLists.txt +++ b/Source/WebCore/CMakeLists.txt @@ -522,6 +522,7 @@ SET(WebCore_IDL_FILES html/canvas/OESStandardDerivatives.idl html/canvas/OESTextureFloat.idl html/canvas/OESVertexArrayObject.idl + html/canvas/OESElementIndexUint.idl html/canvas/Uint16Array.idl html/canvas/Uint32Array.idl html/canvas/Uint8Array.idl @@ -1079,6 +1080,7 @@ SET(WebCore_SOURCES css/SelectorChecker.cpp css/ShadowValue.cpp css/StyleBuilder.cpp + css/StyleInvalidationAnalysis.cpp css/StyleMedia.cpp css/StylePropertySet.cpp css/StylePropertyShorthand.cpp @@ -1483,6 +1485,7 @@ SET(WebCore_SOURCES html/canvas/OESStandardDerivatives.cpp html/canvas/OESTextureFloat.cpp html/canvas/OESVertexArrayObject.cpp + html/canvas/OESElementIndexUint.cpp html/canvas/WebGLBuffer.cpp html/canvas/WebGLCompressedTextureS3TC.cpp html/canvas/WebGLContextAttributes.cpp @@ -2543,6 +2546,7 @@ IF (ENABLE_WEBGL) html/canvas/OESStandardDerivatives.cpp html/canvas/OESTextureFloat.cpp html/canvas/OESVertexArrayObject.cpp + html/canvas/OESElementIndexUint.cpp html/canvas/WebGLBuffer.cpp html/canvas/WebGLCompressedTextureS3TC.cpp html/canvas/WebGLContextAttributes.cpp @@ -2570,12 +2574,14 @@ IF (ENABLE_WEBGL) html/canvas/OESStandardDerivatives.cpp html/canvas/OESTextureFloat.cpp html/canvas/OESVertexArrayObject.cpp + html/canvas/OESElementIndexUint.cpp ) LIST(APPEND WebCore_IDL_FILES html/canvas/EXTTextureFilterAnisotropic.idl html/canvas/OESStandardDerivatives.idl html/canvas/OESTextureFloat.idl html/canvas/OESVertexArrayObject.idl + html/canvas/OESElementIndexUint.idl html/canvas/WebGLActiveInfo.idl html/canvas/WebGLBuffer.idl html/canvas/WebGLCompressedTextureS3TC.idl @@ -2624,6 +2630,7 @@ IF (WTF_USE_3D_GRAPHICS) ENDIF () LIST(APPEND ANGLESupport_SOURCES + ${THIRDPARTY_DIR}/ANGLE/src/compiler/ArrayBoundsClamper.cpp ${THIRDPARTY_DIR}/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp ${THIRDPARTY_DIR}/ANGLE/src/compiler/CodeGenGLSL.cpp ${THIRDPARTY_DIR}/ANGLE/src/compiler/Compiler.cpp diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 396a7c4c5..820680b03 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,3045 @@ +2012-10-22 Keishi Hattori <keishi@webkit.org> + + Remove monthFormatInLDML + https://bugs.webkit.org/show_bug.cgi?id=99971 + + Reviewed by Kent Tamura. + + Removing monthFormatInLDML from localized strings because Localizer class now provides the same functionality. + + No new tests. Just removing unused code. + + * platform/LocalizedStrings.h: + (WebCore): + +2012-10-22 Zan Dobersek <zandobersek@gmail.com> + + [GTK] Enable Microdata DOM API + https://bugs.webkit.org/show_bug.cgi?id=99033 + + Reviewed by Martin Robinson. + + Enable the Microdata DOM API, but still disable it when the unstable + features should be disabled (for instance in release builds). + + No new tests - related tests are being unskipped and are expected to pass. + + * GNUmakefile.am: + * GNUmakefile.features.am: + * bindings/gobject/GNUmakefile.am: Add the required files so the Microdata + API GObject bindings are generated and built. + +2012-10-22 Zan Dobersek <zandobersek@gmail.com> + + [GTK] Enable CSP 1.1 + https://bugs.webkit.org/show_bug.cgi?id=99064 + + Reviewed by Martin Robinson. + + Enable CSP 1.1 in development builds but keep it disabled when the + unstable features should not be enabled (like in stable releases). + + No new tests - they already exist and will be unskipped. + + * GNUmakefile.am: + * GNUmakefile.features.am: + +2012-10-22 Jocelyn Turcotte <jocelyn.turcotte@digia.com> + + [Qt] Fix "ASSERTION FAILED: !document->inPageCache()" when loading a page + https://bugs.webkit.org/show_bug.cgi?id=98514 + + Reviewed by Kenneth Rohde Christiansen. + + The problem is that we call setFixedVisibleContentRect, which triggers + a layout, after the document has been put in the page cache and before + the load has been actually committed. + + This applies the same trick as with setFixedLayoutSize by passing the rect + in Frame::createView and calling setFixedVisibleContentRect before the + new FrameView gets attached to the Frame/Document to prevent the layout. + + * WebCore.exp.in: + * page/Frame.cpp: + (WebCore::Frame::createView): Give a default value to the fixedLayoutSize and + useFixedLayout arguments as well since they are used exceptionally. + * page/Frame.h: + (Frame): + +2012-10-22 Allan Sandfeld Jensen <allan.jensen@digia.com> + + [Qt] Handle GET of blob URLs. + https://bugs.webkit.org/show_bug.cgi?id=99053 + + Reviewed by Simon Hausmann. + + Let BlobResourceHandle handle Blob request internally. + + * platform/network/qt/ResourceHandleQt.cpp: + (WebCore::ResourceHandle::loadResourceSynchronously): + +2012-10-22 Kenichi Ishibashi <bashi@chromium.org> + + HarfBuzzShaper::shape() should return false when it adds no glyph to GlyphBuffer + https://bugs.webkit.org/show_bug.cgi?id=99966 + + Reviewed by Kent Tamura. + + If no glyph is added to GlyphBuffer, HarfBuzzShaper::shape() returns false. + + No new tests. Confirmed the fix by using Address Sanitizer. + + * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp: + (WebCore::HarfBuzzShaper::shape): + (WebCore::HarfBuzzShaper::fillGlyphBuffer): Returns false when glyphBuffer.size() == 0 + * platform/graphics/harfbuzz/ng/HarfBuzzShaper.h: + (HarfBuzzShaper): + +2012-10-22 Shinya Kawanaka <shinyak@chromium.org> + + [Shadow] ASSERT triggered when we try reprojecting fallback elements. + https://bugs.webkit.org/show_bug.cgi?id=99815 + + Reviewed by Hajime Morita. + + When fallback elements of InsertionPoint is reprojected, they were attached twice. + We have to skip attaching them if they are attached. We also add a few ASSERT not to + allow attaching twice if not necessary. + + We have confirmed that this patch does not regress the performance. The summary of the + performance test is the following: + + Dromaeo/dom-modify.html [runs/s]: + median stdev min max + without this patch: 3928 184 3655 4361 + with this patch : 3925 178 3652 4350 + + Parser/html5-full-render.html [s]: + median stdev min max + without this patch: 3821 17 3811 3850 + with this patch : 3838 4.4 3833 3844 + + Test: fast/dom/shadow/content-reprojection-fallback-crash.html + + * dom/ContainerNode.cpp: + (WebCore): + (WebCore::childAttachedAllowedWhenAttachingChildren): If true, children of this node might + be attached in advance because of ShadowDOM attaching process. + * dom/ContainerNode.h: + (ContainerNode): + (WebCore): + (WebCore::ContainerNode::attachChildren): + * dom/Element.cpp: + (WebCore::Element::attach): + * dom/ShadowRoot.cpp: + (WebCore::ShadowRoot::attach): + +2012-10-22 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: merge "docked" state into the "dock side" enum. + https://bugs.webkit.org/show_bug.cgi?id=99717 + + Reviewed by Vsevolod Vlasov. + + Otherwise, it is hard to manage these inter-dependent flags. + + * WebCore.exp.in: + * inspector/InspectorFrontendClient.h: + (InspectorFrontendClient): + * inspector/InspectorFrontendClientLocal.cpp: + (WebCore::InspectorFrontendClientLocal::requestSetDockSide): + (WebCore::InspectorFrontendClientLocal::setAttachedWindow): + * inspector/InspectorFrontendClientLocal.h: + (InspectorFrontendClientLocal): + * inspector/InspectorFrontendHost.cpp: + (WebCore::InspectorFrontendHost::requestSetDockSide): + * inspector/InspectorFrontendHost.h: + (InspectorFrontendHost): + * inspector/InspectorFrontendHost.idl: + * inspector/front-end/DockController.js: + (WebInspector.DockController): + (WebInspector.DockController.prototype._updateUI.get sides): + (WebInspector.DockController.prototype._updateUI): + (WebInspector.DockController.prototype._toggleDockState): + * inspector/front-end/InspectorFrontendAPI.js: + (InspectorFrontendAPI.setAttachedWindow): + (InspectorFrontendAPI.setDockSide): + * inspector/front-end/InspectorFrontendHostStub.js: + (.WebInspector.InspectorFrontendHostStub.prototype.requestSetDockSide): + * inspector/front-end/externs.js: + +2012-10-22 MORITA Hajime <morrita@google.com> + + Unreviewed follow up to update test result after r132033. + + * bindings/scripts/test/V8/V8TestObj.cpp: + (WebCore::V8TestObj::installPerContextProperties): + +2012-10-21 MORITA Hajime <morrita@google.com> + + [V8] V8EnablePerContext shouldn't require document() accessor to the native object. + https://bugs.webkit.org/show_bug.cgi?id=99954 + + Reviewed by Kentaro Hara. + + It now refers ScriptExecutionContext of the creation context instead of document() of + wrapped object. + + No new tests. No behavior change at this time. + + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateImplementation): + +2012-10-21 Kent Tamura <tkent@chromium.org> + + Page popup: Fix crash by events after closing + https://bugs.webkit.org/show_bug.cgi?id=99951 + + Reviewed by Hajime Morita. + + WebCore should provide a way to uninstall a DOMWindowPagePopup supplement. + + No new tests. The bug is timing-dependent. + + * page/DOMWindowPagePopup.cpp: + (WebCore::DOMWindowPagePopup::uninstall): + Added. Calls Supplementable::removeSupplement. + * page/DOMWindowPagePopup.h: + (DOMWindowPagePopup): Declare uninstall. + * platform/Supplementable.h: + (WebCore::Supplementable::removeSupplement): Added. + +2012-10-21 Keishi Hattori <keishi@webkit.org> + + Refactor picker tests to fix flakiness and share code + https://bugs.webkit.org/show_bug.cgi?id=99671 + + Reviewed by Kent Tamura. + + Disable transitions until the picker is fully ready. This should fix flakiness. + + No new tests. + + * Resources/pagepopups/calendarPicker.css: + (.preparing .unavailable): Disable transitions. + (.preparing .available): Disable transitions. + * Resources/pagepopups/calendarPicker.js: + (CalendarPicker): Set "preparing" class. + (CalendarPicker.prototype._handleWindowResize): Remove the "preparing" class when the window finishes resizing. + +2012-10-21 Shinya Kawanaka <shinyak@chromium.org> + + Web Inspector: Shadow DOM: Node removal doesn't reflect. + https://bugs.webkit.org/show_bug.cgi?id=99567 + + Reviewed by Pavel Feldman. + + We have to call InspectorInstrumentation::willRemoveDOMNode() even if a node is in a shadow tree. + Otherwise, node won't be removed from the inspector. + + Test: inspector/elements/update-shadowdom.html + + * dom/ContainerNode.cpp: + (WebCore::dispatchChildRemovalEvents): + +2012-10-21 Andreas Kling <kling@webkit.org> + + Remove Page::javaScriptURLsAreAllowed setting. + <http://webkit.org/b/99944> + + Reviewed by Anders Carlsson. + + This setting was exposed through internal WebView API in Apple's WebKit1. + There are no longer any clients of that API. + + This is a step towards preventing elements from modifying their own attributes + below attributeChanged(). + + * WebCore.exp.in: + * WebCore.order: + * bindings/ScriptControllerBase.cpp: + (WebCore::ScriptController::executeIfJavaScriptURL): + * html/HTMLAnchorElement.cpp: + (WebCore::HTMLAnchorElement::parseAttribute): + * page/Page.cpp: + (WebCore::Page::Page): + * page/Page.h: + (Page): + +2012-10-21 Hyungchan Kim <hyungchan2.kim@lge.com> + + Add a separate flag for rgb swizzling whether it can be modified or not + https://bugs.webkit.org/show_bug.cgi?id=98728 + + BitmapTexture swizzles the source image if the OpenGL driver + doesn't support the BGRA extension. + In case of directly composited images, the source image should not + be modified. + + http://www.satine.org/research/webkit/snowleopard/snowstack.html + + Reviewed by Noam Rosenthal. + + No new tests as this is only testable on specific hardware and + currently not avaiable in the bots. + + * platform/graphics/texmap/TextureMapper.h: + (BitmapTexture): + * platform/graphics/texmap/TextureMapperBackingStore.cpp: + (WebCore::TextureMapperTile::updateContents): + (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded): + (WebCore::TextureMapperTiledBackingStore::updateContents): + * platform/graphics/texmap/TextureMapperBackingStore.h: + (TextureMapperTile): + (TextureMapperTiledBackingStore): + (WebCore::TextureMapperTiledBackingStore::updateContents): + * platform/graphics/texmap/TextureMapperGL.cpp: + (WebCore::TextureMapperGL::drawRepaintCounter): + (WebCore::BitmapTextureGL::updateContents): + * platform/graphics/texmap/TextureMapperGL.h: + (BitmapTextureGL): + * platform/graphics/texmap/TextureMapperImageBuffer.cpp: + (WebCore::BitmapTextureImageBuffer::updateContents): + * platform/graphics/texmap/TextureMapperImageBuffer.h: + (BitmapTextureImageBuffer): + * platform/graphics/texmap/TextureMapperLayer.cpp: + (WebCore::TextureMapperLayer::updateBackingStore): + +2012-10-21 Antti Koivisto <antti@apple.com> + + Factor stylesheet invalidation analysis code into a class + https://bugs.webkit.org/show_bug.cgi?id=99933 + + Reviewed by Sam Weinig. + + Currently the stylesheet analysis code is all over the place. It should be factored into a class to make + further progress easier. + + The patch adds StyleInvalidationAnalysis class and moves a bunch of code from SelectorChecker, StyleResolver + and DocumentStyleSheetCollection there. No functional changes. + + * CMakeLists.txt: + * GNUmakefile.list.am: + * Target.pri: + * WebCore.gypi: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * css/SelectorChecker.cpp: + (WebCore): + * css/SelectorChecker.h: + (WebCore): + * css/StyleInvalidationAnalysis.cpp: Added. + (WebCore): + (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis): + (WebCore::StyleInvalidationAnalysis::create): + (WebCore::determineSelectorScopes): + (WebCore::StyleInvalidationAnalysis::analyzeStyleSheet): + (WebCore::elementMatchesSelectorScopes): + (WebCore::StyleInvalidationAnalysis::invalidateStyle): + * css/StyleInvalidationAnalysis.h: Added. + (WebCore): + (StyleInvalidationAnalysis): + (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle): + * css/StyleResolver.cpp: + (WebCore::StyleResolver::checkRegionSelector): + * css/StyleResolver.h: + (StyleResolver): + * dom/DocumentStyleSheetCollection.cpp: + (WebCore): + (WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange): + * dom/DocumentStyleSheetCollection.h: + (DocumentStyleSheetCollection): + +2012-10-08 Robert Hogan <robert@webkit.org> + + In some float situations, the original layout is wrong and only corrects itself on repaint + https://bugs.webkit.org/show_bug.cgi?id=18939 + + Reviewed by Levi Weintraub. + + A <br> that follows collapsing spaces and has clearance set always needs to get a run and a linebox of its own. + This allows the line below it to check for clearance from the <br> if it gets dirtied but the line with the <br> + does not. + + Test: fast/block/br-with-clearance-after-collapsing-space.html + + * rendering/RenderBlockLineLayout.cpp: + (WebCore::RenderBlock::LineBreaker::nextLineBreak): + +2012-10-08 Robert Hogan <robert@webkit.org> + + floated element with negative margin causes text wrap bug + https://bugs.webkit.org/show_bug.cgi?id=94825 + + Reviewed by Levi Weintraub. + + Avoid over-estimating the available width on the line by ensuring that the offset taken to avoid + floats on the line is at least as much as the offset given by border, margin and padding. This only + happens when a negative margin on the float brings its edge back before the offset + given by the border, margin and padding of its parents. + + Test: fast/block/float/float-on-line-obeys-container-padding.html + + * rendering/RenderBlockLineLayout.cpp: + (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded): + +2012-10-20 Martin Robinson <mrobinson@igalia.com> + + Fix 'make dist' for the GTK+ port + + * GNUmakefile.am: Add missing files to the source list. + * GNUmakefile.list.am: Ditto. + +2012-10-20 Dan Bernstein <mitz@apple.com> + + <rdar://problem/12512710> [mac] Text with zero font size renders as 12px sometimes + https://bugs.webkit.org/show_bug.cgi?id=99918 + + Reviewed by Geoff Garen. + + -[NSFont fontWithName:size:] returns an NSFont of size 12 (the default User Font size) when + asked for size 0, and this is what Font::drawGlyphs uses to draw the text. + + Test: fast/text/zero-font-size-2.html + + * platform/graphics/mac/FontMac.mm: + (WebCore::Font::drawGlyphs): Added an early return if the size is zero. + +2012-10-20 Andreas Kling <kling@webkit.org> + + Clean up QualifiedName-as-hash-key scenario. + <http://webkit.org/b/99394> + + Reviewed by Anders Carlsson. + + Cache the hash on QualifiedNameImpl after the first time it's computed. + This grows QualifiedNameImpl by 4 bytes on 32-bit (no change on 64-bit due to base class padding) + which I believe is fine, since QualifiedName is a shared object. + + Add a global nullQName() function that returns a QualifiedName(nullAtom, nullAtom, nullAtom) + and use this to implement HashTraits<QualifiedName>::emptyValue(). The old implementation would + create a new QualifiedName(nullAtom, nullAtom, nullAtom) each time, which had to be hashed, + added to the global QualifiedName cache, etc. + + Finally, don't have SVGAttributeHashTranslator create a temporary QualifiedName just to compute + the hash of a (namespace, prefix, localName) tuple, use QualifiedNameComponents and hashComponents() + directly instead. + + Altogether this shaves ~100ms off of the RoboHornet svgresize.html benchmark on my MBP. + + * dom/QualifiedName.cpp: + (WebCore::nullQName): + (WebCore::QualifiedName::QualifiedNameImpl::computeHash): + * dom/QualifiedName.h: + (QualifiedNameImpl): + (WebCore::QualifiedName::QualifiedNameImpl::QualifiedNameImpl): + (WebCore::QualifiedNameHash::hash): + * svg/SVGElement.h: + (WebCore::SVGAttributeHashTranslator::hash): + +2012-10-20 Yael Aharon <yael.aharon@intel.com> + + [EFL][AC] Build fix after r131933 + https://bugs.webkit.org/show_bug.cgi?id=99901 + + Reviewed by Kentaro Hara. + + Add ArrayBoundsClamper.cpp to WebCore/CMakeLists.txt. + + No new tests. + + * CMakeLists.txt: + +2012-10-19 Adam Barth <abarth@webkit.org> + + [V8] V8DOMWrapper should avoid using its document parameter (so we can remove it soon) + https://bugs.webkit.org/show_bug.cgi?id=99876 + + Reviewed by Kentaro Hara. + + We want to remove the document parameter to instantiateV8Object. There + isn't always a Document available, so it doesn't make sense to pass it + as a parameter. We're just waiting for a V8 API change so we can still + construct Node wrappers quickly. + + This patch removes a use of the document that snuck in. Rather than + passing the ScriptExecutionContext around, we get it from the + CreationContext of the prototype object (and only when we actually need + it). + + * Modules/notifications/NotificationCenter.cpp: + * Modules/notifications/NotificationCenter.h: + (NotificationCenter): + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateHeader): + (GenerateConstructorGetter): + (GenerateImplementation): + (GenerateToV8Converters): + * bindings/v8/V8DOMWindowShell.cpp: + (WebCore::V8DOMWindowShell::installDOMWindow): + * bindings/v8/V8DOMWrapper.cpp: + (WebCore::V8DOMWrapper::instantiateV8Object): + * bindings/v8/V8PerContextData.cpp: + (WebCore::V8PerContextData::createWrapperFromCacheSlowCase): + (WebCore::V8PerContextData::constructorForTypeSlowCase): + * bindings/v8/V8PerContextData.h: + (WebCore::V8PerContextData::createWrapperFromCache): + (WebCore::V8PerContextData::constructorForType): + (V8PerContextData): + * bindings/v8/WorkerContextExecutionProxy.cpp: + (WebCore::WorkerContextExecutionProxy::initializeIfNeeded): + * bindings/v8/WrapperTypeInfo.h: + (WebCore): + (WebCore::WrapperTypeInfo::installPerContextPrototypeProperties): + +2012-10-19 Florin Malita <fmalita@chromium.org> + + Incorrect pattern scaling + https://bugs.webkit.org/show_bug.cgi?id=99870 + + Reviewed by Dirk Schulze. + + The pattern space transform scale should reflect the tile_size(user space) + to tile_image_size ratio, instead of tile_size to absolute_tile_size. + + Test: svg/custom/pattern-scaling.svg + + * rendering/svg/RenderSVGResourcePattern.cpp: + (WebCore::RenderSVGResourcePattern::applyResource): + +2012-10-19 Tony Chang <tony@chromium.org> + + RenderFlexibleBox::preferredMainAxisContentExtentForChild can return a negative value + https://bugs.webkit.org/show_bug.cgi?id=97827 + + Reviewed by Ojan Vafai. + + I'm pretty sure this isn't possible (logicalHeight and maxPreferredLogicalWidth should always include + border and padding), so just add an assert. + + No new tests, the assert is for code clarity. + + * rendering/RenderFlexibleBox.cpp: + (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): + +2012-10-19 Tony Chang <tony@chromium.org> + + Replace calls to updateLogicalHeight with calls to computeLogicalHeight + https://bugs.webkit.org/show_bug.cgi?id=99883 + + Reviewed by Ojan Vafai. + + In RenderBox and RenderBlock, switch to using computeLogicalHeight instead of + saving the old height, calling update logical height, then restoring the old height. + + No new tests, this is just a refactoring. + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): Simple replace. + * rendering/RenderBox.cpp: + (WebCore::RenderBox::computePercentageLogicalHeight): Adjust for content height. + (WebCore::RenderBox::computeReplacedLogicalHeightUsing): Adjust for content height. + (WebCore::RenderBox::availableLogicalHeightUsing): Adjust for content height. + +2012-10-19 Pablo Flouret <pablof@motorola.com> + + Implement setRangeText() on text controls + https://bugs.webkit.org/show_bug.cgi?id=91907 + + Reviewed by Kent Tamura. + + setRangeText() replaces a range of text with some other text, and + adjusts the existing selection according to its parameters. + + Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#dom-textarea/input-setrangetext + + Tests: fast/forms/color/color-setrangetext.html + fast/forms/date/date-setrangetext.html + fast/forms/datetime/datetime-setrangetext.html + fast/forms/datetimelocal/datetimelocal-setrangetext.html + fast/forms/file/file-setrangetext.html + fast/forms/hidden/hidden-setrangetext.html + fast/forms/image/image-setrangetext.html + fast/forms/month/month-setrangetext.html + fast/forms/number/number-setrangetext.html + fast/forms/range/range-setrangetext.html + fast/forms/search/search-setrangetext.html + fast/forms/setrangetext.html + fast/forms/textarea/textarea-setrangetext.html + fast/forms/time/time-setrangetext.html + fast/forms/week/week-setrangetext.html + + + * bindings/scripts/CodeGeneratorGObject.pm: + (SkipFunction): + The GObject generator doesn't support function overloads, so skip the + version of setRangeText() that has only one argument, its behavior + can be emulated with the four-argument version. + + * html/InputType.cpp: + (WebCore::InputType::supportsSelectionAPI): + (WebCore): + * html/InputType.h: + (InputType): + Add supportsSelectionAPI() which indicates whether the various + selection api functions like setRangeText, setSelectionRange, etc. + are supported by this input element. + + * html/BaseTextInputType.cpp: + (WebCore::BaseTextInputType::supportsSelectionAPI): + (WebCore): + * html/BaseTextInputType.h: + (BaseTextInputType): + Text-based input types support the selection APIs. + + * html/EmailInputType.cpp: + (WebCore::EmailInputType::supportsSelectionAPI): + (WebCore): + * html/EmailInputType.h: + (EmailInputType): + Email inputs don't support the selection APIs. + + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::setRangeText): + * html/HTMLInputElement.h: + (HTMLInputElement): + Add a setRangeText override which checks if it should apply to the + input type, and calls the actual implementation on the parent class. + * html/HTMLInputElement.idl: + * html/HTMLTextAreaElement.idl: + + * html/HTMLTextFormControlElement.cpp: + (WebCore::HTMLTextFormControlElement::setRangeText): + * html/HTMLTextFormControlElement.h: + (HTMLTextFormControlElement): + setRangeText implementation. + + +2012-10-19 Luke Macpherson <macpherson@chromium.org> + + Remove HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE macro in StyleResolver. + https://bugs.webkit.org/show_bug.cgi?id=99782 + + Reviewed by Sam Weinig. + + Removes last usage of HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE macro, so that in future there will be no temptation + to use it instead of adding a line to StyleBuilder. + Also removes redundant checks for inital and inherit (HANDLE_INHERIT_AND_INTIAL already returns in those cases). + I don't want to move this code into StyleBuilder until the FIXME that is already there is fixed. + + Covered by many existing writing mode tests (eg. fast/html/details-writing-mode.html) + + * css/StyleResolver.cpp: + (WebCore): + (WebCore::StyleResolver::applyProperty): + +2012-10-19 Joshua Bell <jsbell@chromium.org> + + IndexedDB: Hidden indexing events are visible to script via bubbling/capture + https://bugs.webkit.org/show_bug.cgi?id=96566 + + Reviewed by Tony Chang. + + Stop propagation of error events fired at internal indexing requests as a result of + aborting, as they should not be visible to scripts. + + Test: storage/indexeddb/index-population.html + + * Modules/indexeddb/IDBObjectStore.cpp: + (WebCore::IDBObjectStore::createIndex): + * Modules/indexeddb/IDBRequest.cpp: + (WebCore::IDBRequest::IDBRequest): + (WebCore::IDBRequest::dispatchEvent): + * Modules/indexeddb/IDBRequest.h: + (WebCore::IDBRequest::preventPropagation): + (IDBRequest): + +2012-10-19 Simon Fraser <simon.fraser@apple.com> + + Remove .get() calls in assertions as suggested by Darin Adler. + + * platform/graphics/ca/mac/PlatformCALayerMac.mm: + (PlatformCALayer::appendSublayer): + (PlatformCALayer::insertSublayer): + (PlatformCALayer::replaceSublayer): + +2012-10-19 Simon Fraser <simon.fraser@apple.com> + + Fix a hang when combining tile cache layers with preserve-3d or reflections + https://bugs.webkit.org/show_bug.cgi?id=99890 + <rdar://problem/12539560> + + Reviewed by Dean Jackson. + + The new tile cache code added an updateSublayers() call when switching to/from + tiled layers. This confused later sublayer rebuilding, causing us to attempt to + add a layer as a child of itself, causing a hang in CA. + + Fix by removing all the explicit calls to updateFoo when updating the structural + layer and switching to/from tiled layers. Instead, we set dirty flags, and rely + on the fact that these flag-dirtying functions get called before the later functions + that process those dirty flags. This is assured by some reordering of the update + function calls. + + A final wrinkle is that ensureStructuralLayer() can change the layer that our + parent GraphicsLayer put in its sublayer list. Rather than diddle with that sublayer + list directly like we used to, just call noteSublayersChanged() on the parent, and have + commitLayerChangesAfterSublayers() check the ChildrenChanged and do a second update + of sublayers if necessary (we clear the flag in commitLayerChangesBeforeSublayers(), so + only do this work if a sublayer requested it). + + Tests: compositing/tiling/preserve3d-tiled.html + compositing/tiling/reflected-tiled.html + + * platform/graphics/ca/GraphicsLayerCA.cpp: + (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): + (WebCore::GraphicsLayerCA::commitLayerChangesAfterSublayers): + (WebCore::GraphicsLayerCA::ensureStructuralLayer): + (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): + * platform/graphics/ca/mac/PlatformCALayerMac.mm: + (PlatformCALayer::appendSublayer): Add assertion about adding a layer to itself. + (PlatformCALayer::insertSublayer): Ditto. + (PlatformCALayer::replaceSublayer): Ditto. + +2012-10-19 Chris Fleizach <cfleizach@apple.com> + + AX: aria-hidden=false does not work as expected + https://bugs.webkit.org/show_bug.cgi?id=98787 + + Reviewed by Beth Dakin. + + ARIA requires that aria-hidden=false override an element's native visibility and include that + node in the AX hierarchy. + + To accomplish this we have to allow invisible items to be included, as well as items that + have no renderers associated with them. + + Test: accessibility/aria-hidden-negates-no-visibility.html + + * accessibility/AXObjectCache.cpp: + (WebCore::AXObjectCache::getOrCreate): + * accessibility/AccessibilityARIAGrid.cpp: + (WebCore::AccessibilityARIAGrid::addTableCellChild): + (WebCore::AccessibilityARIAGrid::addChildren): + * accessibility/AccessibilityARIAGrid.h: + (AccessibilityARIAGrid): + * accessibility/AccessibilityNodeObject.cpp: + (WebCore): + (WebCore::AccessibilityNodeObject::boundingBoxRect): + (WebCore::AccessibilityNodeObject::insertChild): + (WebCore::AccessibilityNodeObject::addChild): + (WebCore::AccessibilityNodeObject::addChildren): + (WebCore::AccessibilityNodeObject::textUnderElement): + * accessibility/AccessibilityNodeObject.h: + (AccessibilityNodeObject): + * accessibility/AccessibilityObject.cpp: + (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange): + (WebCore): + * accessibility/AccessibilityObject.h: + (AccessibilityObject): + (WebCore::AccessibilityObject::addChild): + (WebCore::AccessibilityObject::insertChild): + * accessibility/AccessibilityRenderObject.cpp: + (WebCore): + (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase): + (WebCore::AccessibilityRenderObject::addHiddenChildren): + (WebCore::AccessibilityRenderObject::addChildren): + * accessibility/AccessibilityRenderObject.h: + (AccessibilityRenderObject): + +2012-10-19 Michael Saboff <msaboff@apple.com> + + Add String version of visitedLinkHash() to properly handle 8-bit URL Strings. + https://bugs.webkit.org/show_bug.cgi?id=99735 + + Reviewed by Filip Pizlo. + + Added String version of visitedLinkHash(). Made speculative addition of visitedLinkHash() + to chromium platform version of LinkHashChromium.cpp. + Changed calls in the form of visitedLinkHash(string.characters(), string.length()) to use the + new form. + + No changes to functionality, so no new tests. + + * WebCore.exp.in: + * loader/HistoryController.cpp: + (WebCore::addVisitedLink): + * page/PageGroup.cpp: + (WebCore::PageGroup::addVisitedLink): + * platform/LinkHash.cpp: + (WebCore::visitedLinkHashInline): + (WebCore::visitedLinkHash): + * platform/LinkHash.h: + * platform/chromium/LinkHashChromium.cpp: + (WebCore::visitedLinkHash): + +2012-10-19 Michael Saboff <msaboff@apple.com> + + String(CFStringRef) should try to converting to an 8 bit string before converting to 16 bit string + https://bugs.webkit.org/show_bug.cgi?id=99794 + + Reviewed by Filip Pizlo. + + Try getting a Latin1 byte string before getting a UTF16 (UChar*) string. + + No new test, added 8 bit path. + + * platform/text/cf/StringCF.cpp: + (WTF::String::String): + +2012-10-19 Dima Gorbik <dgorbik@apple.com> + + Page should be removed from the cache right after restore was called. + https://bugs.webkit.org/show_bug.cgi?id=99737 + + Reviewed by Brady Eidson. + + The pageCache was inconsistent after the restoration for a period of time because the cachedFrame is being nulled, + but the page is still in the Cache. Now the page is being removed from the cache right after the restoration. + This issue was spotted in a custom built application using WebKit and unfortunately there is no way to test this + behavior in LayoutTests. All the current tests that exercise the page cache do pass. + + No new tests. + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::commitProvisionalLoad): + +2012-10-19 Max Vujovic <mvujovic@adobe.com> + + [WebGL] getUniformLocation fails for uniform array name without array brackets + https://bugs.webkit.org/show_bug.cgi?id=99854 + + Reviewed by Dean Jackson. + + Before this patch, gl.getUniformLocation(program, "array[0]") would return the array + location, but gl.getUniformLocation(program, "array") would not. Now, the latter also + returns the array location. + + In the process of adding a check to the following Khronos WebGL conformance test: + conformance/glsl/misc/glsl-long-variable-names.html + + * platform/graphics/ANGLEWebKitBridge.cpp: + (WebCore::getSymbolInfo): + Before, we used to check that the symbol size was greater than one to determine that the + symbol was an array. However, this doesn't identify arrays of length one. Now, we check + if the symbol name ends in "[0]", since ANGLE appends this suffix to array symbol + names. + If the symbol is an array, we strip off the "[0]" and add a symbol with just the base + name. We set the isArray flag on the symbol, so we don't lose the information that it is + an array. + Then, we create symbols for each array element like before. However, instead of + replacing the "0" in array[0]" with each index, we take the base name "array" and + append array brackets containing each index (e.g. "array" + "[7]"). + * platform/graphics/ANGLEWebKitBridge.h: + (ANGLEShaderSymbol): + Add isArray boolean to ANGLEShaderSymbol. Since array symbols don't end in "[0]" + anymore, this is the only way to identify arrays. + +2012-10-19 Csaba Osztrogonác <ossy@webkit.org> + + Unreviewed, rolling out r131915. + http://trac.webkit.org/changeset/131915 + https://bugs.webkit.org/show_bug.cgi?id=98787 + + It broke the build on platforms with \!HAVE(ACCESSIBILITY) + + * accessibility/AXObjectCache.cpp: + (WebCore::AXObjectCache::getOrCreate): + (WebCore::AXObjectCache::nodeIsTextControl): + * accessibility/AXObjectCache.h: + (WebCore): + * accessibility/AccessibilityARIAGrid.cpp: + (WebCore::AccessibilityARIAGrid::addChild): + (WebCore::AccessibilityARIAGrid::addChildren): + * accessibility/AccessibilityARIAGrid.h: + (AccessibilityARIAGrid): + * accessibility/AccessibilityNodeObject.cpp: + (WebCore::AccessibilityNodeObject::elementRect): + (WebCore::AccessibilityNodeObject::addChildren): + (WebCore::AccessibilityNodeObject::textUnderElement): + * accessibility/AccessibilityNodeObject.h: + (AccessibilityNodeObject): + * accessibility/AccessibilityObject.cpp: + * accessibility/AccessibilityObject.h: + (AccessibilityObject): + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::textIteratorBehaviorForTextRange): + (WebCore): + (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase): + (WebCore::AccessibilityRenderObject::addChildren): + * accessibility/AccessibilityRenderObject.h: + (AccessibilityRenderObject): + +2012-10-19 Tony Chang <tony@chromium.org> + + Unreviewed, rolling out r131936. + http://trac.webkit.org/changeset/131936 + https://bugs.webkit.org/show_bug.cgi?id=99717 + + Broke the clang build + + * WebCore.exp.in: + * inspector/InspectorFrontendClient.h: + (InspectorFrontendClient): + * inspector/InspectorFrontendClientLocal.cpp: + (WebCore::InspectorFrontendClientLocal::requestAttachWindow): + (WebCore): + (WebCore::InspectorFrontendClientLocal::requestDetachWindow): + (WebCore::InspectorFrontendClientLocal::setAttachedWindow): + * inspector/InspectorFrontendClientLocal.h: + (InspectorFrontendClientLocal): + (WebCore::InspectorFrontendClientLocal::requestSetDockSide): + * inspector/InspectorFrontendHost.cpp: + (WebCore::InspectorFrontendHost::requestAttachWindow): + (WebCore): + (WebCore::InspectorFrontendHost::requestDetachWindow): + (WebCore::InspectorFrontendHost::requestSetDockSide): + * inspector/InspectorFrontendHost.h: + (InspectorFrontendHost): + * inspector/InspectorFrontendHost.idl: + * inspector/front-end/DockController.js: + (WebInspector.DockController): + (WebInspector.DockController.prototype.setDocked): + (WebInspector.DockController.prototype._innerSetDocked.set if): + (WebInspector.DockController.prototype._innerSetDocked): + (WebInspector.DockController.prototype._updateUI.get states): + (WebInspector.DockController.prototype._updateUI): + (WebInspector.DockController.prototype._toggleDockState): + * inspector/front-end/InspectorFrontendAPI.js: + (InspectorFrontendAPI.setAttachedWindow): + (InspectorFrontendAPI.setDockSide): + * inspector/front-end/InspectorFrontendHostStub.js: + (.WebInspector.InspectorFrontendHostStub.prototype.requestAttachWindow): + (.WebInspector.InspectorFrontendHostStub.prototype.requestDetachWindow): + (.WebInspector.InspectorFrontendHostStub.prototype.requestSetDockSide): + * inspector/front-end/externs.js: + (InspectorFrontendHostAPI.prototype.requestAttachWindow): + (InspectorFrontendHostAPI.prototype.requestDetachWindow): + +2012-10-09 Martin Robinson <mrobinson@igalia.com> + + REGRESSION (r130699): 5 various fast/ tests started failing + https://bugs.webkit.org/show_bug.cgi?id=98729 + + Reviewed by Xan Lopez. + + Do not try to remove the URL fragment for data URLs. This will likely + just corrupt the URL. + + No new tests. This unskips some previously failing tests. + + * platform/network/soup/ResourceRequestSoup.cpp: + (WebCore::ResourceRequest::urlStringForSoup): Do nothing for data URLs. + +2012-10-19 Simon Fraser <simon.fraser@apple.com> + + Use tile caches in place of CATiledLayer + https://bugs.webkit.org/show_bug.cgi?id=99806 + <rdar://problem/6474145> + + Reviewed by Tim Horton. + + Have GraphicsLayerCA use TileCaches instead of CATiledLayer now for + layers that exceed the 2000px size threshold. + + * platform/graphics/TiledBacking.h: + (TiledBacking): Have normal getter and setter for the visible rect. + * platform/graphics/ca/GraphicsLayerCA.cpp: + (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly): We need + to pass in an old visibleRect to commitLayerChangesBeforeSublayers(). Just use + our current visible rect, which result in no tile area work. + (WebCore::GraphicsLayerCA::computeVisibleRect): Make this const and have it + return the rect, for clarity. + (WebCore::GraphicsLayerCA::recursiveCommitChanges): Keep track of the old + visible rect, and use the change flags mechanism to ensure that we recompute + tile areas later. + When calling commitLayerChangesBeforeSublayers() on the mask layer, just pass + its own visible rect as the old visible rect. + (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Pass in the + oldVisibleRect so that updateVisibleRect() can use this to see how the + visibleRect is changing. + (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect): This member function + compares the old and new visible rects, and extends the tile coverage area + in directions where more content is being exposed. It takes care to avoid + "jitter" in the visible rect deltas causing edge tiles to get created then + destroyed by keeping any extra padding that already exists in a direction + where more content is being exposed. + (WebCore::GraphicsLayerCA::updateVisibleRect): Call adjustTiledLayerVisibleRect() + and use the result to update the TiledBacking's visibleRect. + (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Create layers of type + LayerTypeTileCacheLayer instead of LayerTypeWebTiledLayer. Because tile + cache layers involve adding an extra layer to the hierarchy (the tile container), + we call updateSublayerList() when changing layer type. + * platform/graphics/ca/GraphicsLayerCA.h: New m_sizeAtLastVisibleRectUpdate member + that is used to prevent the adjustTiledLayerVisibleRect() logic being confused by + size changes. + (WebCore::GraphicsLayerCA::visibleRect): + * platform/graphics/ca/mac/TileCache.h: Have normal getter and setter for the visible rect. + * platform/graphics/ca/mac/TileCache.mm: + (WebCore::TileCache::setVisibleRect): Renamed to setVisibleRect(). + * rendering/RenderLayerCompositor.cpp: + (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Avoid doing work + for pages in the page cache, for which the root layer is unattached. + (WebCore::RenderLayerCompositor::frameViewDidScroll): visibleRectChanged() was renamed + to setVisibleRect(). + +2012-10-19 Beth Dakin <bdakin@apple.com> + + https://bugs.webkit.org/show_bug.cgi?id=99768 + We should limit the tile cache coverage when a page can't take + advantage of fast tile scrolling anyway + + Reviewed by Simon Fraser. + + When sites can't use fast-scrolling, there is no need to inflate the + tile cache. In fact, we get a performance boost by keeping it small + on painting-intensive sites. + + Instead of just looking a whether or not the FrameView + canHaveScrollbar(), consult + shouldUpdateScrollLayerPositionOnMainThread(). + * page/FrameView.cpp: + (WebCore::FrameView::performPostLayoutTasks): + * rendering/RenderLayerBacking.cpp: + (WebCore::RenderLayerBacking::RenderLayerBacking): + + Expose shouldUpdateScrollLayerPositionOnMainThread(). + * page/scrolling/ScrollingCoordinator.cpp: + (WebCore::ScrollingCoordinator::hasNonLayerFixedObjects): + (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionOnMainThread): + (WebCore): + (WebCore::ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread): + * page/scrolling/ScrollingCoordinator.h: + (ScrollingCoordinator): + + Bug fix. Should be bitwise and. + * platform/graphics/ca/mac/TileCache.mm: + (WebCore::TileCache::tileCoverageRect): + +2012-10-19 Mark Lam <mark.lam@apple.com> + + Added WTF::StackStats mechanism. + https://bugs.webkit.org/show_bug.cgi?id=99805. + + Reviewed by Geoffrey Garen. + + Added StackStats probes in layout methods. + + * dom/Document.cpp: + (WebCore::Document::updateLayout): + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::layout): + * rendering/RenderBox.cpp: + (WebCore::RenderBox::layout): + * rendering/RenderDialog.cpp: + (WebCore::RenderDialog::layout): + * rendering/RenderEmbeddedObject.cpp: + (WebCore::RenderEmbeddedObject::layout): + * rendering/RenderFlowThread.cpp: + (WebCore::RenderFlowThread::layout): + * rendering/RenderFrameSet.cpp: + (WebCore::RenderFrameSet::layout): + * rendering/RenderIFrame.cpp: + (WebCore::RenderIFrame::layout): + * rendering/RenderImage.cpp: + (WebCore::RenderImage::layout): + * rendering/RenderListBox.cpp: + (WebCore::RenderListBox::layout): + * rendering/RenderListItem.cpp: + (WebCore::RenderListItem::layout): + * rendering/RenderListMarker.cpp: + (WebCore::RenderListMarker::layout): + * rendering/RenderMedia.cpp: + (WebCore::RenderMedia::layout): + * rendering/RenderObject.cpp: + (WebCore::RenderObject::layout): + * rendering/RenderObject.h: + * rendering/RenderRegion.cpp: + (WebCore::RenderRegion::layout): + * rendering/RenderReplaced.cpp: + (WebCore::RenderReplaced::layout): + * rendering/RenderReplica.cpp: + (WebCore::RenderReplica::layout): + * rendering/RenderRubyRun.cpp: + (WebCore::RenderRubyRun::layoutSpecialExcludedChild): + * rendering/RenderScrollbarPart.cpp: + (WebCore::RenderScrollbarPart::layout): + * rendering/RenderSlider.cpp: + (WebCore::RenderSlider::layout): + * rendering/RenderTable.cpp: + (WebCore::RenderTable::layout): + * rendering/RenderTableCell.cpp: + (WebCore::RenderTableCell::layout): + * rendering/RenderTableRow.cpp: + (WebCore::RenderTableRow::layout): + * rendering/RenderTableSection.cpp: + (WebCore::RenderTableSection::layout): + * rendering/RenderTextControlSingleLine.cpp: + (WebCore::RenderTextControlSingleLine::layout): + * rendering/RenderTextTrackCue.cpp: + (WebCore::RenderTextTrackCue::layout): + * rendering/RenderVideo.cpp: + (WebCore::RenderVideo::layout): + * rendering/RenderView.cpp: + (WebCore::RenderView::layout): + * rendering/RenderWidget.cpp: + (WebCore::RenderWidget::layout): + * rendering/svg/RenderSVGContainer.cpp: + (WebCore::RenderSVGContainer::layout): + * rendering/svg/RenderSVGForeignObject.cpp: + (WebCore::RenderSVGForeignObject::layout): + * rendering/svg/RenderSVGGradientStop.cpp: + (WebCore::RenderSVGGradientStop::layout): + * rendering/svg/RenderSVGHiddenContainer.cpp: + (WebCore::RenderSVGHiddenContainer::layout): + * rendering/svg/RenderSVGImage.cpp: + (WebCore::RenderSVGImage::layout): + * rendering/svg/RenderSVGResourceContainer.cpp: + (WebCore::RenderSVGResourceContainer::layout): + * rendering/svg/RenderSVGResourceMarker.cpp: + (WebCore::RenderSVGResourceMarker::layout): + * rendering/svg/RenderSVGRoot.cpp: + (WebCore::RenderSVGRoot::layout): + * rendering/svg/RenderSVGShape.cpp: + (WebCore::RenderSVGShape::layout): + * rendering/svg/RenderSVGText.cpp: + (WebCore::RenderSVGText::layout): + +2012-10-19 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: merge "docked" state into the "dock side" enum. + https://bugs.webkit.org/show_bug.cgi?id=99717 + + Reviewed by Vsevolod Vlasov. + + Otherwise, it is hard to manage these inter-dependent flags. + + * inspector/InspectorFrontendClient.h: + (InspectorFrontendClient): + * inspector/InspectorFrontendClientLocal.cpp: + (WebCore::InspectorFrontendClientLocal::requestSetDockSide): + (WebCore::InspectorFrontendClientLocal::setAttachedWindow): + * inspector/InspectorFrontendClientLocal.h: + (InspectorFrontendClientLocal): + * inspector/InspectorFrontendHost.cpp: + (WebCore::InspectorFrontendHost::requestSetDockSide): + * inspector/InspectorFrontendHost.h: + (InspectorFrontendHost): + * inspector/InspectorFrontendHost.idl: + * inspector/front-end/DockController.js: + (WebInspector.DockController): + (WebInspector.DockController.prototype._updateUI.get sides): + (WebInspector.DockController.prototype._updateUI): + (WebInspector.DockController.prototype._toggleDockState): + * inspector/front-end/InspectorFrontendAPI.js: + (InspectorFrontendAPI.setAttachedWindow): + * inspector/front-end/InspectorFrontendHostStub.js: + (.WebInspector.InspectorFrontendHostStub.prototype.requestSetDockSide): + +2012-10-19 Joshua Bell <jsbell@chromium.org> + + [V8] IndexedDB: Crash when lazy-indexing Date keys + https://bugs.webkit.org/show_bug.cgi?id=99860 + + Reviewed by Adam Barth. + + Missing a scope/context needed when digging values out of Date objects + in an indexing callback. + + Test: storage/indexeddb/lazy-index-types.html + + * bindings/v8/IDBBindingUtilities.cpp: + (WebCore::createIDBKeyFromScriptValueAndKeyPath): + +2012-10-18 Dean Jackson <dino@apple.com> + + Shader translator needs option to clamp uniform array accesses in vertex shaders + https://bugs.webkit.org/show_bug.cgi?id=98977 + https://code.google.com/p/angleproject/issues/detail?id=49 + + Reviewed by Alok Priyadarshi and Ken Russell. + + WebGL forbids out-of-bounds array access in shaders. Rewrite any shaders to + ensure that non-direct array indexing is clamped to the bounds of the array. + + Test: fast/canvas/webgl/array-bounds-clamping.html + + * platform/graphics/ANGLEWebKitBridge.cpp: + (WebCore::ANGLEWebKitBridge::compileShaderSource): Pass new compiler option SH_CLAMP_INDIRECT_ARRAY_BOUNDS + +2012-10-19 Justin Novosad <junov@chromium.org> + + [Chromium] Reduce memory footprint of canvas pattern object with deferred rendering + https://bugs.webkit.org/show_bug.cgi?id=99856 + + Reviewed by Stephen White. + + Marking internal bitmap copy as immutable to prevent it from being + unnecessarily duplicated in skia by SkBitmapHeap. + + No new tests: code path already well covered by existing layout tests + fast/canvas/canvas-pattern-* + + * platform/graphics/skia/PatternSkia.cpp: + (WebCore::Pattern::platformPattern): + +2012-10-19 Antti Koivisto <antti@apple.com> + + Maintain a list of active CSS stylesheets + https://bugs.webkit.org/show_bug.cgi?id=99843 + + Reviewed by Andreas Kling. + + Currently we maintain a per-document list of stylesheets that matches what is returned by the StyleSheetList DOM API. + This list contains both CSS and XSLT stylesheets which internally have basically nothing in common. Maintaining + a list of active CSS stylesheets separately simplifies code in number of places. + + * css/StyleResolver.cpp: + (WebCore::StyleResolver::StyleResolver): + (WebCore::StyleResolver::addStylesheetsFromSeamlessParents): + (WebCore::StyleResolver::appendAuthorStyleSheets): + (WebCore::collectCSSOMWrappers): + * css/StyleResolver.h: + (StyleResolver): + * css/StyleSheetList.cpp: + (WebCore::StyleSheetList::styleSheets): + (WebCore::StyleSheetList::detachFromDocument): + * dom/Document.cpp: + (WebCore::Document::setCompatibilityMode): + * dom/DocumentStyleSheetCollection.cpp: + (WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange): + (WebCore::styleSheetsUseRemUnits): + (WebCore::filterEnabledCSSStyleSheets): + (WebCore): + (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): + (WebCore::DocumentStyleSheetCollection::reportMemoryUsage): + * dom/DocumentStyleSheetCollection.h: + (WebCore::DocumentStyleSheetCollection::styleSheetsForStyleSheetList): + (DocumentStyleSheetCollection): + (WebCore::DocumentStyleSheetCollection::activeAuthorStyleSheets): + +2012-09-08 Alpha Lam <hclam@chromium.org> + + [chromium] Implement deferred image decoding + https://bugs.webkit.org/show_bug.cgi?id=94240 + + Reviewed by Stephen White. + + Objectives: + + To record image decoding operations during painting and to defer + decoding operations until rasterization. + + Rationale: + + This is a key feature that enables impl-side painting which requires + fast recording of drawing operations. The existing decode-on-draw + restricts that recording has to block on expensive decoding operations. + This change allows recording of image decoding operations during paint + time. + + Design: + + Image decoding happens when a BitmapImage is drawn into a + GraphicsContext. When per-tile painting is enabled GraphicsContext + is backed by SkCanvas in recording mode. This SkCanvas records drawing + and image decoding operations to minimize recording time. + + An image decoding operation is recorded as a SkPixelRef object + implemented by LazyDecodingPixelRef. This object references raw encoded + data, regions to be decoded and scaling information. + + When used in conjunction with per-tile painting this feature defers + image decoding until the SkCanvas referencing the image is rasterized. + + Both recording and rasterization happen on the main thread. + + Performance Impact: + + This feature is enabled by WebKit::setDeferredImageDecodingEnabled() + and does not have an impact when disabled. + + This feature is disabled by default. + + Upcoming Changes: + + 1. Implement a full-featured image cache in ImageDecodingStore. + 2. Allow rasterization and decoding on impl thread. + + Classes Involved: + + BitmapImage + + BitmapImage is the entry point for deferred image decoding. When + drawing a BitmapImage into a GraphicsContext it makes a request to + create a NativeImageSkia. We substitute the content in NativeImageSkia + such that it is lazily decoded. + + DeferredImageDecoder + + This is the platform implementation of a image decoder for Chromium. + This is a bridge layer that either delegates calls to the actual + ImageDecoder or create a lazily-decoded SkBitmap and delegates calls + to ImageDecodingStore. + + ImageDecodingStore + + This object manages all encoded images. It keeps track of encoded + data and the corresponding ImageDecoder for doing actual decoding. It + is also responsible for generating lazily decoded SkBitmaps. This + SkBitmap contains a LazyDecodingPixelRef object which references to an + image entry in ImageDecodingStore. + + ScaledImageFragment + + A container for a scaled image fragment. In addition to bitmap pixels + it contains information about the ID of the image, scale and clipping. + + ImageFrameGenerator + + This object is responsible for generating decoded pixels. It is also + a container for encoded image data and corresponding image decoder. + + LazyDecodingPixelRef + + This object is embedded in a SkBitmap to enable lazy decoding. When + SkBitmap needs to access pixels LazyDecodingPixelRef is locked. It + contains information to locate an image and scaling info, these + information is submitted to ImageDecodingStore to access actual pixels. + + Layout tests. There are about 80 tests in this virtual test suite + running this feature in this directory: + + platform/chromium/virtual/deferred/fast/images + + Unit tests. Added DeferredImageDecoderTest to verify deferred + image decoding behavior. + + * WebCore.gypi: + * platform/graphics/ImageSource.cpp: + (WebCore::ImageSource::setData): + * platform/graphics/ImageSource.h: + (WebCore): + (ImageSource): + * platform/graphics/chromium/DeferredImageDecoder.cpp: Added. + (WebCore): + (WebCore::DeferredImageDecoder::DeferredImageDecoder): + (WebCore::DeferredImageDecoder::~DeferredImageDecoder): + (WebCore::DeferredImageDecoder::create): + (WebCore::DeferredImageDecoder::createForTesting): + (WebCore::DeferredImageDecoder::filenameExtension): + (WebCore::DeferredImageDecoder::frameBufferAtIndex): + (WebCore::DeferredImageDecoder::setData): + (WebCore::DeferredImageDecoder::isSizeAvailable): + (WebCore::DeferredImageDecoder::size): + (WebCore::DeferredImageDecoder::frameSizeAtIndex): + (WebCore::DeferredImageDecoder::frameCount): + (WebCore::DeferredImageDecoder::repetitionCount): + (WebCore::DeferredImageDecoder::clearFrameBufferCache): + (WebCore::DeferredImageDecoder::frameHasAlphaAtIndex): + (WebCore::DeferredImageDecoder::frameBytesAtIndex): + * platform/graphics/chromium/DeferredImageDecoder.h: Added. + (WebCore): + (DeferredImageDecoder): + * platform/graphics/chromium/ImageDecodingStore.cpp: Added. + (WebCore::ImageDecodingStore::ImageDecodingStore): + (WebCore): + (WebCore::ImageDecodingStore::~ImageDecodingStore): + (WebCore::ImageDecodingStore::instanceOnMainThread): + (WebCore::ImageDecodingStore::initializeOnMainThread): + (WebCore::ImageDecodingStore::shutdown): + (WebCore::ImageDecodingStore::isLazyDecoded): + (WebCore::ImageDecodingStore::createLazyDecodedSkBitmap): + (WebCore::ImageDecodingStore::resizeLazyDecodedSkBitmap): + (WebCore::ImageDecodingStore::setData): + (WebCore::ImageDecodingStore::lockPixels): + (WebCore::ImageDecodingStore::unlockPixels): + (WebCore::ImageDecodingStore::frameGeneratorBeingDestroyed): + (WebCore::ImageDecodingStore::calledOnValidThread): + (WebCore::ImageDecodingStore::lookupFrameCache): + (WebCore::ImageDecodingStore::deleteFrameCache): + * platform/graphics/chromium/ImageDecodingStore.h: Added. + (WebCore): + (ImageDecodingStore): + (WebCore::ImageDecodingStore::create): + * platform/graphics/chromium/ScaledImageFragment.cpp: Added. + (WebCore): + (WebCore::ScaledImageFragment::~ScaledImageFragment): + (WebCore::ScaledImageFragment::ScaledImageFragment): + (WebCore::ScaledImageFragment::isEqual): + * platform/graphics/chromium/ScaledImageFragment.h: Added. + (WebCore): + (ScaledImageFragment): + (WebCore::ScaledImageFragment::create): + (WebCore::ScaledImageFragment::bitmap): + (WebCore::ScaledImageFragment::isComplete): + * platform/graphics/chromium/ImageFrameGenerator.cpp: Added. + (WebCore): + (WebCore::ImageFrameGenerator::ImageFrameGenerator): + (WebCore::ImageFrameGenerator::~ImageFrameGenerator): + (WebCore::ImageFrameGenerator::decoder): + (WebCore::ImageFrameGenerator::setData): + * platform/graphics/chromium/ImageFrameGenerator.h: Added. + (WebCore): + (ImageFrameGenerator): + (WebCore::ImageFrameGenerator::create): + (WebCore::ImageFrameGenerator::size): + (WebCore::ImageFrameGenerator::imageId): + * platform/graphics/chromium/LazyDecodingPixelRef.cpp: Added. + (WebCore): + (WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef): + (WebCore::LazyDecodingPixelRef::~LazyDecodingPixelRef): + (WebCore::LazyDecodingPixelRef::isScaled): + (WebCore::LazyDecodingPixelRef::isClipped): + (WebCore::LazyDecodingPixelRef::onLockPixels): + (WebCore::LazyDecodingPixelRef::onUnlockPixels): + (WebCore::LazyDecodingPixelRef::onLockPixelsAreWritable): + * platform/graphics/chromium/LazyDecodingPixelRef.h: Added. + (WebCore): + (LazyDecodingPixelRef): + (WebCore::LazyDecodingPixelRef::frameGenerator): + * platform/graphics/skia/NativeImageSkia.cpp: + (WebCore::NativeImageSkia::resizedBitmap): + * platform/image-decoders/ImageDecoder.h: + (ImageFrame): + (WebCore::ImageFrame::setSkBitmap): + (WebCore::ImageFrame::getSkBitmap): + +2012-10-18 Yael Aharon <yael.aharon@intel.com> + + [EFL] GraphicsContext3D::m_renderStyle is not initialized + https://bugs.webkit.org/show_bug.cgi?id=99721 + + Reviewed by Antonio Gomes. + + Initialize GraphicsContext3D::m_renderStyle. + + No new tests, no new functionality. + + * platform/graphics/efl/GraphicsContext3DEfl.cpp: + (WebCore::GraphicsContext3D::GraphicsContext3D): + +2012-10-19 Dongwoo Joshua Im <dw.im@samsung.com> + + Rename ENABLE_CSS3_TEXT_DECORATION to ENABLE_CSS3_TEXT + https://bugs.webkit.org/show_bug.cgi?id=99804 + + Reviewed by Julien Chaffraix. + + CSS3 text related properties will be implemented under this flag, + including text decoration, text-align-last, and text-justify. + + No new functionality, no new test. + + * Configurations/FeatureDefines.xcconfig: + * GNUmakefile.am: + * GNUmakefile.features.am: + * css/CSSComputedStyleDeclaration.cpp: + (WebCore): + (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): + * css/CSSParser.cpp: + (WebCore::CSSParser::parseValue): + (WebCore::CSSParser::addTextDecorationProperty): + (WebCore::CSSParser::parseTextDecoration): + * css/CSSPrimitiveValueMappings.h: + (WebCore): + * css/CSSProperty.cpp: + (WebCore::CSSProperty::isInheritedProperty): + * css/CSSPropertyNames.in: + * css/CSSValueKeywords.in: + * css/StyleBuilder.cpp: + (WebCore::StyleBuilder::StyleBuilder): + * css/StyleResolver.cpp: + (WebCore::StyleResolver::applyProperty): + * rendering/style/RenderStyle.cpp: + (WebCore::RenderStyle::diff): + * rendering/style/RenderStyle.h: + * rendering/style/RenderStyleConstants.h: + (WebCore): + * rendering/style/StyleRareNonInheritedData.cpp: + (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): + (WebCore::StyleRareNonInheritedData::operator==): + * rendering/style/StyleRareNonInheritedData.h: + (StyleRareNonInheritedData): + +2012-10-19 Nate Chapin <japhet@chromium.org> + + Reorder some functions in SubresourceLoader to permit main resources + https://bugs.webkit.org/show_bug.cgi?id=99769 + + Reviewed by Adam Barth. + + Most resource types that go through the memory cache (and therefore + through SubresourceLoader) are not sensitive to the exact ordering of + the callbacks they receive, particularly as it relates to ResourceLoadNotifier + calls. Main resources are not so lenient. For main resources to be cacheable + and maintain the current behavior as precisely as possible, we will need to + rearrange SubresourceLoader's willSendRequest() and didReceiveData(). + + No new tests, refactor only. + + * loader/SubresourceLoader.cpp: + (WebCore::SubresourceLoader::willSendRequest): There are a series of checks that can result + in the request being canceled, plus calls to CachedResource::willSendRequest() and + ResourceLoader::willSendRequest(). MainResourceLoader (which will be a + CachedResourceClient) has work it expects to do before ResourceLoader::willSendRequest() + is called, but the calls are out of order for that, so swap those. + (WebCore::SubresourceLoader::didReceiveData): We need to populate ResourceLoader::m_resourceData + before notifying CachedResource of new data, but we also want to do CachedResourceClients calls + before calling ResourceLoadNotifier. This means we can't delegate to ResourceLoader. + +2012-10-19 Chris Fleizach <cfleizach@apple.com> + + AX: aria-hidden=false does not work as expected + https://bugs.webkit.org/show_bug.cgi?id=98787 + + Reviewed by Beth Dakin. + + ARIA requires that aria-hidden=false override an element's native visibility and include that + node in the AX hierarchy. + + To accomplish this we have to allow invisible items to be included, as well as items that + have no renderers associated with them. + + Test: accessibility/aria-hidden-negates-no-visibility.html + + * accessibility/AXObjectCache.cpp: + (WebCore::AXObjectCache::getOrCreate): + * accessibility/AccessibilityARIAGrid.cpp: + (WebCore::AccessibilityARIAGrid::addTableCellChild): + (WebCore::AccessibilityARIAGrid::addChildren): + * accessibility/AccessibilityARIAGrid.h: + (AccessibilityARIAGrid): + * accessibility/AccessibilityNodeObject.cpp: + (WebCore): + (WebCore::AccessibilityNodeObject::boundingBoxRect): + (WebCore::AccessibilityNodeObject::insertChild): + (WebCore::AccessibilityNodeObject::addChild): + (WebCore::AccessibilityNodeObject::addChildren): + (WebCore::AccessibilityNodeObject::textUnderElement): + * accessibility/AccessibilityNodeObject.h: + (AccessibilityNodeObject): + * accessibility/AccessibilityObject.cpp: + (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange): + (WebCore): + * accessibility/AccessibilityObject.h: + (AccessibilityObject): + (WebCore::AccessibilityObject::addChild): + (WebCore::AccessibilityObject::insertChild): + * accessibility/AccessibilityRenderObject.cpp: + (WebCore): + (WebCore::AccessibilityRenderObject::accessibilityIsIgnoredBase): + (WebCore::AccessibilityRenderObject::addHiddenChildren): + (WebCore::AccessibilityRenderObject::addChildren): + * accessibility/AccessibilityRenderObject.h: + (AccessibilityRenderObject): + +2012-10-19 Tommy Widenflycht <tommyw@google.com> + + MediaStream API: Rename owner to client in MediaStreamDescriptor + https://bugs.webkit.org/show_bug.cgi?id=99593 + + Reviewed by Adam Barth. + + This patch renames owner to client in MediaStreamDescriptor as discussed in #99080. + + No new tests needed, covered by existing tests. + + * Modules/mediastream/MediaStream.cpp: + (WebCore::MediaStream::MediaStream): + (WebCore::MediaStream::~MediaStream): + * Modules/mediastream/MediaStream.h: + (MediaStream): + * Modules/mediastream/PeerConnection00.cpp: + (WebCore::PeerConnection00::didRemoveRemoteStream): + * Modules/mediastream/RTCPeerConnection.cpp: + (WebCore::RTCPeerConnection::didRemoveRemoteStream): + * platform/mediastream/MediaStreamCenter.cpp: + (WebCore::MediaStreamCenter::endLocalMediaStream): + (WebCore::MediaStreamCenter::addMediaStreamTrack): + (WebCore::MediaStreamCenter::removeMediaStreamTrack): + * platform/mediastream/MediaStreamDescriptor.h: + (WebCore::MediaStreamDescriptorClient::~MediaStreamDescriptorClient): + (WebCore::MediaStreamDescriptor::client): + (WebCore::MediaStreamDescriptor::setClient): + (WebCore::MediaStreamDescriptor::MediaStreamDescriptor): + (MediaStreamDescriptor): + +2012-10-19 Shinya Kawanaka <shinyak@chromium.org> + + Elements assigned to <shadow> should not be reprojected. + https://bugs.webkit.org/show_bug.cgi?id=99680 + + Reviewed by Dimitri Glazkov. + + In the current spec, we don't have shadow reprojection, i.e. elements assigned to <shadow> should not be + reprojected to content. However, we can select them by <shadow>. + + Tests: fast/dom/shadow/content-reprojection-complex.html + fast/dom/shadow/content-reprojection-shadow.html + fast/dom/shadow/shadow-reprojection-prohibited.html + + * html/shadow/ContentDistributor.cpp: + (WebCore::ContentDistributor::distribute): When a node is <shadow>, we should not add elements assigned to <shadow> + to POOL. Instead, <shadow> itself should be added to POOL. + * html/shadow/HTMLContentElement.h: + (WebCore::isHTMLContentElement): + (WebCore): + +2012-10-19 Chris Fleizach <cfleizach@apple.com> + + VO issues with hidden <legend> and last explicitly labelled element within a group <fieldset> + https://bugs.webkit.org/show_bug.cgi?id=96325 + + Reviewed by Beth Dakin. + + When finding a <legend> for accessibility, we need to consider those that are offscreen. This patch + modifies the original findLegend method to take a parameter to determine what should be done. + + Test: accessibility/hidden-legend.html + + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::titleUIElement): + * rendering/RenderFieldset.cpp: + (WebCore::RenderFieldset::findLegend): + * rendering/RenderFieldset.h: + +2012-10-17 Chris Fleizach <cfleizach@apple.com> + + AX: Refactor accessibility name computation so it's more platform independent + https://bugs.webkit.org/show_bug.cgi?id=99502 + + Reviewed by Beth Dakin. + + The current model of determining the accessible text for an object has a lot of Mac biases built in + due to legacy implementation. + + This change categorizes and orders accessibility text based on WAI-ARIA text computation rules and then + allows the platform (only Mac right now) to decide how best to apply that text to its own AX API. + http://www.w3.org/TR/wai-aria/roles#textalternativecomputation + + This change tried very hard not to change any test behavior, even though it exposed a number of weird + edge cases where we were treating attributes differently based on element type. + + Future patches will resolve those discrepancies. + + * accessibility/AccessibilityImageMapLink.cpp: + (WebCore::AccessibilityImageMapLink::accessibilityText): + * accessibility/AccessibilityImageMapLink.h: + (AccessibilityImageMapLink): + * accessibility/AccessibilityMediaControls.cpp: + (WebCore::AccessibilityMediaControl::accessibilityText): + * accessibility/AccessibilityMediaControls.h: + (AccessibilityMediaControl): + (WebCore::AccessibilityMediaTimeDisplay::isMediaControlLabel): + * accessibility/AccessibilityNodeObject.cpp: + (WebCore::AccessibilityNodeObject::titleElementText): + (WebCore::AccessibilityNodeObject::accessibilityText): + (WebCore::AccessibilityNodeObject::ariaLabeledByText): + (WebCore::AccessibilityNodeObject::alternativeText): + (WebCore::AccessibilityNodeObject::alternativeTextForWebArea): + (WebCore::AccessibilityNodeObject::visibleText): + (WebCore::AccessibilityNodeObject::helpText): + (WebCore::AccessibilityNodeObject::ariaDescribedByAttribute): + * accessibility/AccessibilityNodeObject.h: + (AccessibilityNodeObject): + * accessibility/AccessibilityObject.h: + (AccessibilityText): + (WebCore::AccessibilityText::AccessibilityText): + (WebCore::AccessibilityObject::isMediaControlLabel): + (AccessibilityObject): + (WebCore::AccessibilityObject::accessibilityText): + (WebCore::AccessibilityObject::setAccessibleName): + (WebCore::AccessibilityObject::accessibilityDescription): + (WebCore::AccessibilityObject::title): + (WebCore::AccessibilityObject::helpText): + (WebCore::AccessibilityObject::stringValue): + (WebCore::AccessibilityObject::textUnderElement): + (WebCore::AccessibilityObject::text): + (WebCore::AccessibilityObject::textLength): + (WebCore::AccessibilityObject::setRoleValue): + (WebCore::AccessibilityObject::roleValue): + (WebCore::AccessibilityObject::selection): + (WebCore::AccessibilityObject::hierarchicalLevel): + * accessibility/AccessibilityRenderObject.cpp: + * accessibility/AccessibilityRenderObject.h: + (AccessibilityRenderObject): + * accessibility/mac/WebAccessibilityObjectWrapper.mm: + (-[WebAccessibilityObjectWrapper titleTagShouldBeUsedInDescriptionField]): + (-[WebAccessibilityObjectWrapper accessibilityTitle]): + (-[WebAccessibilityObjectWrapper accessibilityDescription]): + (-[WebAccessibilityObjectWrapper accessibilityHelpText]): + (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): + * platform/LocalizedStrings.cpp: + (WebCore::localizedMediaControlElementHelpText): + +2012-10-19 Kent Tamura <tkent@chromium.org> + + Use Localizer::monthFormat to construct input[type=month] UI + https://bugs.webkit.org/show_bug.cgi?id=99818 + + Reviewed by Kentaro Hara. + + Use an LDML format returned by Localizer::monthFormat for + input[type=month] UI. + + Because the format may contain symbolic month names and symbolic + stand-alone month names, we need to add: + - Symbolic/numeric detection in DateTimeEditBuilder + - Normal/stand-alone detection in DateTimeEditBuilder + - Symbolic edit field for months + + Test: fast/forms/month-multiple-fields/month-multiple-fields-appearance-l10n.html, + fast/forms/month-multiple-fields/month-multiple-fields-keyboard-events.html + + * html/MonthInputType.cpp: + (WebCore::MonthInputType::setupLayoutParameters): + Use Localizer::monthFormat. + + * html/shadow/DateTimeEditElement.cpp: + (WebCore::DateTimeEditBuilder::visitField): + - If the number of continuous field character is greater than 2, use + DateTimeSymbolicMonthFieldElement. + - Supports stand-alone month field. + + * html/shadow/DateTimeFieldElements.h: + (DateTimeSymbolicMonthFieldElement): Added. A subclass of DateTimeSymbolicFieldElement. + * html/shadow/DateTimeFieldElements.cpp: + (WebCore::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement): + Added. + (WebCore::DateTimeSymbolicMonthFieldElement::create): Added. + (WebCore::DateTimeSymbolicMonthFieldElement::populateDateTimeFieldsState): + We need to add 1 because the internal integer representation is 0-based + and DateTimeFieldsState uses 1-based month. + (WebCore::DateTimeSymbolicMonthFieldElement::setValueAsDate): + DateComponents::month is 0-based. + (WebCore::DateTimeSymbolicMonthFieldElement::setValueAsDateTimeFieldsState): + We need to subtract 1 because the internal integer representation is 0-based + and DateTimeFieldsState uses 1-based month. + + * html/shadow/DateTimeSymbolicFieldElement.h: + (WebCore::DateTimeSymbolicFieldElement::symbolsSize): + Added for DateTimeSymbolicMonthFieldElement::setValueAsDateTimeFieldsState. + +2012-10-19 Vsevolod Vlasov <vsevik@chromium.org> + + Web Inspector: inspector/styles/styles-history.html is failing Text on Windows and Linux + https://bugs.webkit.org/show_bug.cgi?id=99519 + + Reviewed by Alexander Pavlov. + + Extracted _styleContentSet callback in a class method to make it sniffable by tests. + + * inspector/front-end/StylesSourceMapping.js: + (WebInspector.StyleFile.prototype._commitIncrementalEdit): + (WebInspector.StyleFile.prototype._styleContentSet): + +2012-10-19 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: add object-src 'none' to the inspector.html + https://bugs.webkit.org/show_bug.cgi?id=99728 + + Reviewed by Vsevolod Vlasov. + + * inspector/front-end/inspector.html: + +2012-10-19 Vsevolod Vlasov <vsevik@chromium.org> + + Web Inspector: Get rid of isSnippetEvaluation flag on UISourceCode + https://bugs.webkit.org/show_bug.cgi?id=99823 + + Reviewed by Yury Semikhatsky. + + Replaced isSnippetEvaluation flag with a pair of isSnippet and isTemporary set. + + * inspector/front-end/ResourceScriptMapping.js: + (WebInspector.ResourceScriptMapping.prototype._getOrCreateTemporaryUISourceCode): + * inspector/front-end/ScriptSnippetModel.js: + (WebInspector.ScriptSnippetModel.prototype._releasedUISourceCodes): + (WebInspector.ScriptSnippetModel.prototype._createUISourceCodeForScript): + * inspector/front-end/ScriptsNavigator.js: + (WebInspector.ScriptsNavigator.prototype._snippetsNavigatorViewForUISourceCode): + (WebInspector.ScriptsNavigator.prototype.revealUISourceCode): + * inspector/front-end/ScriptsPanel.js: + (WebInspector.ScriptsPanel.prototype._createSourceFrame): + * inspector/front-end/Workspace.js: + (WebInspector.Project.prototype.addTemporaryUISourceCode): + +2012-10-19 Alexander Pavlov <apavlov@chromium.org> + + Web Inspector: Invalid Regex in SASSSourceMapping/didRequestContent, breaks Support for Sass experiment + https://bugs.webkit.org/show_bug.cgi?id=99729 + + Reviewed by Vsevolod Vlasov. + + Decode only the first line number digit written in a six-character escaped Unicode format. + + * inspector/front-end/SASSSourceMapping.js: + (WebInspector.SASSSourceMapping.prototype._resourceAdded.didRequestContent): + (WebInspector.SASSSourceMapping.prototype._resourceAdded): + +2012-10-19 Tommy Widenflycht <tommyw@google.com> + + MediaStream API: Update the RuntimeEnabledFeatures flags + https://bugs.webkit.org/show_bug.cgi?id=99714 + + Reviewed by Adam Barth. + + Updating the RuntimeEnabledFeatures flags to match reality: + isMediaStreamEnabled and isPeerConnectionEnabled should be true by default and + isDeprecatedPeerConnectionEnabled false. + + Patch covered by existing tests. + + * bindings/generic/RuntimeEnabledFeatures.cpp: + (WebCore): + +2012-10-19 Adam Barth <abarth@webkit.org> + + [V8] Simplify GCPrologueVisitor + https://bugs.webkit.org/show_bug.cgi?id=99819 + + Reviewed by Kentaro Hara. + + Previously, GCPrologueVisitor used a complicated traits-based template + design. That's not necessary. We can just implement it directly without + template magic. + + The one subtly here is that MessagePort is not actually a subclass of + ActiveDOMObject. The next stage of this cleanup is to make MessagePort + inherit from ActiveDOMObject and remove this special case entirely. + + * bindings/v8/V8GCController.cpp: + (WebCore::EnsureWeakDOMNodeVisitor::visitDOMWrapper): + (WebCore): + (WebCore::ActiveDOMObjectPrologueVisitor::visitDOMWrapper): + (WebCore::NodeVisitor::visitDOMWrapper): + (WebCore::V8GCController::gcPrologue): + +2012-10-19 Eugene Klyuchnikov <eustas.bug@gmail.com> + + Web Inspector: Saving HAR, snapshots and timeline data do not work in remote debugging mode + https://bugs.webkit.org/show_bug.cgi?id=99179 + + Reviewed by Yury Semikhatsky. + + Added method "close" to InspectorFrontendHost. + Symantically, this method forces to flush all unsaved buffers for + specified file. In native implementation this turns to be no-op. + + In stub implementation "close" causes compilation of blob object an + navigating to blob-schema url. + + Removed "canAppend", as appending in now suppurted + by all implementations. + + Repaced schema "data" with "blob" in InspectorFrontendHostStub "save" + to avoid out-of-memory errors. + + * inspector/InspectorFrontendHost.cpp: + (WebCore::InspectorFrontendHost::close): Compiles blob object and + navigates to blob-object url. + (WebCore): + * inspector/InspectorFrontendHost.h: Added "close" method. + * inspector/InspectorFrontendHost.idl: Ditto. + * inspector/front-end/FileManager.js: + (WebInspector.FileManager.prototype.close): Proxy to InspectorFrontend. + * inspector/front-end/FileUtils.js: + (WebInspector.FileOutputStream.prototype.close): + Invoke "close" on FileManager. + (WebInspector.FileOutputStream.prototype._onAppendDone): Ditto. + * inspector/front-end/HandlerRegistry.js: Added mandatory "close" call. + * inspector/front-end/HeapSnapshotView.js: + (WebInspector.HeapProfileHeader.prototype.canSaveToFile): Fixed check. + * inspector/front-end/InspectorFrontendHostStub.js: + (.WebInspector.InspectorFrontendHostStub): + Added "appendable" behaviour emulation. + * inspector/front-end/SourceFrame.js: Added mandatory "close" call. + * inspector/front-end/externs.js: Replaced "canAppend" with "close" + +2012-10-18 Dominic Mazzoni <dmazzoni@google.com> + + AX: labelForElement is slow when there are a lot of DOM elements + https://bugs.webkit.org/show_bug.cgi?id=97825 + + Reviewed by Ryosuke Niwa. + + Adds a DocumentOrderedMap to TreeScope that allows accessibility to + quickly map from an id to the label for that id. This speeds up + AccessibilityNode::labelForElement, which was a bottleneck in Chromium + when accessibility was on. + + Tests: accessibility/title-ui-element-correctness.html + perf/accessibility-title-ui-element.html + + * accessibility/AccessibilityNodeObject.cpp: + (WebCore::AccessibilityNodeObject::labelForElement): + * dom/DocumentOrderedMap.cpp: + (WebCore::keyMatchesLabelForAttribute): + (WebCore): + (WebCore::DocumentOrderedMap::get): + (WebCore::DocumentOrderedMap::getElementByLabelForAttribute): + * dom/DocumentOrderedMap.h: + (DocumentOrderedMap): + * dom/Element.cpp: + (WebCore::Element::insertedInto): + (WebCore::Element::removedFrom): + (WebCore::Element::updateLabel): + (WebCore): + (WebCore::Element::willModifyAttribute): + * dom/Element.h: + (Element): + * dom/TreeScope.cpp: + (WebCore::TreeScope::TreeScope): + (WebCore::TreeScope::destroyTreeScopeData): + (WebCore::TreeScope::addLabel): + (WebCore): + (WebCore::TreeScope::removeLabel): + (WebCore::TreeScope::labelElementForId): + * dom/TreeScope.h: + (WebCore): + (TreeScope): + (WebCore::TreeScope::shouldCacheLabelsByForAttribute): + +2012-10-19 Eugene Klyuchnikov <eustas.bug@gmail.com> + + Web Inspector: Update localizedStrings.js + https://bugs.webkit.org/show_bug.cgi?id=99701 + + Reviewed by Yury Semikhatsky. + + Fixed most of missing strings and orphans. + + * English.lproj/localizedStrings.js: + * inspector/front-end/SettingsScreen.js: + +2012-10-17 Ilya Tikhonovsky <loislo@chromium.org> + + Web Inspector: NMI provide data for mixing with tcmalloc heap dumps. + https://bugs.webkit.org/show_bug.cgi?id=99457 + + Reviewed by Yury Semikhatsky. + + countObjectSize now accepts ptr as the first argument and saves it into HashMap if the binary was ran with HEAPPROFILE env variable. + getProcessMemoryDistribution does snapshot and calls the downstream code with the map of counted objects. + + * inspector/InspectorClient.h: + (WebCore::InspectorClient::dumpUncountedAllocatedObjects): + * inspector/InspectorMemoryAgent.cpp: + (WebCore::reportJSHeapInfo): + (WebCore::reportRenderTreeInfo): + (WebCore): + (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution): + * inspector/MemoryInstrumentationImpl.cpp: + (WebCore::MemoryInstrumentationClientImpl::countObjectSize): + (WebCore::MemoryInstrumentationClientImpl::reportMemoryUsage): + * inspector/MemoryInstrumentationImpl.h: + (MemoryInstrumentationClientImpl): + (WebCore::MemoryInstrumentationClientImpl::countedObjects): + +2012-10-19 Adam Barth <abarth@webkit.org> + + [V8] DOMObjectVisitor does nothing + https://bugs.webkit.org/show_bug.cgi?id=99812 + + Reviewed by Kentaro Hara. + + This code doesn't do anything, even in Debug! We should just remove it. + + * bindings/v8/V8GCController.cpp: + (WebCore): + (WebCore::V8GCController::gcPrologue): + (WebCore::V8GCController::gcEpilogue): + +2012-10-19 Adam Barth <abarth@webkit.org> + + [V8] Remove unused typedef from V8GCController.cpp + https://bugs.webkit.org/show_bug.cgi?id=99808 + + Reviewed by Kentaro Hara. + + This typedef is not used. + + * bindings/v8/V8GCController.cpp: + +2012-10-18 Alexander Pavlov <apavlov@chromium.org> + + Web Inspector: [Styles] Property considered overridden if it is non-inherited important property in inherited style + https://bugs.webkit.org/show_bug.cgi?id=99720 + + Reviewed by Yury Semikhatsky. + + Non-inherited properties are now disregarded in inherited styles. + + * inspector/front-end/StylesSidebarPane.js: + (WebInspector.StylesSidebarPane.prototype._refreshStyleRules): + (WebInspector.StylesSidebarPane.prototype._markUsedProperties): + +2012-10-18 Adam Barth <abarth@webkit.org> + + [V8] GrouperVisitor is secretly two entirely separate objects + https://bugs.webkit.org/show_bug.cgi?id=99810 + + Reviewed by Kentaro Hara. + + We can separate out the two things that GrouperVisitor is trying to do + because they have nothing to do with each other. + + * bindings/v8/V8GCController.cpp: + (ObjectVisitor): + (WebCore::ObjectVisitor::visitDOMWrapper): + (WebCore): + (WebCore::V8GCController::gcPrologue): + +2012-10-18 Kiran Muppala <cmuppala@apple.com> + + Automatically start plugins created within a user gesture, skipping snapshotting + https://bugs.webkit.org/show_bug.cgi?id=99778 + + Reviewed by Alexey Proskuryakov. + + If a user gesture is being processed, do not set the display state of + HTMLPluginImageElement to WaitingForSnapshot. + + No new tests, since it only affects when plugins switch from snapshot to running + state. Does not affect rendering of other elements. + + * html/HTMLPlugInImageElement.cpp: + (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): + +2012-10-18 Kent Tamura <tkent@chromium.org> + + Add shortMonthLabels and shortStandAloneMonthLabels to Localizer + https://bugs.webkit.org/show_bug.cgi?id=99787 + + Reviewed by Kentaro Hara. + + This is going to be used for input[type=month] UI. This doesn't affect + any bahevior yet. + + Tests: Add some tests to Source/WebKit/chromium/tests/, and will add + layout tests later. + + * platform/text/Localizer.h: + (Localizer): Add shortMonthLabels and shortStandAloneMonthLabels as pure + virtual member functions. + + * platform/text/LocaleICU.h: + (LocaleICU): Declare shortMonthLabels and shortStandAloneMonthLabels. + * platform/text/LocaleICU.cpp: + (WebCore::LocaleICU::shortMonthLabels): Added. + (WebCore::LocaleICU::shortStandAloneMonthLabels): Added. + + * platform/text/LocaleNone.cpp: + (LocaleNone): Declare shortMonthLabels and shortStandAloneMonthLabels. + (WebCore::LocaleNone::shortMonthLabels): + Added. Always returns English labels. + (WebCore::LocaleNone::shortStandAloneMonthLabels): + Addes. Just calls shortMonthLabels. + + * platform/text/LocaleWin.h: + (LocaleWin): Declare shortMonthLabels and shortStandAloneMonthLabels. + * platform/text/LocaleWin.cpp: + (WebCore::LocaleWin::shortMonthLabels): Added. + (WebCore::LocaleWin::shortStandAloneMonthLabels): + Added. Always returns shortMonthLabels. + + * platform/text/mac/LocaleMac.h: + (LocaleMac): Declare shortMonthLabels and shortStandAloneMonthLabels. + * platform/text/mac/LocaleMac.mm: + (WebCore::LocaleMac::shortMonthLabels): Added. + (WebCore::LocaleMac::shortStandAloneMonthLabels): Added. + +2012-10-18 Kunihiko Sakamoto <ksakamoto@chromium.org> + + Implement value sanitization algorithm for type=datetime + https://bugs.webkit.org/show_bug.cgi?id=76893 + + Reviewed by Kent Tamura. + + Implement the value sanitization algorithm for type=datetime that adjusts + the value to a valid normalized forced-UTC global date and time string. + See http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#valid-normalized-forced-utc-global-date-and-time-string + + Test: fast/forms/datetime/datetime-value-sanitization.html + + * html/DateTimeInputType.cpp: + (WebCore::DateTimeInputType::sanitizeValue): Implemented. + (WebCore): + * html/DateTimeInputType.h: + (DateTimeInputType): Add sanitizeValue. + * platform/DateComponents.cpp: + (WebCore::DateComponents::addMinute): Fixed a bug that caused wrong adjustment + of timezone offset (e.g. 2012-10-17T01:00+01:00 -> 2012-10-17T01:-60Z). + +2012-10-18 Byungwoo Lee <bw80.lee@samsung.com> + + Fix build warning. + https://bugs.webkit.org/show_bug.cgi?id=99788 + + Reviewed by Kentaro Hara. + + Use UNUSED_PARAM macro for removing -Wunused-parameter. + + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::currentTransform): + +2012-10-18 Benjamin Poulain <bpoulain@apple.com> + + [WK2] WebKit2 does not build without PLUGIN_PROCESS on Mac + https://bugs.webkit.org/show_bug.cgi?id=99771 + + Reviewed by Anders Carlsson. + + * WebCore.exp.in: The symbol is used by WebCore Test Support, move it + to the general section. + +2012-10-18 Adam Barth <abarth@webkit.org> + + [V8] fast/dom/gc-9.html fails for document.styleSheets + https://bugs.webkit.org/show_bug.cgi?id=99786 + + Reviewed by Kentaro Hara. + + V8 needs to know about this IDL attribute as well. + + * css/StyleSheetList.idl: + +2012-10-18 Adam Barth <abarth@webkit.org> + + [V8] fast/dom/gc-9.html fails for document.implementation + https://bugs.webkit.org/show_bug.cgi?id=99783 + + Reviewed by Kentaro Hara. + + In order to correctly manage the lifetime of document.implementation, + we need to implement GenerateIsReachable=ImplDocument. + + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateVisitDOMWrapper): + * bindings/scripts/IDLAttributes.txt: + * dom/DOMImplementation.idl: + +2012-10-18 Chris Fleizach <cfleizach@apple.com> + + AX: Crashes in WebProcess at com.apple.WebCore: -[AccessibilityObjectWrapper remoteAccessibilityParentObject] + 78 + https://bugs.webkit.org/show_bug.cgi?id=96443 + + Reviewed by Beth Dakin. + + Separate out the chain of calls so that the number of times document() is called is reduced and it will be easier + to determine which line this crash is happening on. + + * accessibility/mac/WebAccessibilityObjectWrapper.mm: + (-[WebAccessibilityObjectWrapper remoteAccessibilityParentObject]): + +2012-10-18 Alec Flett <alecflett@chromium.org> + + IndexedDB: Refactor IDBDatabaseBackendImpl to use IDBDatabaseMetadata + https://bugs.webkit.org/show_bug.cgi?id=99773 + + Reviewed by Tony Chang. + + Refactor to begin separating out metadata from stateful backend objects, + in preparation for https://bugs.webkit.org/show_bug.cgi?id=99774. + + Also includes some #include dependency cleanup so that the backing store + depends less on the stateful backend objects. + + No new tests as this is purely a refactor. + + * Modules/indexeddb/IDBBackingStore.h: + (WebCore): + (IDBBackingStore): + * Modules/indexeddb/IDBCursor.h: + * Modules/indexeddb/IDBCursorBackendImpl.h: + (WebCore): + * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: + (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl): + (WebCore::IDBDatabaseBackendImpl::openInternal): + (WebCore::IDBDatabaseBackendImpl::metadata): + (WebCore::IDBDatabaseBackendImpl::createObjectStore): + (WebCore::IDBDatabaseBackendImpl::setVersion): + (WebCore::IDBDatabaseBackendImpl::setVersionInternal): + (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal): + (WebCore::IDBDatabaseBackendImpl::processPendingCalls): + (WebCore::IDBDatabaseBackendImpl::openConnection): + (WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction): + (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion): + (WebCore::IDBDatabaseBackendImpl::deleteDatabase): + (WebCore::IDBDatabaseBackendImpl::loadObjectStores): + (WebCore::IDBDatabaseBackendImpl::resetVersion): + * Modules/indexeddb/IDBDatabaseBackendImpl.h: + (WebCore::IDBDatabaseBackendImpl::id): + (IDBDatabaseBackendImpl): + * Modules/indexeddb/IDBLevelDBBackingStore.cpp: + (WebCore::IDBLevelDBBackingStore::getIDBDatabaseMetaData): + (WebCore::IDBLevelDBBackingStore::deleteDatabase): + * Modules/indexeddb/IDBLevelDBBackingStore.h: + (IDBLevelDBBackingStore): + * Modules/indexeddb/IDBObjectStoreBackendInterface.h: + * Modules/indexeddb/IDBTransaction.h: + (WebCore): + +2012-10-18 Peter Kasting <pkasting@google.com> + + [Skia] Set m_hasAlpha correctly in ImageFrame::copyBitmapData. + https://bugs.webkit.org/show_bug.cgi?id=99781 + + Reviewed by Adam Barth. + + No tests, since the actual effects of this bug are fickle and it's not + clear how to extract and check particular subframes of an animated GIF. + + * platform/image-decoders/skia/ImageDecoderSkia.cpp: + (WebCore::ImageFrame::copyBitmapData): + +2012-10-18 Pan Deng <pan.deng@intel.com> + + [Resource Timing]Implementation of resource timing buffer size restriction functionality + https://bugs.webkit.org/show_bug.cgi?id=84885. + + Reviewed by Tony Gentilcore. + + http://www.w3.org/TR/2012/CR-resource-timing-20120522/ + This patch enable functionality of set buffer size(default is 150 as spec). When buffer is full, resourceTimingBufferFull event will be fired. Incoming entries will be dropped if no more space for them. + + Tests: http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_full_when_populate_entries.html + http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_full_when_shrink_buffer_size.html + http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_buffer_size_restriction.html + http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_clear_resource_timing_functionality.html + http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_on_shrink_buffer_size.html + http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_store_and_clear_during_callback.html + + * page/Performance.cpp: + (WebCore): + (WebCore::Performance::Performance): + (WebCore::Performance::webkitSetResourceTimingBufferSize): + (WebCore::Performance::addResourceTiming): + (WebCore::Performance::isResourceTimingBufferFull): + * page/Performance.h: + (Performance): + +2012-10-18 Ryosuke Niwa <rniwa@webkit.org> + + REGRESSION(r130411): Copying & pasting the first line of text can move caret to the end of text area + https://bugs.webkit.org/show_bug.cgi?id=99663 + + Reviewed by Enrica Casucci and Levi Weintraub. + + The bug was caused by positionOnlyToBeUpdated's offset not being shifted correctly in + ReplaceSelectionCommand::mergeTextNodesAroundPosition. Suppose we have text nodes t1 and t2 and + positionOnlyToBeUpdated had offset k in t2. When t2 is merged into t1, positionOnlyToBeUpdated should be + moved to (t1, n + k) where n is the ORIGINAL length of t1 before t2 is merged. But we were using + the length after t2 is merged. + + Fixed the bug by saving the original length of t1 and using that in the offset adjustment. + Also use the right offset. + + Test: editing/pasteboard/copy-paste-first-line-in-textarea.html + + * editing/ReplaceSelectionCommand.cpp: + (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition): + +2012-10-18 Claudio Saavedra <csaavedra@igalia.com> + + [GTK] Invalid read from WebKit::DOMObjectCache::clearByFrame + https://bugs.webkit.org/show_bug.cgi?id=82882 + + Reviewed by Xan Lopez. + + Based on a patch by Milan Crha <mcrha@redhat.com> + + Prevent an invalid access to a pointer while clearing the DOM + object cache. + * bindings/gobject/DOMObjectCache.cpp: + (WebKit::DOMObjectCache::clearByFrame): Prevent an invalid access. + +2012-10-18 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r131810. + http://trac.webkit.org/changeset/131810 + https://bugs.webkit.org/show_bug.cgi?id=99762 + + Broke linux debug webkit_unit_tests (Requested by + danakj|gardening on #webkit). + + * WebCore.gypi: + * platform/graphics/ImageSource.cpp: + (WebCore::ImageSource::setData): + * platform/graphics/ImageSource.h: + (WebCore): + (ImageSource): + * platform/graphics/chromium/DeferredImageDecoder.cpp: Removed. + * platform/graphics/chromium/DeferredImageDecoder.h: Removed. + * platform/graphics/chromium/ImageDecodingStore.cpp: Removed. + * platform/graphics/chromium/ImageDecodingStore.h: Removed. + * platform/graphics/chromium/ImageFrameGenerator.cpp: Removed. + * platform/graphics/chromium/ImageFrameGenerator.h: Removed. + * platform/graphics/chromium/LazyDecodingPixelRef.cpp: Removed. + * platform/graphics/chromium/LazyDecodingPixelRef.h: Removed. + * platform/graphics/chromium/ScaledImageFragment.cpp: Removed. + * platform/graphics/chromium/ScaledImageFragment.h: Removed. + * platform/graphics/skia/NativeImageSkia.cpp: + (WebCore::NativeImageSkia::resizedBitmap): + * platform/image-decoders/ImageDecoder.h: + (ImageFrame): + +2012-10-18 Tommy Widenflycht <tommyw@google.com> + + MediaStream API: Do some cleanup in the chromium WebKit API + https://bugs.webkit.org/show_bug.cgi?id=99713 + + Reviewed by Adam Barth. + + Removing the deprecated version of WebMediaStreamDescriptor::initialize. + + No testing needed since only an unused function is removed. + + * platform/chromium/support/WebMediaStreamDescriptor.cpp: + +2012-10-18 Alpha Lam <hclam@chromium.org> + + [chromium] Implement deferred image decoding + https://bugs.webkit.org/show_bug.cgi?id=94240 + + Reviewed by Stephen White. + + Objectives: + + To record image decoding operations during painting and to defer + decoding operations until rasterization. + + Rationale: + + This is a key feature that enables impl-side painting which requires + fast recording of drawing operations. The existing decode-on-draw + restricts that recording has to block on expensive decoding operations. + This change allows recording of image decoding operations during paint + time. + + Design: + + Image decoding happens when a BitmapImage is drawn into a + GraphicsContext. When per-tile painting is enabled GraphicsContext + is backed by SkCanvas in recording mode. This SkCanvas records drawing + and image decoding operations to minimize recording time. + + An image decoding operation is recorded as a SkPixelRef object + implemented by LazyDecodingPixelRef. This object references raw encoded + data, regions to be decoded and scaling information. + + When used in conjunction with per-tile painting this feature defers + image decoding until the SkCanvas referencing the image is rasterized. + + Both recording and rasterization happen on the main thread. + + Performance Impact: + + This feature is enabled by WebKit::setDeferredImageDecodingEnabled() + and does not have an impact when disabled. + + This feature is disabled by default. + + Upcoming Changes: + + 1. Implement a full-featured image cache in ImageDecodingStore. + 2. Allow rasterization and decoding on impl thread. + + Classes Involved: + + BitmapImage + + BitmapImage is the entry point for deferred image decoding. When + drawing a BitmapImage into a GraphicsContext it makes a request to + create a NativeImageSkia. We substitute the content in NativeImageSkia + such that it is lazily decoded. + + DeferredImageDecoder + + This is the platform implementation of a image decoder for Chromium. + This is a bridge layer that either delegates calls to the actual + ImageDecoder or create a lazily-decoded SkBitmap and delegates calls + to ImageDecodingStore. + + ImageDecodingStore + + This object manages all encoded images. It keeps track of encoded + data and the corresponding ImageDecoder for doing actual decoding. It + is also responsible for generating lazily decoded SkBitmaps. This + SkBitmap contains a LazyDecodingPixelRef object which references to an + image entry in ImageDecodingStore. + + ScaledImageFragment + + A container for a scaled image fragment. In addition to bitmap pixels + it contains information about the ID of the image, scale and clipping. + + ImageFrameGenerator + + This object is responsible for generating decoded pixels. It is also + a container for encoded image data and corresponding image decoder. + + LazyDecodingPixelRef + + This object is embedded in a SkBitmap to enable lazy decoding. When + SkBitmap needs to access pixels LazyDecodingPixelRef is locked. It + contains information to locate an image and scaling info, these + information is submitted to ImageDecodingStore to access actual pixels. + + Layout tests. There are about 80 tests in this virtual test suite + running this feature in this directory: + + platform/chromium/virtual/deferred/fast/images + + Unit tests. Added DeferredImageDecoderTest to verify deferred + image decoding behavior. + + * WebCore.gypi: + * platform/graphics/ImageSource.cpp: + (WebCore::ImageSource::setData): + * platform/graphics/ImageSource.h: + (WebCore): + (ImageSource): + * platform/graphics/chromium/DeferredImageDecoder.cpp: Added. + (WebCore): + (WebCore::DeferredImageDecoder::DeferredImageDecoder): + (WebCore::DeferredImageDecoder::~DeferredImageDecoder): + (WebCore::DeferredImageDecoder::create): + (WebCore::DeferredImageDecoder::createForTesting): + (WebCore::DeferredImageDecoder::filenameExtension): + (WebCore::DeferredImageDecoder::frameBufferAtIndex): + (WebCore::DeferredImageDecoder::setData): + (WebCore::DeferredImageDecoder::isSizeAvailable): + (WebCore::DeferredImageDecoder::size): + (WebCore::DeferredImageDecoder::frameSizeAtIndex): + (WebCore::DeferredImageDecoder::frameCount): + (WebCore::DeferredImageDecoder::repetitionCount): + (WebCore::DeferredImageDecoder::clearFrameBufferCache): + (WebCore::DeferredImageDecoder::frameHasAlphaAtIndex): + (WebCore::DeferredImageDecoder::frameBytesAtIndex): + * platform/graphics/chromium/DeferredImageDecoder.h: Added. + (WebCore): + (DeferredImageDecoder): + * platform/graphics/chromium/ImageDecodingStore.cpp: Added. + (WebCore::ImageDecodingStore::ImageDecodingStore): + (WebCore): + (WebCore::ImageDecodingStore::~ImageDecodingStore): + (WebCore::ImageDecodingStore::instanceOnMainThread): + (WebCore::ImageDecodingStore::initializeOnMainThread): + (WebCore::ImageDecodingStore::shutdown): + (WebCore::ImageDecodingStore::isLazyDecoded): + (WebCore::ImageDecodingStore::createLazyDecodedSkBitmap): + (WebCore::ImageDecodingStore::resizeLazyDecodedSkBitmap): + (WebCore::ImageDecodingStore::setData): + (WebCore::ImageDecodingStore::lockPixels): + (WebCore::ImageDecodingStore::unlockPixels): + (WebCore::ImageDecodingStore::frameGeneratorBeingDestroyed): + (WebCore::ImageDecodingStore::calledOnValidThread): + (WebCore::ImageDecodingStore::lookupFrameCache): + (WebCore::ImageDecodingStore::deleteFrameCache): + * platform/graphics/chromium/ImageDecodingStore.h: Added. + (WebCore): + (ImageDecodingStore): + (WebCore::ImageDecodingStore::create): + * platform/graphics/chromium/ScaledImageFragment.cpp: Added. + (WebCore): + (WebCore::ScaledImageFragment::~ScaledImageFragment): + (WebCore::ScaledImageFragment::ScaledImageFragment): + (WebCore::ScaledImageFragment::isEqual): + * platform/graphics/chromium/ScaledImageFragment.h: Added. + (WebCore): + (ScaledImageFragment): + (WebCore::ScaledImageFragment::create): + (WebCore::ScaledImageFragment::bitmap): + (WebCore::ScaledImageFragment::isComplete): + * platform/graphics/chromium/ImageFrameGenerator.cpp: Added. + (WebCore): + (WebCore::ImageFrameGenerator::ImageFrameGenerator): + (WebCore::ImageFrameGenerator::~ImageFrameGenerator): + (WebCore::ImageFrameGenerator::decoder): + (WebCore::ImageFrameGenerator::setData): + * platform/graphics/chromium/ImageFrameGenerator.h: Added. + (WebCore): + (ImageFrameGenerator): + (WebCore::ImageFrameGenerator::create): + (WebCore::ImageFrameGenerator::size): + (WebCore::ImageFrameGenerator::imageId): + * platform/graphics/chromium/LazyDecodingPixelRef.cpp: Added. + (WebCore): + (WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef): + (WebCore::LazyDecodingPixelRef::~LazyDecodingPixelRef): + (WebCore::LazyDecodingPixelRef::isScaled): + (WebCore::LazyDecodingPixelRef::isClipped): + (WebCore::LazyDecodingPixelRef::onLockPixels): + (WebCore::LazyDecodingPixelRef::onUnlockPixels): + (WebCore::LazyDecodingPixelRef::onLockPixelsAreWritable): + * platform/graphics/chromium/LazyDecodingPixelRef.h: Added. + (WebCore): + (LazyDecodingPixelRef): + (WebCore::LazyDecodingPixelRef::frameGenerator): + * platform/graphics/skia/NativeImageSkia.cpp: + (WebCore::NativeImageSkia::resizedBitmap): + * platform/image-decoders/ImageDecoder.h: + (ImageFrame): + (WebCore::ImageFrame::setSkBitmap): + (WebCore::ImageFrame::getSkBitmap): + +2012-10-18 Yael Aharon <yael.aharon@intel.com> + + [EFL] GraphicsContext3D::m_renderStyle is not initialized + https://bugs.webkit.org/show_bug.cgi?id=99721 + + Reviewed by Antonio Gomes. + + Initialize GraphicsContext3D::m_renderStyle. + + No new tests, no new functionality. + + * platform/graphics/efl/GraphicsContext3DEfl.cpp: + (WebCore::GraphicsContext3D::GraphicsContext3D): + +2012-10-18 Max Vujovic <mvujovic@adobe.com> + + [CSS Shaders] Validate types of built-in vertex attributes + https://bugs.webkit.org/show_bug.cgi?id=98972 + + Reviewed by Dean Jackson. + + Reject custom filters in which the author defined built-in attributes with the wrong type. + For example, the GLSL declaration "attribute float a_position" is incorrect because + a_position should be a vec4, not a float. + + Test: css3/filters/custom/invalid-custom-filter-attribute-types.html + + * platform/graphics/ANGLEWebKitBridge.h: + (WebCore::ANGLEShaderSymbol::isSampler): + Add const qualifier to isSampler method. + * platform/graphics/filters/CustomFilterValidatedProgram.cpp: + (WebCore): + (WebCore::builtInAttributeNameToTypeMap): + New file static function. Returns a map of the CSS Custom Filters built-in attribute + names and their expected types. + (WebCore::validateSymbols): + New file static function. Loop through all of the symbols. Reject the shader if we find + a built-in attribute defined with the wrong type. + (WebCore::CustomFilterValidatedProgram::CustomFilterValidatedProgram): + Call the new validateSymbols function. If it returns false, exit the constructor early, + which rejects the program. + Move the loop that checks if any uniform is a sampler into the the validateSymbols + function. + +2012-10-18 Mike Reed <reed@google.com> + + Handle if we fail to allocate nonPlatformCanvas in ImageBuffer constructor + https://bugs.webkit.org/show_bug.cgi?id=99752 + + Reviewed by Stephen White. + + Current code does not check if we were able to allocate the pixels, but still returns the canvas. + However, the caller explicitly is checking for null on failure, so it will continue (and possibly + crash later on). + This change brings the nonPlatformCanvas behavior inline with createAcceleratedCanvas and + TryCreateBitmapCanvas, both of which are also called by ImageBuffer's constructor. + + No new tests. Existing tests exercise ImageBuffer constructor. + + * platform/graphics/skia/ImageBufferSkia.cpp: + (WebCore::createNonPlatformCanvas): + +2012-10-18 Beth Dakin <bdakin@apple.com> + + https://bugs.webkit.org/show_bug.cgi?id=99668 + REGRESSION: Crash in + WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion + -and corresponding- + <rdar://problem/12491901> + + Reviewed by Simon Fraser. + + http://trac.webkit.org/changeset/130783 changed the lifetime of the + ScrollingStateTree's rootStateNode. Before that patch, the root state + node was never destroyed. It was just constantly re-used for + different RenderLayerBackings. This crash is just one of a few bugs + that has occurred because of that change. I have fixed the other bugs + individually, but I think that long-term, it is the safest solution + to go back to the original ownership model. + + So this patch ensures that the state tree will always have a root + state node. Instead of destroying and re-creating the root node when + it's scroll ID changes, we just update the ID. + + attachToStateTree() now takes an additional ID representing the ID of + the parent node. + * page/scrolling/ScrollingCoordinator.h: + (WebCore::ScrollingCoordinator::attachToStateTree): + + Add a way to set the scrolling node ID. + * page/scrolling/ScrollingStateNode.h: + (WebCore::ScrollingStateNode::setScrollingNodeID): + + This code that provided a way to mark all properties as having + changed was added in http://trac.webkit.org/changeset/130989 as a way + to ensure we would re-set ScrollingThread's nodes when we destroyed + and re-created the rootStateNode. Now that we are no longer + destroying and re-creating the rootStateNode, this code is no longer + necessary. + * page/scrolling/ScrollingStateScrollingNode.cpp: + * page/scrolling/ScrollingStateScrollingNode.h: + + create m_rootStateNode right in the ScrollingStateTree's constructor. + * page/scrolling/ScrollingStateTree.cpp: + (WebCore::ScrollingStateTree::ScrollingStateTree): + + Don't let removeNode() destroy m_rootStateNode. + (WebCore::ScrollingStateTree::removeNode): + + Also a part of r130989 that is no longer needed. + (WebCore::ScrollingStateTree::rootLayerDidChange(): + * page/scrolling/ScrollingStateTree.h: + (WebCore::ScrollingStateTree::rootStateNode): + (ScrollingStateTree): + (WebCore::ScrollingStateTree::setRootStateNode): + + attachToStateTree() now takes an additional ID representing the ID of + the parent node. + * page/scrolling/mac/ScrollingCoordinatorMac.h: + (ScrollingCoordinatorMac): + + We no longer need ScrollingStateTree::rootLayerDidChange() + * page/scrolling/mac/ScrollingCoordinatorMac.mm: + (WebCore::ScrollingCoordinatorMac::frameViewRootLayerDidChange): + + Do not destroy and re-create the state node. Just update its ID. When + we support child nodes soon, we will create them in this function. + (WebCore::ScrollingCoordinatorMac::attachToStateTree): + + No need to null-check the rootStateNode. + (WebCore::ScrollingCoordinatorMac::clearStateTree): + + Send 0 as the parent node ID to attachToStateTree() to represent the + root node. + (WebCore::ScrollingCoordinatorMac::ensureRootStateNodeForFrameView): + * rendering/RenderLayerBacking.cpp: + + RenderLayerBacking::attachToScrollingCoordinator() now takes a parent + layer. + (WebCore::RenderLayerBacking::attachToScrollingCoordinator): + * rendering/RenderLayerBacking.h: + (RenderLayerBacking): + + Since this is the root, send 0 to represent the parent layer. + * rendering/RenderLayerCompositor.cpp: + (WebCore::RenderLayerCompositor::updateBacking): + +2012-10-18 Yael Aharon <yael.aharon@intel.com> + + [EFL] GraphicsContext3D::m_renderStyle is not initialized + https://bugs.webkit.org/show_bug.cgi?id=99721 + + Reviewed by Antonio Gomes. + + Initialize GraphicsContext3D::m_renderStyle. + + No new tests, no new functionality. + + * platform/graphics/efl/GraphicsContext3DEfl.cpp: + (WebCore::GraphicsContext3D::GraphicsContext3D): + +2012-10-18 Brian White <bcwhite@chromium.org> + + WebKit Doesn't Recognize Content-Language HTTP Header + https://bugs.webkit.org/show_bug.cgi?id=97929 + + Reviewed by Alexey Proskuryakov. + + The HTTP "Content-Language" header may be present and include the + language of the page contents (as opposed to an embedded meta tag). + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::didBeginDocument): + +2012-10-18 Jer Noble <jer.noble@apple.com> + + Crash in WebCore::Document::webkitExitFullscreen + 618 + https://bugs.webkit.org/show_bug.cgi?id=99496 + + Reviewed by Eric Carlson. + + Prospective fix for null-dereference crash in Document::webkitExitFullscreen(). + + * dom/Document.cpp: + (WebCore::Document::webkitExitFullscreen): Null check page() before calling page()->chrome. + +2012-10-18 Pablo Flouret <pablof@motorola.com> + + Implement css3-conditional's @supports rule + https://bugs.webkit.org/show_bug.cgi?id=86146 + + Reviewed by Antti Koivisto. + + The "@supports" rule is a conditional group rule whose condition tests + whether the user agent supports CSS property:value pairs. + + http://dev.w3.org/csswg/css3-conditional/#at-supports + + Test: css3/supports.html + + * Configurations/FeatureDefines.xcconfig: + * GNUmakefile.am: + * GNUmakefile.features.am: + Add an ENABLE_CSS3_CONDITIONAL_RULES flag. + + * css/CSSGrammar.y.in: + * css/CSSParser.cpp: + (WebCore): + (WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens. + (WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected. + (WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode. + * css/CSSParser.h: Added new SupportsMode parsing mode. + (CSSParser): + +2012-10-18 Marja Hölttä <marja@chromium.org> + + Fix: CachedResourceLoader::requestSVGDocument was passing an URL as charset + https://bugs.webkit.org/show_bug.cgi?id=99730 + + Reviewed by Jochen Eisinger. + + * loader/cache/CachedResourceLoader.cpp: + (WebCore::CachedResourceLoader::requestSVGDocument): + +2012-10-18 Jer Noble <jer.noble@apple.com> + + Fullscreen movie controls behave incorrectly when clicked (and dragged) + https://bugs.webkit.org/show_bug.cgi?id=99610 + + Reviewed by Eric Carlson. + + Do not reset the relative drag position to 0,0 at the beginning of every drag. Instead, + store the cumulative drag offset and accumulate during each additional drag. + + No new tests; modified the fullscreen/video-controls-drag.html test. + + * html/shadow/MediaControlElements.cpp: + (WebCore::MediaControlPanelElement::startDrag): Reset m_lastDragEventLocation. + (WebCore::MediaControlPanelElement::continueDrag): Accumulate drag distance in m_cumulativeDragOffset. + (WebCore::MediaControlPanelElement::resetPosition): Reset m_cumulativeDragOffset. + * html/shadow/MediaControlElements.h: + +2012-10-18 Brandon Jones <bajones@google.com> + + Implement OES_element_index_uint / WEBKIT_OES_element_index_uint + https://bugs.webkit.org/show_bug.cgi?id=97400 + + Reviewed by Kenneth Russell. + + Implemented OES_element_index_uint WebGL extension + + Test: fast/canvas/webgl/oes-element-index-uint.html + + * CMakeLists.txt: + * DerivedSources.make: + * DerivedSources.pri: + * GNUmakefile.list.am: + * Target.pri: + * WebCore.gypi: + * WebCore.xcodeproj/project.pbxproj: + * bindings/js/JSWebGLRenderingContextCustom.cpp: + (WebCore::toJS): + * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: + (WebCore::toV8Object): + * html/canvas/OESElementIndexUint.cpp: Copied from Source/WebCore/html/canvas/WebGLExtension.h. + (WebCore): + (WebCore::OESElementIndexUint::OESElementIndexUint): + (WebCore::OESElementIndexUint::~OESElementIndexUint): + (WebCore::OESElementIndexUint::getName): + (WebCore::OESElementIndexUint::create): + * html/canvas/OESElementIndexUint.h: Copied from Source/WebCore/html/canvas/WebGLExtension.h. + (WebCore): + (OESElementIndexUint): + * html/canvas/OESElementIndexUint.idl: Copied from Source/WebCore/html/canvas/WebGLExtension.h. + * html/canvas/WebGLExtension.h: + * html/canvas/WebGLRenderingContext.cpp: + (WebCore): + (WebCore::WebGLRenderingContext::validateElementArraySize): + (WebCore::WebGLRenderingContext::validateIndexArrayConservative): + (WebCore::WebGLRenderingContext::validateIndexArrayPrecise): + (WebCore::WebGLRenderingContext::validateRenderingState): + (WebCore::WebGLRenderingContext::drawElements): + (WebCore::WebGLRenderingContext::getExtension): + (WebCore::WebGLRenderingContext::getSupportedExtensions): + * html/canvas/WebGLRenderingContext.h: + (WebCore): + (WebGLRenderingContext): + * platform/graphics/Extensions3D.h: + (Extensions3D): + * platform/graphics/opengl/Extensions3DOpenGL.cpp: + (WebCore::Extensions3DOpenGL::supportsExtension): + +2012-10-18 Jer Noble <jer.noble@apple.com> + + Add diagnostic logging to track per-page media engine usage. + https://bugs.webkit.org/show_bug.cgi?id=99615 + <rdar://problem/12476473> + + Reviewed by Eric Carlson. + + Add diagnostic logging triggered only once-per-page and once-per-page-per-engine. + + * html/HTMLMediaElement.cpp: + (WebCore::logMediaLoadRequest): Encapsulate diagnostic logging into single static method. + (WebCore::HTMLMediaElement::mediaLoadingFailed): Call logMediaLoadRequest. + (WebCore::HTMLMediaElement::setReadyState): Ditto. + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::dispatchDidCommitLoad): Reset the set of seen media engines. + + Add new methods to Page to track per-page media engine diagnostic info, similar to plugin diagnostic info. + * page/Page.cpp: + (WebCore::Page::hasSeenAnyMediaEngine): + (WebCore::Page::hasSeenMediaEngine): + (WebCore::Page::sawMediaEngine): + (WebCore::Page::resetSeenMediaEngines): + * page/Page.h: + + Add new static logging key definitions: + * page/DiagnosticLoggingKeys.cpp: + (WebCore::DiagnosticLoggingKeys::pageContainsMediaEngineKey): + (WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey): + * page/DiagnosticLoggingKeys.h: + +2012-10-18 Michael Saboff <msaboff@apple.com> + + Add 8-bit path to RenderBlock::handleTrailingSpaces() + https://bugs.webkit.org/show_bug.cgi?id=99731 + + Reviewed by Dan Bernstein. + + Factored out and added findFirstTrailingSpace() templated helper function that is called with the + approriate character pointer type. + + No tests needed, change covered by existing tests. + + * rendering/RenderBlockLineLayout.cpp: + (WebCore::findFirstTrailingSpace): + (WebCore::RenderBlock::handleTrailingSpaces): + +2012-10-18 Hans Muller <hmuller@adobe.com> + + [CSS Exclusions] Add ExclusionShape::shapeBoundingBox() method + https://bugs.webkit.org/show_bug.cgi?id=99216 + + Reviewed by Dirk Schulze. + + Added a FloatRect::extend() method which simplifies writing loops that + accumulate the bounding box for a sequence of FloatPoints. The new method + is used by ExclusionPolygon to initialize the shape's logical and physical + bounding boxes. This a clean-up, not a change in functionality. It's already + covered by the existing fast/exclusions LayoutTests. + + * platform/graphics/FloatRect.cpp: + (WebCore::FloatRect::extend): Extend the FloatRect's bounds to include a FloatPoint. + (WebCore): + * platform/graphics/FloatRect.h: + (FloatRect): Added extend() method. + * rendering/ExclusionPolygon.cpp: + (WebCore::ExclusionPolygon::ExclusionPolygon): Use FloatRect::extend() to compute the polygon's internal bounding box. + * rendering/ExclusionShape.cpp: + (WebCore::ExclusionShape::createExclusionShape): Use FloatRect::extend() to compute the polygon's physical bounding box. + * rendering/ExclusionShape.h: + (WebCore::ExclusionShape::shapeBoundingBox): Return the shape's bounding box in physical coordinates. + (ExclusionShape): + +2012-10-18 Hans Muller <hmuller@adobe.com> + + [CSS Exclusions] Handle special case "empty" shapes + https://bugs.webkit.org/show_bug.cgi?id=99342 + + Reviewed by Dirk Schulze. + + Provide expclit coverage of the simple "empty" shape-inside shapes. + Shapes will be considered "empty" in the sense that ExclusionShape::getIncludedIntervals() + and ExclusionShape::getExcludedIntervals() will always return empty lists of intervals. + This patch covers rectangles of zero width or height, circles with 0 radius, ellipses + with 0 radiusX or radiusY, polygons with less than 3 vertices. + + Test: fast/exclusions/shape-inside/shape-inside-empty.html + + * rendering/ExclusionPolygon.cpp: + (WebCore::ExclusionPolygon::ExclusionPolygon): Initialize the m_empty flag. + (WebCore::ExclusionPolygon::getExcludedIntervals): Added short-circuit return when the polygon is empty. + (WebCore::ExclusionPolygon::getIncludedIntervals): Added short-circuit return when the polygon is empty. + * rendering/ExclusionPolygon.h: Added the isEmpty() method. + * rendering/ExclusionRectangle.cpp: + (WebCore::ExclusionRectangle::getExcludedIntervals): Added short-circuit return when the rectangle is empty. + (WebCore::ExclusionRectangle::getIncludedIntervals): Added short-circuit return when the rectangle is empty. + * rendering/ExclusionRectangle.h: Added the isEmpty() method. + * rendering/ExclusionShape.h: Added a virtual isEmpty() ExclusionShape method. + (ExclusionShape): + +2012-10-18 Takashi Sakamoto <tasak@google.com> + + REGRESSION(r131464): Null-pointer crash in StyleResolver::styleForElement + https://bugs.webkit.org/show_bug.cgi?id=99587 + + Reviewed by Dimitri Glazkov. + + Since contents in datalist are not shown, summary in datalist is not + shown either. So the summary has no render style. On the other hand, + the summary is implemented by shadow DOM and it has some insertion + point. Its child, e.g. title in the below test, is distributed. + To solve the child's user-modify, looking at shadow host(=summary)'s + style causes null-pointer crash. + + Test: fast/dom/shadow/user-modify-in-datalist-crash.html + + * css/StyleResolver.cpp: + (WebCore::StyleResolver::styleForElement): + Added a code to check whether the shadow host has any style or not. + +2012-10-17 Philippe Normand <pnormand@igalia.com> + + [GTK] AudioBusGtk sometimes fails to load the HRTF database + https://bugs.webkit.org/show_bug.cgi?id=99601 + + Reviewed by Martin Robinson. + + AudioBusGtk now first lookup for the uninstalled resource files, + if the AUDIO_RESOURCES_PATH environment variable is + set. Additionally the audio file reader is now better dealing with + errors, returning an empty AudioBus in such cases and issuing + warnings on the console output. The cleanup of some member + variables was also moved to the destructor. + + * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: + (AudioFileReader): + (WebCore::AudioFileReader::AudioFileReader): + (WebCore::AudioFileReader::~AudioFileReader): Clear and free + member variables. This was done in createBus before. + (WebCore::AudioFileReader::handleMessage): Issue warnings in case + of error and exit from the main loop so the pipeline is not + forever stuck. + (WebCore::AudioFileReader::createBus): Return an empty bus in case + of error. + * platform/audio/gtk/AudioBusGtk.cpp: + (WebCore::AudioBus::loadPlatformResource): Load uninstalled + resources first if AUDIO_RESOURCES_PATH is set. + +2012-10-18 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: provisional change for merging "doced" state into the "dock side" enum. + https://bugs.webkit.org/show_bug.cgi?id=99718 + + Reviewed by Vsevolod Vlasov. + + Adds stub method that could be executed from the embedder. + + * inspector/front-end/InspectorFrontendAPI.js: + (InspectorFrontendAPI.setDockSide): + +2012-10-18 Kent Tamura <tkent@chromium.org> + + Add Localizer::monthFormat and implementations + https://bugs.webkit.org/show_bug.cgi?id=99704 + + Reviewed by Kentaro Hara. + + Localizer::monthFormat will be used for constructing input[type=month] UI. + + Tests: Add unit tests to Source/WebKit/chromium/tests/. + + * platform/text/Localizer.h: + (Localizer): Declare pure virtual monthFormat function. + + * platform/text/LocaleNone.cpp: + (LocaleNone): Declare monthFormat. + (WebCore::LocaleNone::monthFormat): + Added. Always reutrns an ISO-8601 format, "yyyy-MM" + + * platform/text/LocaleICU.h: + (LocaleICU): Declare monthFormat. + * platform/text/LocaleICU.cpp: + (WebCore::getFormatForSkeleton): + A helper to get a format for the specified skeleton. + The overflow-allocalte-try-again pattern is similar to + LocaleICU::decimalSymbol and LocaleICU::decimalTextAttribute. + (WebCore::LocaleICU::monthFormat): + Added. Calls getFormatForSkeleton with "yyyyMMM". + + * platform/text/mac/LocaleMac.h: + (LocaleMac): Declare monthFormat. + * platform/text/mac/LocaleMac.mm: + (WebCore::LocaleMac::monthFormat): + Added. Calls NSDateFormatter::dateFormatFromTemplate with "yyyyMMM". + + * platform/text/LocaleWin.h: + (LocaleWin): Declare monthFormat. + * platform/text/LocaleWin.cpp: + (WebCore::LocaleWin::monthFormat): + Get a format by LOCALE_SYEARMONTH, and convert it to an LDML format. + +2012-10-18 Pavel Feldman <pfeldman@chromium.org> + + Web Inspector: add X-WebKit-CSP header into inspector.html + https://bugs.webkit.org/show_bug.cgi?id=99710 + + Reviewed by Vsevolod Vlasov. + + A simple sanity measure. + + * inspector/front-end/inspector.html: + +2012-10-18 Huang Dongsung <luxtella@company100.net> + + [WK2] Add CustomFilterOperation serialization in ArgumentCoder. + https://bugs.webkit.org/show_bug.cgi?id=98733 + + Reviewed by Noam Rosenthal. + + Change CustomFilterOperation::parameters() to const function, because + this method is a getter and a const instance needs to call this method. + + No new tests because there is no change in behavior. + + * platform/graphics/filters/CustomFilterOperation.h: + (WebCore::CustomFilterOperation::parameters): + +2012-10-18 Hayato Ito <hayato@chromium.org> + + treeScopeOfParent doesn't return the TreeScope of the parent + https://bugs.webkit.org/show_bug.cgi?id=98207 + + Reviewed by Hajime Morita. + + A minor clean up. Remove treeScopeOfParent() in Element.cpp. + + No tests needed, this is just a clean up. + + * dom/Element.cpp: + (WebCore::Element::removedFrom): + +2012-10-18 Alexander Pavlov <apavlov@chromium.org> + + Web Inspector: [Styles] Forcibly invoke property names suggestion box for empty prefix + https://bugs.webkit.org/show_bug.cgi?id=99711 + + Reviewed by Vsevolod Vlasov. + + Suggestions should be returned unconditionally for CSS property names, regardless of the prefix. + + * inspector/front-end/CSSCompletions.js: + (WebInspector.CSSCompletions): + (WebInspector.CSSCompletions.requestCSSNameCompletions): + (WebInspector.CSSCompletions.prototype._firstIndexOfPrefix): + * inspector/front-end/CSSKeywordCompletions.js: + (WebInspector.CSSKeywordCompletions.forProperty): + +2012-10-18 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> + + Unreviewed, do not make UseV8.cmake executable. + + * UseV8.cmake: Removed property svn:executable. + 2012-10-18 Tommy Widenflycht <tommyw@google.com> MediaStream API: Add better RTCPeerConnectionHandler creation logic diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig index aba17898d..534cbd4bf 100644 --- a/Source/WebCore/Configurations/FeatureDefines.xcconfig +++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig @@ -48,7 +48,8 @@ ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS; ENABLE_CSS_COMPOSITING = ENABLE_CSS_COMPOSITING; ENABLE_CSS_STICKY_POSITION = ENABLE_CSS_STICKY_POSITION; ENABLE_CSS_VARIABLES = ; -ENABLE_CSS3_TEXT_DECORATION = ; +ENABLE_CSS3_CONDITIONAL_RULES = ; +ENABLE_CSS3_TEXT = ; ENABLE_CUSTOM_SCHEME_HANDLER = ; ENABLE_DASHBOARD_SUPPORT = $(ENABLE_DASHBOARD_SUPPORT_$(REAL_PLATFORM_NAME)); ENABLE_DASHBOARD_SUPPORT_macosx = ENABLE_DASHBOARD_SUPPORT; @@ -148,4 +149,4 @@ ENABLE_WEB_TIMING = ; ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_TEXT_DECORATION) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_HIERARCHIES) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_UNDO_MANAGER) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XSLT); diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make index f5b04aae8..a0b77c5de 100644 --- a/Source/WebCore/DerivedSources.make +++ b/Source/WebCore/DerivedSources.make @@ -377,6 +377,7 @@ BINDING_IDLS = \ $(WebCore)/html/canvas/Int16Array.idl \ $(WebCore)/html/canvas/Int32Array.idl \ $(WebCore)/html/canvas/Int8Array.idl \ + $(WebCore)/html/canvas/OESElementIndexUint.idl \ $(WebCore)/html/canvas/OESStandardDerivatives.idl \ $(WebCore)/html/canvas/OESTextureFloat.idl \ $(WebCore)/html/canvas/OESVertexArrayObject.idl \ diff --git a/Source/WebCore/DerivedSources.pri b/Source/WebCore/DerivedSources.pri index f4235a45d..010a0e657 100644 --- a/Source/WebCore/DerivedSources.pri +++ b/Source/WebCore/DerivedSources.pri @@ -301,6 +301,7 @@ IDL_BINDINGS += \ $$PWD/html/canvas/OESStandardDerivatives.idl \ $$PWD/html/canvas/OESTextureFloat.idl \ $$PWD/html/canvas/OESVertexArrayObject.idl \ + $$PWD/html/canvas/OESElementIndexUint.idl \ $$PWD/html/canvas/WebGLActiveInfo.idl \ $$PWD/html/canvas/WebGLBuffer.idl \ $$PWD/html/canvas/WebGLCompressedTextureS3TC.idl \ diff --git a/Source/WebCore/English.lproj/localizedStrings.js b/Source/WebCore/English.lproj/localizedStrings.js index 290861b14..a962ec553 100644 --- a/Source/WebCore/English.lproj/localizedStrings.js +++ b/Source/WebCore/English.lproj/localizedStrings.js @@ -2,7 +2,6 @@ var localizedStrings = new Object; localizedStrings[" (%d)"] = " (%d)"; localizedStrings[" (repeated %d times)"] = " (repeated %d times)"; -localizedStrings["1 - %d"] = "1 - %d"; localizedStrings["%.0fB"] = "%.0fB"; localizedStrings["%.0fKB"] = "%.0fKB"; localizedStrings["%.0fMB"] = "%.0fMB"; @@ -10,7 +9,7 @@ localizedStrings["%.0fms"] = "%.0fms"; localizedStrings["%.1f days"] = "%.1f days"; localizedStrings["%.1fhrs"] = "%.1fhrs"; localizedStrings["%.1fmin"] = "%.1fmin"; -localizedStrings["%.2f%%"] = "%.2f%%"; +localizedStrings["%.2f%"] = "%.2f%"; localizedStrings["%.2fKB"] = "%.2fKB"; localizedStrings["%.2fMB"] = "%.2fMB"; localizedStrings["%.2fs"] = "%.2fs"; @@ -25,26 +24,21 @@ localizedStrings["%d error, %d warnings"] = "%d error, %d warnings"; localizedStrings["%d errors"] = "%d errors"; localizedStrings["%d errors, %d warning"] = "%d errors, %d warning"; localizedStrings["%d errors, %d warnings"] = "%d errors, %d warnings"; -localizedStrings["%d of %d matches"] = "%d of %d matches"; -localizedStrings["%d matches"] = "%d matches"; +localizedStrings["%d of %d"] = "%d of %d"; localizedStrings["%d of %d captured records are visible"] = "%d of %d captured records are visible"; localizedStrings["%d warning"] = "%d warning"; localizedStrings["%d warnings"] = "%d warnings"; -localizedStrings["%d × %d pixels (Natural: %d × %d pixels)"] = "%d × %d pixels (Natural: %d × %d pixels)"; -localizedStrings["%d × %d pixels"] = "%d × %d pixels"; +localizedStrings["%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)"] = "%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)"; +localizedStrings["%d \xd7 %d pixels"] = "%d \xd7 %d pixels"; localizedStrings["%d × %d"] = "%d × %d"; localizedStrings["%s (%s)"] = "%s (%s)"; localizedStrings["%s (at %s)"] = "%s (at %s)"; localizedStrings["%s (from cache)"] = "%s (from cache)"; localizedStrings["%s - Details"] = "%s - Details"; -localizedStrings["%s >1000%%"] = "%s >1000%%"; localizedStrings["%s collected"] = "%s collected"; localizedStrings["%s download"] = "%s download"; localizedStrings["%s latency"] = "%s latency"; localizedStrings["%s latency, %s download (%s total)"] = "%s latency, %s download (%s total)"; -localizedStrings["%s%.2f%%"] = "%s%.2f%%"; -localizedStrings["%s%d"] = "%s%d"; -localizedStrings["%s%s"] = "%s%s"; localizedStrings["(anonymous function)"] = "(anonymous function)"; localizedStrings["(data url)"] = "(data url)"; localizedStrings["(from cache)"] = "(from cache)"; @@ -56,11 +50,9 @@ localizedStrings["(program)"] = "(program)"; localizedStrings["(text)"] = "(text)"; localizedStrings["(unable to decode value)"] = "(unable to decode value)"; localizedStrings["(whitespace)"] = "(whitespace)"; -localizedStrings["1 of 1 match"] = "1 of 1 match"; -localizedStrings["1 match"] = "1 match"; localizedStrings["Application Cache"] = "Application Cache"; localizedStrings["Accept suggestion"] = "Accept suggestion"; -localizedStrings["Activate all breakpoints."] = "Activate all breakpoints."; +localizedStrings["Activate All breakpoints"] = "Activate All breakpoints"; localizedStrings["Activate all breakpoints"] = "Activate all breakpoints"; localizedStrings["Add Attribute"] = "Add Attribute"; localizedStrings["Add attribute"] = "Add attribute"; @@ -69,7 +61,6 @@ localizedStrings["Add breakpoint"] = "Add breakpoint"; localizedStrings["Add Conditional Breakpoint…"] = "Add Conditional Breakpoint…"; localizedStrings["Add conditional breakpoint…"] = "Add conditional breakpoint…"; localizedStrings["Add New"] = "Add New"; -localizedStrings["Add"] = "Add"; localizedStrings["Aggregated Time"] = "Aggregated Time"; localizedStrings["All Nodes"] = "All Nodes"; localizedStrings["All Panels"] = "All Panels"; @@ -104,30 +95,27 @@ localizedStrings["Call Stack"] = "Call Stack"; localizedStrings["Calls"] = "Calls"; localizedStrings["Cannot find corresponding heap snapshot node"] = "Cannot find corresponding heap snapshot node"; localizedStrings["Clear all profiles."] = "Clear all profiles."; -localizedStrings["Clear Browser Cache."] = "Clear Browser Cache."; -localizedStrings["Clear browser cache."] = "Clear browser cache."; -localizedStrings["Clear Browser Cookies."] = "Clear Browser Cookies."; -localizedStrings["Clear browser cookies."] = "Clear browser cookies."; +localizedStrings["Clear Browser Cache"] = "Clear Browser Cache"; +localizedStrings["Clear browser cache"] = "Clear browser cache"; +localizedStrings["Clear Browser Cookies"] = "Clear Browser Cookies"; +localizedStrings["Clear browser cookies"] = "Clear browser cookies"; localizedStrings["Clear Console"] = "Clear Console"; localizedStrings["Clear console"] = "Clear console"; localizedStrings["Clear audit results."] = "Clear audit results."; localizedStrings["Clear console log."] = "Clear console log."; localizedStrings["Clear"] = "Clear"; -localizedStrings["Click to change color format"] = "Click to change color format"; localizedStrings["Click to open a colorpicker. Shift-click to change color format"] = "Click to open a colorpicker. Shift-click to change color format"; localizedStrings["Closure"] = "Closure"; localizedStrings["Code"] = "Code"; localizedStrings["Collected"] = "Collected"; localizedStrings["Collect CSS Selector Profile"] = "Collect CSS Selector Profile"; localizedStrings["Collect JavaScript CPU Profile"] = "Collect JavaScript CPU Profile"; -localizedStrings["Compared to %s"] = "Compared to %s"; localizedStrings["Computed Style"] = "Computed Style"; localizedStrings["Connecting"] = "Connecting"; localizedStrings["Console"] = "Console"; localizedStrings["Constructor"] = "Constructor"; localizedStrings["Continue to Here"] = "Continue to Here"; localizedStrings["Continue to here"] = "Continue to here"; -localizedStrings["Continue"] = "Continue"; localizedStrings["Copy as HTML"] = "Copy as HTML"; localizedStrings["Copy all as HAR"] = "Copy all as HAR"; localizedStrings["Copy All as HAR"] = "Copy All as HAR"; @@ -140,7 +128,6 @@ localizedStrings["Copy Request Headers"] = "Copy Request Headers"; localizedStrings["Copy response headers"] = "Copy response headers"; localizedStrings["Copy Response Headers"] = "Copy Response Headers"; localizedStrings["Copy XPath"] = "Copy XPath"; -localizedStrings["Count"] = "Count"; localizedStrings["Web SQL"] = "Web SQL"; localizedStrings["DNS Lookup"] = "DNS Lookup"; localizedStrings["DOMContent event fired"] = "DOMContent event fired"; @@ -148,7 +135,7 @@ localizedStrings["DOMContent event"] = "DOMContent event"; localizedStrings["DOM Node Count"] = "DOM Node Count"; localizedStrings["Database no longer has expected version."] = "Database no longer has expected version."; localizedStrings["Deactivate all breakpoints."] = "Deactivate all breakpoints."; -localizedStrings["Deactivate all breakpoints"] = "Deactivate all breakpoints"; +localizedStrings["Deactivate All breakpoints"] = "Deactivate All breakpoints"; localizedStrings["Debug"] = "Debug"; localizedStrings["Debugging disabled. Click to enable."] = "Debugging disabled. Click to enable."; localizedStrings["Debugging enabled. Click to disable."] = "Debugging enabled. Click to disable."; @@ -197,7 +184,6 @@ localizedStrings["Event"] = "Event"; localizedStrings["Exclude selected function."] = "Exclude selected function."; localizedStrings["Execute command"] = "Execute command"; localizedStrings["Expand/collapse"] = "Expand/collapse"; -localizedStrings["Expected Content Length"] = "Expected Content Length"; localizedStrings["Expires"] = "Expires"; localizedStrings["File size"] = "File size"; localizedStrings["Fit in window"] = "Fit in window"; @@ -212,7 +198,7 @@ localizedStrings["Font scale factor:"] = "Font scale factor:"; localizedStrings["Fonts"] = "Fonts"; localizedStrings["Form Data"] = "Form Data"; localizedStrings["Program"] = "Program"; -localizedStrings["Unknown: "] = "Unknown: %s"; +localizedStrings["Unknown: %s"] = "Unknown: %s"; localizedStrings["Function Call"] = "Function Call"; localizedStrings["Function"] = "Function"; localizedStrings["GC Event"] = "GC Event"; @@ -228,7 +214,7 @@ localizedStrings["Heap snapshot profiles show memory distribution among your pag localizedStrings["Heavy (Bottom Up)"] = "Heavy (Bottom Up)"; localizedStrings["Hex Colors"] = "Hex Colors"; localizedStrings["Hide console."] = "Hide console."; -localizedStrings["Hide the records that are shorter than %s"] = "Hide the records that are shorter than %s"; +localizedStrings["Hide the records that are shorter than %s"] = "Hide the Precords that are shorter than %s"; localizedStrings["Image"] = "Image"; localizedStrings["Images"] = "Images"; localizedStrings["Increment/decrement by %f"] = "Increment/decrement by %f"; @@ -240,7 +226,7 @@ localizedStrings["Inspected worker has terminated. Once it restarts we will atta localizedStrings["Install Timer"] = "Install Timer"; localizedStrings["Invalid property value."] = "Invalid property value."; localizedStrings["Key"] = "Key"; -localizedStrings["Keyboard Shortcuts"] = "Keyboard Shortcuts"; +localizedStrings["Shortcuts"] = "Shortcuts"; localizedStrings["Layout"] = "Layout"; localizedStrings["Listeners: %d"] = "Listeners: %d"; localizedStrings["Local Storage"] = "Local Storage"; @@ -254,7 +240,6 @@ localizedStrings["Location"] = "Location"; localizedStrings["Logs"] = "Logs"; localizedStrings["MIME Type"] = "MIME Type"; localizedStrings["MIME type"] = "MIME type"; -localizedStrings["Mark"] = "Mark"; localizedStrings["Matched CSS Rules"] = "Matched CSS Rules"; localizedStrings["Matches"] = "Matches"; localizedStrings["Memory"] = "Memory"; @@ -265,7 +250,6 @@ localizedStrings["New Style Rule"] = "New Style Rule"; localizedStrings["Next/previous call frame"] = "Next/previous call frame"; localizedStrings["Next/previous command"] = "Next/previous command"; localizedStrings["Next/previous line"] = "Next/previous line"; -localizedStrings["Next/previous panel"] = "Next/previous panel"; localizedStrings["Next/previous property"] = "Next/previous property"; localizedStrings["Next/previous suggestion"] = "Next/previous suggestion"; localizedStrings["No Application Cache information available."] = "No Application Cache information available."; @@ -279,7 +263,7 @@ localizedStrings["Node Removed"] = "Node Removed"; localizedStrings["Nodes: %d"] = "Nodes: %d"; localizedStrings["Not Found"] = "Not Found"; localizedStrings["Not Paused"] = "Not Paused"; -localizedStrings["Objects"] = "Objects"; +localizedStrings["Objects Count"] = "Objects Count"; localizedStrings["Offline"] = "Offline"; localizedStrings["Online"] = "Online"; localizedStrings["Only enable for this session"] = "Only enable for this session"; @@ -310,7 +294,6 @@ localizedStrings["Paused"] = "Paused"; localizedStrings["Paused on exception: '%s'."] = "Paused on exception: '%s'."; localizedStrings["Pausing"] = "Pausing"; localizedStrings["Preview"] = "Preview"; -localizedStrings["opefile %d"] = "Profile %d"; localizedStrings["Profiles"] = "Profiles"; localizedStrings["Profiling disabled. Click to enable."] = "Profiling disabled. Click to enable."; localizedStrings["Profiling enabled. Click to disable."] = "Profiling enabled. Click to disable."; @@ -328,7 +311,7 @@ localizedStrings["Receive Data"] = "Receive Data"; localizedStrings["Receive Response"] = "Receive Response"; localizedStrings["Receiving"] = "Receiving"; localizedStrings["Record"] = "Record"; -localizedStrings["Recording…"] = "Recording…"; +localizedStrings["Recording\u2026"] = "Recording\u2026"; localizedStrings["Redirect"] = "Redirect"; localizedStrings["Refresh"] = "Refresh"; localizedStrings["Region is %s."] = "Region is %s."; @@ -342,7 +325,7 @@ localizedStrings["Request Headers"] = "Request Headers"; localizedStrings["Request Method"] = "Request Method"; localizedStrings["Request Payload"] = "Request Payload"; localizedStrings["Request URL"] = "Request URL"; -localizedStrings["Resource interpreted as %s but transferred with MIME type %s."] = "Resource interpreted as %s but transferred with MIME type %s."; +localizedStrings["Resource interpreted as %s but transferred with MIME type %s: \"%s\"."] = "Resource interpreted as %s but transferred with MIME type %s: \"%s\"."; localizedStrings["Resource"] = "Resource"; localizedStrings["Resources"] = "Resources"; localizedStrings["Response"] = "Response"; @@ -362,14 +345,12 @@ localizedStrings["Scope Variables"] = "Scope Variables"; localizedStrings["Screen resolution:"] = "Screen resolution:"; localizedStrings["Script"] = "Script"; localizedStrings["Scripting"] = "Scripting"; -localizedStrings["Scripts Panel"] = "Scripts Panel"; localizedStrings["Scroll into view"] = "Scroll into view"; localizedStrings["Scroll Into View"] = "Scroll Into View"; -localizedStrings["Source Code Panel"] = "Source Code Panel"; +localizedStrings["Sources Panel"] = "Sources Panel"; localizedStrings["Scripts"] = "Scripts"; -localizedStrings["Source Code"] = "Source Code"; +localizedStrings["Source"] = "Source"; localizedStrings["Sources"] = "Sources"; -localizedStrings["Search %s"] = "Search %s"; localizedStrings["Search"] = "Search"; localizedStrings["Secure"] = "Secure"; localizedStrings["Select All"] = "Select All"; @@ -383,11 +364,9 @@ localizedStrings["Send Request"] = "Send Request"; localizedStrings["Sending"] = "Sending"; localizedStrings["Session"] = "Session"; localizedStrings["Show All Nodes (%d More)"] = "Show All Nodes (%d More)"; -localizedStrings["Show absolute counts and sizes."] = "Show absolute counts and sizes."; localizedStrings["Show absolute times."] = "Show absolute times."; localizedStrings["Show absolute total and self times."] = "Show absolute total and self times."; localizedStrings["Show console."] = "Show console."; -localizedStrings["Show counts and sizes as percentages."] = "Show counts and sizes as percentages."; localizedStrings["Show function definition"] = "Show function definition"; localizedStrings["Show inherited"] = "Show inherited"; localizedStrings["Show Shadow DOM"] = "Show Shadow DOM"; @@ -431,7 +410,6 @@ localizedStrings["This request has no preview available."] = "This request has n localizedStrings["This request has no response data available."] = "This request has no response data available."; localizedStrings["Time"] = "Time"; localizedStrings["Timeline"] = "Timeline"; -localizedStrings["Timelines"] = "Timelines"; localizedStrings["Timeout"] = "Timeout"; localizedStrings["Timer Fired"] = "Timer Fired"; localizedStrings["Timer ID"] = "Timer ID"; @@ -449,7 +427,6 @@ localizedStrings["Value"] = "Value"; localizedStrings["Waiting"] = "Waiting"; localizedStrings["Warnings"] = "Warnings"; localizedStrings["Watch Expressions"] = "Watch Expressions"; -localizedStrings["Welcome to the Profiles panel"] = "Welcome to the Profiles panel"; localizedStrings["With Block"] = "With Block"; localizedStrings["Word Wrap"] = "Word Wrap"; localizedStrings["Word wrap"] = "Word wrap"; @@ -458,12 +435,9 @@ localizedStrings["XHR Load"] = "XHR Load"; localizedStrings["XHR Ready State Change"] = "XHR Ready State Change"; localizedStrings["XHR"] = "XHR"; localizedStrings["Log XMLHttpRequests"] = "Log XMLHttpRequests"; -localizedStrings["You could save bandwidth by having your web server compress this transfer with gzip or zlib."] = "You could save bandwidth by having your web server compress this transfer with gzip or zlib."; localizedStrings["You need to enable debugging before you can use the Scripts panel."] = "You need to enable debugging before you can use the Scripts panel."; localizedStrings["You need to enable profiling before you can use the Profiles panel."] = "You need to enable profiling before you can use the Profiles panel."; localizedStrings["[empty domain]"] = "[empty domain]"; -localizedStrings["\xb1 Count"] = "\xb1 Count"; -localizedStrings["\xb1 Size"] = "\xb1 Size"; localizedStrings["border"] = "border"; localizedStrings["content"] = "content"; localizedStrings["deleted"] = "deleted"; @@ -471,7 +445,6 @@ localizedStrings["empty"] = "empty"; localizedStrings["fit"] = "fit"; localizedStrings["line %d"] = "line %d"; localizedStrings["margin"] = "margin"; -localizedStrings["new"] = "new"; localizedStrings["or"] = "or"; localizedStrings["overset"] = "overset"; localizedStrings["padding"] = "padding"; @@ -533,14 +506,12 @@ localizedStrings["Frames"] = "Frames"; localizedStrings["Text"] = "Text"; localizedStrings["Content"] = "Content"; localizedStrings["URL"] = "URL"; -localizedStrings["Format script."] = "Format script."; localizedStrings["WebSocket"] = "WebSocket"; localizedStrings["(system)"] = "(system)"; localizedStrings["(compiled code)"] = "(compiled code)"; -localizedStrings["Loading…"] = "Loading…"; -localizedStrings["Parsing…"] = "Parsing…"; -localizedStrings["Snapshotting…"] = "Snapshotting…"; -localizedStrings["Please wait…"] = "Please wait…"; +localizedStrings["Loading\u2026"] = "Loading\u2026"; +localizedStrings["Parsing\u2026"] = "Parsing\u2026"; +localizedStrings["Snapshotting\u2026"] = "Snapshotting\u2026"; localizedStrings["Cancel"] = "Cancel"; localizedStrings["Show %d after"] = "Show %d after"; localizedStrings["Show %d before"] = "Show %d before"; @@ -563,7 +534,6 @@ localizedStrings["Property types:"] = "Property types:"; localizedStrings["element"] = "element"; localizedStrings["property"] = "property"; localizedStrings["Object types:"] = "Object types:"; -localizedStrings["%s() at %s"] = "%s() at %s"; localizedStrings["Copy Stack Trace"] = "Copy Stack Trace"; localizedStrings["Restart Frame"] = "Restart Frame"; localizedStrings["Collect Garbage"] = "Collect Garbage"; @@ -584,20 +554,18 @@ localizedStrings["Open image in new tab"] = "Open image in new tab"; localizedStrings["Color format"] = "Color format"; localizedStrings["Settings"] = "Settings"; localizedStrings["Toggle Element State"] = "Toggle Element State"; -localizedStrings["Load timeline data\u2026"] = "Load Timeline data\u2026"; -localizedStrings["Save timeline data\u2026"] = "Save Timeline data\u2026"; +localizedStrings["Load Timeline data\u2026"] = "Load Timeline data\u2026"; +localizedStrings["Save Timeline data\u2026"] = "Save Timeline data\u2026"; localizedStrings["Load timeline data"] = "Load Timeline data"; localizedStrings["Save timeline data"] = "Save Timeline data"; -localizedStrings["An error occurred reading the file \"%s\""] = "An error occurred while reading the file \"%s\""; +localizedStrings["An error occurred while reading the file \"%s\""] = "An error occurred while reading the file \"%s\""; localizedStrings["File \"%s\" is not readable"] = "File \"%s\" is not readable"; localizedStrings["File \"%s\" not found."] = "File \"%s\" not found."; -localizedStrings["Filter out records shorter than %s"] = "Filter out records shorter than %s"; +localizedStrings["Filter"] = "Filter"; localizedStrings["Show user agent styles"] = "Show user agent styles"; -localizedStrings["Show script folders"] = "Show script folders"; localizedStrings["Request Animation Frame"] = "Request Animation Frame"; localizedStrings["Cancel Animation Frame"] = "Cancel Animation Frame"; localizedStrings["Animation Frame Fired"] = "Animation Frame Fired"; -localizedStrings["Registered at"] = "Registered at"; localizedStrings["Extensions"] = "Extensions"; localizedStrings["Open links in"] = "Open links in"; localizedStrings["a panel chosen automatically"] = "a panel chosen automatically"; @@ -613,17 +581,15 @@ localizedStrings["Automatically attach to new workers and pause them. Enabling t localizedStrings["Pause on start"] = "Pause on start"; localizedStrings["Dedicated worker inspectors"] = "Dedicated worker inspectors"; localizedStrings["Stamp"] = "Stamp"; -localizedStrings["Enable worker inspection"] = "Enable worker inspection"; localizedStrings["No Watch Expressions"] = "No Watch Expressions"; localizedStrings["Start/stop recording"] = "Start/stop recording"; localizedStrings["Callback ID"] = "Callback ID"; localizedStrings["Timeline Panel"] = "Timeline Panel"; localizedStrings["All objects"] = "All objects"; localizedStrings["Objects allocated before Snapshot %d"] = "Objects allocated before Snapshot %d"; -localizedStrings["Objects allocated between Snapshot %d and Snapshot %d"] = "Objects allocated between Snapshot %d and Snapshot %d"; +localizedStrings["Objects allocated between Snapshots %d and %d"] = "Objects allocated between Snapshots %d and %d"; localizedStrings["Show all matches (%d more)."] = "Show all matches (%d more)."; localizedStrings["Found %d matches in %d files."] = "Found %d matches in %d files."; -localizedStrings["Stop search"] = "Stop search"; localizedStrings["Search finished."] = "Search finished."; localizedStrings["Search interrupted."] = "Search interrupted."; localizedStrings["Add to Watch"] = "Add to Watch"; @@ -641,7 +607,7 @@ localizedStrings["Evaluate in console"] = "Evaluate in console"; localizedStrings["Evaluate in Console"] = "Evaluate in Console"; localizedStrings["Evaluate selection in console"] = "Evaluate selection in console"; localizedStrings["new frame"] = "new frame"; -localizedStrings["Web Inspector - "] = "Web Inspector - "; +localizedStrings["Web Inspector - %s"] = "Web Inspector - %s"; localizedStrings["Open using %s"] = "Open using %s"; localizedStrings["Open Using %s"] = "Open Using %s"; localizedStrings["Show objects' hidden properties"] = "Show objects' hidden properties"; @@ -656,7 +622,6 @@ localizedStrings["Experiments"] = "Experiments"; localizedStrings["WARNING:"] = "WARNING:"; localizedStrings["These experiments could be dangerous and may require restart."] = "These experiments could be dangerous and may require restart."; localizedStrings["General"] = "General"; -localizedStrings["Dock to right"] = "Dock to right"; localizedStrings["Object's retaining tree"] = "Object's retaining tree"; localizedStrings["Touch"] = "Touch"; localizedStrings["Close"] = "Close"; @@ -677,16 +642,11 @@ localizedStrings["Show next page."] = "Show next page."; localizedStrings["Start from key"] = "Start from key"; localizedStrings["Glue asynchronous events to causes"] = "Glue asynchronous events to causes"; localizedStrings["undefined × %d"] = "undefined × %d"; -localizedStrings["Version"] = "Version"; localizedStrings["Key path: "] = "Key path: "; localizedStrings["autoIncrement"] = "autoIncrement"; localizedStrings["unique"] = "unique"; localizedStrings["multiEntry"] = "multiEntry"; -localizedStrings["Show each event category as a horizontal strip in overview"] = "Show each event category as a horizontal strip in overview"; -localizedStrings["Show each event as a vertical bar in overview"] = "Show each event as a vertical bar in overview"; -localizedStrings["Evaluated snippets"] = "Evaluated snippets"; -localizedStrings["An error happend when a call for method '%s' was requested"] = "An error happened when a call for method '%s' was requested"; -localizedStrings["Run"] = "Run"; +localizedStrings["An error happened when a call for method '%s' was requested"] = "An error happened when a call for method '%s' was requested"; localizedStrings["Rename"] = "Rename"; localizedStrings["Remove"] = "Remove"; localizedStrings["New"] = "New"; @@ -697,7 +657,6 @@ localizedStrings["Binary Frame"] = "Binary Frame"; localizedStrings["Connection Close Frame"] = "Connection Close Frame"; localizedStrings["Ping Frame"] = "Ping Frame"; localizedStrings["Pong Frame"] = "Pong Frame"; -localizedStrings["Time"] = "Time"; localizedStrings["Length"] = "Length"; localizedStrings["Data"] = "Data"; localizedStrings["%s (Opcode %d%s)"] = "%s (Opcode %d%s)"; @@ -708,9 +667,8 @@ localizedStrings["<Down>"] = "<Down>"; localizedStrings["Events"] = "Events"; localizedStrings["Loading\u2026 %d\%"] = "Loading\u2026 %d\%"; localizedStrings["Saving\u2026 %d\%"] = "Saving\u2026 %d\%"; -localizedStrings["Only heap snapshots from files with extension '.whs' can be loaded."] = "Only heap snapshots from files with extension '.whs' can be loaded."; +localizedStrings["Only heap snapshots from files with extension '.heapsnapshot' can be loaded."] = "Only heap snapshots from files with extension '.heapsnapshot' can be loaded."; localizedStrings["Can't load profile when other profile is recording."] = "Can't load profile when other profile is recording."; -localizedStrings["Save profile\u2026"] = "Save profile\u2026"; localizedStrings["'%s' not found."] = "'%s' not found."; localizedStrings["'%s' is not readable"] = "'%s' is not readable"; localizedStrings["'%s' error %d"] = "'%s' error %d"; @@ -753,3 +711,51 @@ localizedStrings["Collecting content…"] = "Collecting content…"; localizedStrings["Writing file…"] = "Writing file…"; localizedStrings["Debug target terminated"] = "Debug target terminated"; localizedStrings["This remote debugging client is no longer functional. Please re-attach to the new target."] = "This remote debugging client is no longer functional. Please re-attach to the new target."; +localizedStrings["Snippets"] = "Snippets"; +localizedStrings["Refresh IndexedDB"] = "Refresh IndexedDB"; +localizedStrings["FileSystem"] = "FileSystem"; +localizedStrings["Refresh FileSystem List"] = "Refresh FileSystem List"; +localizedStrings["Take Native Memory Snapshot"] = "Take Native Memory Snapshot"; +localizedStrings["Take native memory snapshot."] = "Take native memory snapshot."; +localizedStrings["MEMORY DISTRIBUTION"] = "MEMORY DISTRIBUTION"; +localizedStrings["Native memory snapshot profiles show memory distribution among browser subsystems"] = "Native memory snapshot profiles show memory distribution among browser subsystems"; +localizedStrings["Worker asks to call a method '%s' on an unsupported object '%s'."] = "Worker asks to call a method '%s' on an unsupported object '%s'."; +localizedStrings["Worker asks to call an unsupported method '%s' on the console object."] = "Worker asks to call an unsupported method '%s' on the console object."; +localizedStrings["String Version"] = "String Version"; +localizedStrings["Integer Version"] = "Integer Version"; +localizedStrings["Search Previous"] = "Search Previous"; +localizedStrings["Search Next"] = "Search Next"; +localizedStrings["Disable JavaScript"] = "Disable JavaScript"; +localizedStrings["Show folders"] = "Show folders"; +localizedStrings["Profiler"] = "Profiler"; +localizedStrings["Painting"] = "Painting"; +localizedStrings["Frame Start"] = "Frame Start"; +localizedStrings["Schedule Style Recalculation"] = "Schedule Style Recalculation"; +localizedStrings["Invalidate Layout"] = "Invalidate Layout"; +localizedStrings["Composite Layers"] = "Composite Layers"; +localizedStrings["Interval Duration"] = "Interval Duration"; +localizedStrings["CPU time"] = "CPU time"; +localizedStrings["Replay XHR"] = "Replay XHR"; +localizedStrings["[ %d - %d ]"] = "[ %d - %d ]"; +localizedStrings["Search sources"] = "Search sources"; +localizedStrings["\u00D7"] = "\u00D7"; +localizedStrings["Find next/previous"] = "Find next/previous"; +localizedStrings["Go to line"] = "Go to line"; +localizedStrings["Local modifications"] = "Local modifications"; +localizedStrings["(%s) Created: %s Updated: %s"] = "(%s) Created: %s Updated: %s"; +localizedStrings["Class filter"] = "Class filter"; +localizedStrings["Are you sure you want to delete the selected entry?"] = "Are you sure you want to delete the selected entry?"; +localizedStrings["Distance"] = "Distance"; +localizedStrings["\u03B1:"] = "\u03B1:"; +localizedStrings["Drag"] = "Drag"; +localizedStrings["Toggle breakpoint"] = "Toggle breakpoint"; +localizedStrings["Capture Canvas Frame"] = "Capture Canvas Frame"; +localizedStrings["Capture Canvas Frame."] = "Capture Canvas Frame."; +localizedStrings["Trace Log %d"] = "Trace Log %d"; +localizedStrings["CANVAS PROFILE"] = "CANVAS PROFILE"; +localizedStrings["Canvas calls instrumentation"] = "Canvas calls instrumentation"; +localizedStrings["Capturing\u2026"] = "Capturing\u2026"; +localizedStrings["Binary File"] = "Binary File"; +localizedStrings["Modification Time"] = "Modification Time"; +localizedStrings["Directory"] = "Directory"; +localizedStrings["-"] = "-"; diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am index 0dac43c05..5d63da6d3 100644 --- a/Source/WebCore/GNUmakefile.am +++ b/Source/WebCore/GNUmakefile.am @@ -335,14 +335,25 @@ feature_defines_overrides += ENABLE_SPELLCHECK=0 endif # END ENABLE_SPELLCHECK # --- +# CSS3 Conditional Rules support +# --- +if ENABLE_CSS3_CONDITIONAL_RULES +feature_defines_overrides += ENABLE_CSS3_CONDITIONAL_RULES=1 +else +feature_defines_overrides += ENABLE_CSS3_CONDITIONAL_RULES=0 +endif # END ENABLE_CSS3_CONDITIONAL_RULES + +# --- # Unstable features # If unstable features should not be enabled, their defines should be overriden with a 0 value. # --- if !ENABLE_UNSTABLE_FEATURES feature_defines_unstable += \ - ENABLE_CSS3_TEXT_DECORATION=0 \ + ENABLE_CSP_NEXT=0 \ + ENABLE_CSS3_TEXT=0 \ ENABLE_CSS_STICKY_POSITION=0 \ ENABLE_LINK_PREFETCH=0 \ + ENABLE_MICRODATA=0 \ ENABLE_MUTATION_OBSERVERS=0 \ ENABLE_STYLE_SCOPED=0 \ ENABLE_VIDEO_TRACK=0 \ @@ -730,7 +741,8 @@ EXTRA_DIST += \ Source/WebCore/bindings/scripts/preprocessor.pm \ Source/WebCore/bindings/scripts/preprocess-idls.pl \ Source/WebCore/ChangeLog \ - Source/WebCore/css/CSSGrammar.y \ + Source/WebCore/css/CSSGrammar.y.in \ + Source/WebCore/css/CSSGrammar.y.includes \ Source/WebCore/css/CSSPropertyNames.in \ Source/WebCore/css/CSSValueKeywords.in \ Source/WebCore/dom/DOMExceptions.in \ diff --git a/Source/WebCore/GNUmakefile.features.am b/Source/WebCore/GNUmakefile.features.am index 0e2b5ca08..9c4c9d82c 100644 --- a/Source/WebCore/GNUmakefile.features.am +++ b/Source/WebCore/GNUmakefile.features.am @@ -5,8 +5,8 @@ feature_defines_defaults += \ ENABLE_BATTERY_STATUS=0 \ ENABLE_BLOB=1 \ ENABLE_CHANNEL_MESSAGING=1 \ - ENABLE_CSP_NEXT=0 \ - ENABLE_CSS3_TEXT_DECORATION=1 \ + ENABLE_CSP_NEXT=1 \ + ENABLE_CSS3_TEXT=1 \ ENABLE_CSS_BOX_DECORATION_BREAK=1 \ ENABLE_CSS_COMPOSITING=0 \ ENABLE_CSS_EXCLUSIONS=1 \ @@ -18,6 +18,7 @@ feature_defines_defaults += \ ENABLE_CSS_SHADERS=0 \ ENABLE_CSS_STICKY_POSITION=1 \ ENABLE_CSS_VARIABLES=0 \ + ENABLE_CSS3_CONDITIONAL_RULES=0 \ ENABLE_CUSTOM_SCHEME_HANDLER=0 \ ENABLE_DASHBOARD_SUPPORT=0 \ ENABLE_DATALIST_ELEMENT=0 \ @@ -60,7 +61,7 @@ feature_defines_defaults += \ ENABLE_MEDIA_STREAM=1 \ ENABLE_METER_ELEMENT=1 \ ENABLE_MHTML=1 \ - ENABLE_MICRODATA=0 \ + ENABLE_MICRODATA=1 \ ENABLE_MUTATION_OBSERVERS=1 \ ENABLE_NAVIGATOR_CONTENT_UTILS=0 \ ENABLE_NETSCAPE_PLUGIN_API=1 \ diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am index ab124b44f..cff98c86e 100644 --- a/Source/WebCore/GNUmakefile.list.am +++ b/Source/WebCore/GNUmakefile.list.am @@ -579,6 +579,8 @@ webcore_built_sources += \ DerivedSources/WebCore/JSOESTextureFloat.h \ DerivedSources/WebCore/JSOESVertexArrayObject.cpp \ DerivedSources/WebCore/JSOESVertexArrayObject.h \ + DerivedSources/WebCore/JSOESElementIndexUint.cpp \ + DerivedSources/WebCore/JSOESElementIndexUint.h \ DerivedSources/WebCore/JSOfflineAudioCompletionEvent.cpp \ DerivedSources/WebCore/JSOfflineAudioCompletionEvent.h \ DerivedSources/WebCore/JSOscillatorNode.cpp \ @@ -1522,6 +1524,7 @@ dom_binding_idls += \ $(WebCore)/html/canvas/OESStandardDerivatives.idl \ $(WebCore)/html/canvas/OESTextureFloat.idl \ $(WebCore)/html/canvas/OESVertexArrayObject.idl \ + $(WebCore)/html/canvas/OESElementIndexUint.idl \ $(WebCore)/html/canvas/Uint16Array.idl \ $(WebCore)/html/canvas/Uint32Array.idl \ $(WebCore)/html/canvas/Uint8Array.idl \ @@ -2639,6 +2642,8 @@ webcore_sources += \ Source/WebCore/css/SiblingTraversalStrategies.h \ Source/WebCore/css/StyleBuilder.cpp \ Source/WebCore/css/StyleBuilder.h \ + Source/WebCore/css/StyleInvalidationAnalysis.cpp \ + Source/WebCore/css/StyleInvalidationAnalysis.h \ Source/WebCore/css/StyleMedia.cpp \ Source/WebCore/css/StyleMedia.h \ Source/WebCore/css/StylePropertySet.cpp \ @@ -3200,6 +3205,8 @@ webcore_sources += \ Source/WebCore/html/canvas/OESTextureFloat.h \ Source/WebCore/html/canvas/OESVertexArrayObject.cpp \ Source/WebCore/html/canvas/OESVertexArrayObject.h \ + Source/WebCore/html/canvas/OESElementIndexUint.cpp \ + Source/WebCore/html/canvas/OESElementIndexUint.h \ Source/WebCore/html/canvas/WebGLActiveInfo.h \ Source/WebCore/html/canvas/WebGLBuffer.cpp \ Source/WebCore/html/canvas/WebGLBuffer.h \ @@ -4286,6 +4293,7 @@ webcore_sources += \ Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h \ Source/WebCore/platform/graphics/ColorSpace.h \ Source/WebCore/platform/graphics/DashArray.h \ + Source/WebCore/platform/graphics/DisplayRefreshMonitor.h \ Source/WebCore/platform/graphics/Extensions3D.h \ Source/WebCore/platform/graphics/NativeImagePtr.h \ Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp \ @@ -6164,8 +6172,13 @@ webcore_built_sources += \ DerivedSources/ANGLE/glslang_tab.h webcore_sources += \ + Source/ThirdParty/ANGLE/include/EGL/egl.h \ + Source/ThirdParty/ANGLE/include/EGL/eglplatform.h \ Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h \ + Source/ThirdParty/ANGLE/include/KHR/khrplatform.h \ Source/ThirdParty/ANGLE/src/common/angleutils.h \ + Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.cpp \ + Source/ThirdParty/ANGLE/src/compiler/ArrayBoundsClamper.h \ Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h \ Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp \ Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h \ diff --git a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h index cc197c217..d37493b98 100644 --- a/Source/WebCore/Modules/indexeddb/IDBBackingStore.h +++ b/Source/WebCore/Modules/indexeddb/IDBBackingStore.h @@ -29,18 +29,19 @@ #if ENABLE(INDEXED_DATABASE) #include "IDBCursor.h" -#include "IDBFactoryBackendInterface.h" -#include "SQLiteDatabase.h" +#include "IDBKeyPath.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> #include <wtf/Vector.h> +#include <wtf/text/WTFString.h> namespace WebCore { class IDBKey; class IDBKeyRange; class SecurityOrigin; +struct IDBDatabaseMetadata; class IDBBackingStore : public RefCounted<IDBBackingStore> { public: @@ -49,7 +50,7 @@ public: virtual ~IDBBackingStore() {}; virtual void getDatabaseNames(Vector<String>& foundNames) = 0; - virtual bool getIDBDatabaseMetaData(const String& name, String& foundStringVersion, int64_t& foundIntVersion, int64_t& foundId, int64_t& maxObjectStoreId) = 0; + virtual bool getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata* foundMetadata) = 0; virtual bool createIDBDatabaseMetaData(const String& name, const String& stringVersion, int64_t intVersion, int64_t& rowId) = 0; virtual bool updateIDBDatabaseIntVersion(Transaction*, int64_t rowId, int64_t intVersion) = 0; virtual bool updateIDBDatabaseMetaData(Transaction*, int64_t rowId, const String& version) = 0; diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.h b/Source/WebCore/Modules/indexeddb/IDBCursor.h index fe725c9ba..5589c222f 100644 --- a/Source/WebCore/Modules/indexeddb/IDBCursor.h +++ b/Source/WebCore/Modules/indexeddb/IDBCursor.h @@ -30,6 +30,7 @@ #include "IDBKey.h" #include "IDBTransaction.h" +#include "ScriptValue.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> diff --git a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h index 3b92f117e..1f74c3391 100644 --- a/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h +++ b/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h @@ -32,6 +32,8 @@ #include "IDBBackingStore.h" #include "IDBCursor.h" #include "IDBCursorBackendInterface.h" +#include "IDBTransactionBackendImpl.h" +#include "SerializedScriptValue.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/RefPtr.h> @@ -42,8 +44,6 @@ class IDBDatabaseBackendImpl; class IDBIndexBackendImpl; class IDBKeyRange; class IDBObjectStoreBackendImpl; -class IDBTransactionBackendImpl; -class SerializedScriptValue; class IDBCursorBackendImpl : public IDBCursorBackendInterface { public: diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp index 4e895417d..d5fbd6dd4 100644 --- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp +++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp @@ -133,28 +133,24 @@ const char* NoStringVersion = ""; IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, IDBBackingStore* backingStore, IDBFactoryBackendImpl* factory, const String& uniqueIdentifier) : m_backingStore(backingStore) - , m_id(InvalidId) - , m_name(name) - , m_version(NoStringVersion) - , m_intVersion(IDBDatabaseMetadata::NoIntVersion) - , m_maxObjectStoreId(InvalidId) + , m_metadata(name, InvalidId, NoStringVersion, IDBDatabaseMetadata::NoIntVersion, InvalidId) , m_identifier(uniqueIdentifier) , m_factory(factory) , m_transactionCoordinator(IDBTransactionCoordinator::create()) , m_closingConnection(false) { - ASSERT(!m_name.isNull()); + ASSERT(!m_metadata.name.isNull()); } bool IDBDatabaseBackendImpl::openInternal() { - bool success = m_backingStore->getIDBDatabaseMetaData(m_name, m_version, m_intVersion, m_id, m_maxObjectStoreId); - ASSERT_WITH_MESSAGE(success == (m_id != InvalidId), "success = %s, m_id = %lld", success ? "true" : "false", static_cast<long long>(m_id)); + bool success = m_backingStore->getIDBDatabaseMetaData(m_metadata.name, &m_metadata); + ASSERT_WITH_MESSAGE(success == (m_metadata.id != InvalidId), "success = %s, m_id = %lld", success ? "true" : "false", static_cast<long long>(m_metadata.id)); if (success) { loadObjectStores(); return true; } - return m_backingStore->createIDBDatabaseMetaData(m_name, m_version, m_intVersion, m_id); + return m_backingStore->createIDBDatabaseMetaData(m_metadata.name, m_metadata.version, m_metadata.intVersion, m_metadata.id); } IDBDatabaseBackendImpl::~IDBDatabaseBackendImpl() @@ -168,7 +164,8 @@ PassRefPtr<IDBBackingStore> IDBDatabaseBackendImpl::backingStore() const IDBDatabaseMetadata IDBDatabaseBackendImpl::metadata() const { - IDBDatabaseMetadata metadata(m_name, m_id, m_version, m_intVersion, m_maxObjectStoreId); + // FIXME: Figure out a way to keep m_metadata.objectStores.get(N).indexes up to date rather than regenerating this every time. + IDBDatabaseMetadata metadata(m_metadata); for (ObjectStoreMap::const_iterator it = m_objectStores.begin(); it != m_objectStores.end(); ++it) metadata.objectStores.set(it->key, it->value->metadata()); return metadata; @@ -184,9 +181,9 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendImpl::createObjectS RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionPtr); ASSERT(transaction->mode() == IDBTransaction::VERSION_CHANGE); - // FIXME: Fix edge cases around transaction aborts that prevent this from just being ASSERT(id == m_maxObjectStoreId + 1) - ASSERT(id > m_maxObjectStoreId); - m_maxObjectStoreId = id; + // FIXME: Fix edge cases around transaction aborts that prevent this from just being ASSERT(id == m_metadata.maxObjectStoreId + 1) + ASSERT(id > m_metadata.maxObjectStoreId); + m_metadata.maxObjectStoreId = id; RefPtr<IDBDatabaseBackendImpl> database = this; if (!transaction->scheduleTask( @@ -275,7 +272,7 @@ void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCal RefPtr<IDBDatabaseBackendImpl> database = this; if (!transaction->scheduleTask( createCallbackTask(&IDBDatabaseBackendImpl::setVersionInternal, database, version, callbacks, transaction), - createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version, m_intVersion))) { + createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_metadata.version, m_metadata.intVersion))) { // FIXME: Remove one of the following lines. ASSERT_NOT_REACHED(); ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR; @@ -286,9 +283,9 @@ void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRef { RefPtr<IDBTransactionBackendImpl> transaction = prpTransaction; int64_t databaseId = database->id(); - database->m_version = version; - database->m_intVersion = IDBDatabaseMetadata::NoIntVersion; - if (!database->m_backingStore->updateIDBDatabaseMetaData(transaction->backingStoreTransaction(), databaseId, database->m_version) || !database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) { + database->m_metadata.version = version; + database->m_metadata.intVersion = IDBDatabaseMetadata::NoIntVersion; + if (!database->m_backingStore->updateIDBDatabaseMetaData(transaction->backingStoreTransaction(), databaseId, database->m_metadata.version) || !database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_metadata.intVersion)) { RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."); callbacks->onError(error); transaction->abort(error); @@ -300,10 +297,10 @@ void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRef void IDBDatabaseBackendImpl::setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> transaction) { int64_t databaseId = database->id(); - int64_t oldVersion = database->m_intVersion; + int64_t oldVersion = database->m_metadata.intVersion; ASSERT(version > oldVersion); - database->m_intVersion = version; - if (!database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) { + database->m_metadata.intVersion = version; + if (!database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_metadata.intVersion)) { RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."); callbacks->onError(error); transaction->abort(error); @@ -363,8 +360,8 @@ size_t IDBDatabaseBackendImpl::connectionCount() void IDBDatabaseBackendImpl::processPendingCalls() { if (m_pendingSecondHalfOpenWithVersion) { - ASSERT(m_pendingSecondHalfOpenWithVersion->version() == m_intVersion); - ASSERT(m_id != InvalidId); + ASSERT(m_pendingSecondHalfOpenWithVersion->version() == m_metadata.intVersion); + ASSERT(m_metadata.id != InvalidId); m_pendingSecondHalfOpenWithVersion->callbacks()->onSuccess(this); m_pendingSecondHalfOpenWithVersion.release(); // Fall through when complete, as pending deletes may be (partially) unblocked. @@ -445,11 +442,11 @@ void IDBDatabaseBackendImpl::openConnection(PassRefPtr<IDBCallbacks> callbacks, m_pendingOpenCalls.append(PendingOpenCall::create(callbacks, databaseCallbacks)); return; } - if (m_id == InvalidId && !openInternal()) { + if (m_metadata.id == InvalidId && !openInternal()) { callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error.")); return; } - if (m_version == NoStringVersion && m_intVersion == IDBDatabaseMetadata::NoIntVersion) { + if (m_metadata.version == NoStringVersion && m_metadata.intVersion == IDBDatabaseMetadata::NoIntVersion) { // Spec says: If no version is specified and no database exists, set // database version to 1. We infer that the database didn't exist from // its lack of either type of version. @@ -468,7 +465,7 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer for (DatabaseCallbacksSet::const_iterator it = m_databaseCallbacksSet.begin(); it != m_databaseCallbacksSet.end(); ++it) { // Front end ensures the event is not fired at connections that have closePending set. if (*it != databaseCallbacks) - (*it)->onVersionChange(m_intVersion, requestedVersion); + (*it)->onVersionChange(m_metadata.intVersion, requestedVersion); } // The spec dictates we wait until all the version change events are // delivered and then check m_databaseCallbacks.empty() before proceeding @@ -478,7 +475,7 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer // tells us that all the blocked events have been delivered. See // https://bugs.webkit.org/show_bug.cgi?id=71130 if (connectionCount()) - callbacks->onBlocked(m_intVersion); + callbacks->onBlocked(m_metadata.intVersion); // FIXME: Add test for m_runningVersionChangeTransaction. if (m_runningVersionChangeTransaction || connectionCount()) { m_pendingOpenWithVersionCalls.append(PendingOpenWithVersionCall::create(callbacks, databaseCallbacks, requestedVersion)); @@ -493,7 +490,7 @@ void IDBDatabaseBackendImpl::runIntVersionChangeTransaction(int64_t requestedVer RefPtr<IDBDatabaseBackendImpl> database = this; OwnPtr<ScriptExecutionContext::Task> intVersionTask = createCallbackTask(&IDBDatabaseBackendImpl::setIntVersionInternal, database, requestedVersion, callbacks, transaction); - OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_version, m_intVersion); + OwnPtr<ScriptExecutionContext::Task> resetVersionOnAbortTask = createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_metadata.version, m_metadata.intVersion); if (!transaction->scheduleTask(intVersionTask.release(), resetVersionOnAbortTask.release())) { // FIXME: Remove one of the following lines. ASSERT_NOT_REACHED(); @@ -512,23 +509,23 @@ void IDBDatabaseBackendImpl::openConnectionWithVersion(PassRefPtr<IDBCallbacks> m_pendingOpenWithVersionCalls.append(PendingOpenWithVersionCall::create(callbacks, databaseCallbacks, version)); return; } - if (m_id == InvalidId) { + if (m_metadata.id == InvalidId) { if (openInternal()) - ASSERT(m_intVersion == IDBDatabaseMetadata::NoIntVersion); + ASSERT(m_metadata.intVersion == IDBDatabaseMetadata::NoIntVersion); else { callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error.")); return; } } - if (version > m_intVersion) { + if (version > m_metadata.intVersion) { runIntVersionChangeTransaction(version, callbacks, databaseCallbacks); return; } - if (version < m_intVersion) { - callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::VER_ERR, String::format("The requested version (%lld) is less than the existing version (%lld).", static_cast<long long>(version), static_cast<long long>(m_intVersion)))); + if (version < m_metadata.intVersion) { + callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::VER_ERR, String::format("The requested version (%lld) is less than the existing version (%lld).", static_cast<long long>(version), static_cast<long long>(m_metadata.intVersion)))); return; } - ASSERT(version == m_intVersion); + ASSERT(version == m_metadata.intVersion); m_databaseCallbacksSet.add(databaseCallbacks); callbacks->onSuccess(this); } @@ -553,13 +550,13 @@ void IDBDatabaseBackendImpl::deleteDatabase(PassRefPtr<IDBCallbacks> prpCallback return; } ASSERT(m_backingStore); - if (!m_backingStore->deleteDatabase(m_name)) { + if (!m_backingStore->deleteDatabase(m_metadata.name)) { callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error.")); return; } - m_version = NoStringVersion; - m_id = InvalidId; - m_intVersion = IDBDatabaseMetadata::NoIntVersion; + m_metadata.version = NoStringVersion; + m_metadata.id = InvalidId; + m_metadata.intVersion = IDBDatabaseMetadata::NoIntVersion; m_objectStores.clear(); callbacks->onSuccess(); } @@ -611,7 +608,7 @@ void IDBDatabaseBackendImpl::loadObjectStores() Vector<IDBKeyPath> keyPaths; Vector<bool> autoIncrementFlags; Vector<int64_t> maxIndexIds; - m_backingStore->getObjectStores(m_id, ids, names, keyPaths, autoIncrementFlags, maxIndexIds); + m_backingStore->getObjectStores(m_metadata.id, ids, names, keyPaths, autoIncrementFlags, maxIndexIds); ASSERT(names.size() == ids.size()); ASSERT(keyPaths.size() == ids.size()); @@ -638,8 +635,8 @@ void IDBDatabaseBackendImpl::addObjectStoreToMap(ScriptExecutionContext*, PassRe void IDBDatabaseBackendImpl::resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& previousVersion, int64_t previousIntVersion) { - database->m_version = previousVersion; - database->m_intVersion = previousIntVersion; + database->m_metadata.version = previousVersion; + database->m_metadata.intVersion = previousIntVersion; } } // namespace WebCore diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h index 97b855dae..11a69d0bf 100644 --- a/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h +++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h @@ -53,7 +53,7 @@ public: PassRefPtr<IDBBackingStore> backingStore() const; static const int64_t InvalidId = 0; - int64_t id() const { return m_id; } + int64_t id() const { return m_metadata.id; } void openConnection(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>); void openConnectionWithVersion(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, int64_t version); @@ -94,11 +94,7 @@ private: static void resetVersion(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version, int64_t intVersion); RefPtr<IDBBackingStore> m_backingStore; - int64_t m_id; - String m_name; - String m_version; - int64_t m_intVersion; - int64_t m_maxObjectStoreId; + IDBDatabaseMetadata m_metadata; String m_identifier; // This might not need to be a RefPtr since the factory's lifetime is that of the page group, but it's better to be conservitive than sorry. diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp index d6fbb6767..e51350d1c 100644 --- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp +++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp @@ -37,6 +37,7 @@ #include "IDBKeyPath.h" #include "IDBKeyRange.h" #include "IDBLevelDBCoding.h" +#include "IDBMetadata.h" #include "LevelDBComparator.h" #include "LevelDBDatabase.h" #include "LevelDBIterator.h" @@ -313,25 +314,25 @@ void IDBLevelDBBackingStore::getDatabaseNames(Vector<String>& foundNames) } } -bool IDBLevelDBBackingStore::getIDBDatabaseMetaData(const String& name, String& foundStringVersion, int64_t& foundIntVersion, int64_t& foundId, int64_t& maxObjectStoreId) +bool IDBLevelDBBackingStore::getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata* metadata) { const Vector<char> key = DatabaseNameKey::encode(m_identifier, name); - bool ok = getInt(m_db.get(), key, foundId); + bool ok = getInt(m_db.get(), key, metadata->id); if (!ok) return false; - ok = getString(m_db.get(), DatabaseMetaDataKey::encode(foundId, DatabaseMetaDataKey::UserVersion), foundStringVersion); + ok = getString(m_db.get(), DatabaseMetaDataKey::encode(metadata->id, DatabaseMetaDataKey::UserVersion), metadata->version); if (!ok) return false; - ok = getVarInt(m_db.get(), DatabaseMetaDataKey::encode(foundId, DatabaseMetaDataKey::UserIntVersion), foundIntVersion); + ok = getVarInt(m_db.get(), DatabaseMetaDataKey::encode(metadata->id, DatabaseMetaDataKey::UserIntVersion), metadata->intVersion); if (!ok) return false; - if (foundIntVersion == IDBDatabaseMetadata::DefaultIntVersion) - foundIntVersion = IDBDatabaseMetadata::NoIntVersion; + if (metadata->intVersion == IDBDatabaseMetadata::DefaultIntVersion) + metadata->intVersion = IDBDatabaseMetadata::NoIntVersion; - maxObjectStoreId = getMaxObjectStoreId(m_db.get(), foundId); + metadata->maxObjectStoreId = getMaxObjectStoreId(m_db.get(), metadata->id); return true; } @@ -405,15 +406,12 @@ bool IDBLevelDBBackingStore::deleteDatabase(const String& name) IDB_TRACE("IDBLevelDBBackingStore::deleteDatabase"); OwnPtr<LevelDBWriteOnlyTransaction> transaction = LevelDBWriteOnlyTransaction::create(m_db.get()); - int64_t databaseId; - String version; - int64_t intVersion; - int64_t maxObjectStoreId; - if (!getIDBDatabaseMetaData(name, version, intVersion, databaseId, maxObjectStoreId)) + IDBDatabaseMetadata metadata; + if (!getIDBDatabaseMetaData(name, &metadata)) return true; - const Vector<char> startKey = DatabaseMetaDataKey::encode(databaseId, DatabaseMetaDataKey::OriginName); - const Vector<char> stopKey = DatabaseMetaDataKey::encode(databaseId + 1, DatabaseMetaDataKey::OriginName); + const Vector<char> startKey = DatabaseMetaDataKey::encode(metadata.id, DatabaseMetaDataKey::OriginName); + const Vector<char> stopKey = DatabaseMetaDataKey::encode(metadata.id + 1, DatabaseMetaDataKey::OriginName); OwnPtr<LevelDBIterator> it = m_db->createIterator(); for (it->seek(startKey); it->isValid() && compareKeys(it->key(), stopKey) < 0; it->next()) transaction->remove(it->key()); diff --git a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h index caa57f514..0cf3276b3 100644 --- a/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h +++ b/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h @@ -45,7 +45,7 @@ public: virtual ~IDBLevelDBBackingStore(); virtual void getDatabaseNames(Vector<String>& foundNames); - virtual bool getIDBDatabaseMetaData(const String& name, String& foundVersion, int64_t& foundIntVersion, int64_t& foundId, int64_t& maxObjectStoreId); + virtual bool getIDBDatabaseMetaData(const String& name, IDBDatabaseMetadata*); virtual bool createIDBDatabaseMetaData(const String& name, const String& version, int64_t intVersion, int64_t& rowId); virtual bool updateIDBDatabaseMetaData(IDBBackingStore::Transaction*, int64_t rowId, const String& version); virtual bool updateIDBDatabaseIntVersion(IDBBackingStore::Transaction*, int64_t rowId, int64_t intVersion); diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp index 2eacb319c..e3ec15b29 100644 --- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp +++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp @@ -422,6 +422,7 @@ PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context ASSERT(!ec); if (ec) return 0; + indexRequest->preventPropagation(); // This is kept alive by being the success handler of the request, which is in turn kept alive by the owning transaction. RefPtr<IndexPopulator> indexPopulator = IndexPopulator::create(m_backend, m_transaction->backend(), indexRequest, metadata); diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h index 4353db9ff..c6ea13c50 100644 --- a/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h +++ b/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h @@ -27,6 +27,7 @@ #define IDBObjectStoreBackendInterface_h #include "IDBCursor.h" +#include "IDBTransactionBackendInterface.h" #include <wtf/Threading.h> #include <wtf/text/WTFString.h> diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp index 3f6f9cd84..0b502d742 100644 --- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp +++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp @@ -75,6 +75,7 @@ IDBRequest::IDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBAny> sourc , m_cursorFinished(false) , m_pendingCursor(0) , m_didFireUpgradeNeededEvent(false) + , m_preventPropagation(false) { if (m_transaction) { m_transaction->registerRequest(this); @@ -458,7 +459,7 @@ bool IDBRequest::dispatchEvent(PassRefPtr<Event> event) Vector<RefPtr<EventTarget> > targets; targets.append(this); - if (m_transaction) { + if (m_transaction && !m_preventPropagation) { targets.append(m_transaction); // If there ever are events that are associated with a database but // that do not have a transaction, then this will not work and we need diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBRequest.h index cab065120..899783853 100644 --- a/Source/WebCore/Modules/indexeddb/IDBRequest.h +++ b/Source/WebCore/Modules/indexeddb/IDBRequest.h @@ -61,6 +61,7 @@ public: String webkitErrorMessage(ExceptionCode&) const; PassRefPtr<IDBAny> source() const; PassRefPtr<IDBTransaction> transaction() const; + void preventPropagation() { m_preventPropagation = true; } // Defined in the IDL enum ReadyState { @@ -151,6 +152,7 @@ private: RefPtr<IDBKey> m_cursorPrimaryKey; ScriptValue m_cursorValue; bool m_didFireUpgradeNeededEvent; + bool m_preventPropagation; EventTargetData m_eventTargetData; }; diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h index d673c02d9..89939bf85 100644 --- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h +++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h @@ -35,8 +35,6 @@ #include "EventListener.h" #include "EventNames.h" #include "EventTarget.h" -#include "IDBMetadata.h" -#include "IDBTransactionBackendInterface.h" #include "IDBTransactionCallbacks.h" #include <wtf/HashSet.h> #include <wtf/RefCounted.h> @@ -47,6 +45,8 @@ class IDBCursor; class IDBDatabase; class IDBObjectStore; class IDBOpenDBRequest; +class IDBTransactionBackendInterface; +struct IDBObjectStoreMetadata; class IDBTransaction : public IDBTransactionCallbacks, public EventTarget, public ActiveDOMObject { public: diff --git a/Source/WebCore/Modules/mediastream/MediaStream.cpp b/Source/WebCore/Modules/mediastream/MediaStream.cpp index ce8e2655e..3da312117 100644 --- a/Source/WebCore/Modules/mediastream/MediaStream.cpp +++ b/Source/WebCore/Modules/mediastream/MediaStream.cpp @@ -88,7 +88,7 @@ MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStream : ContextDestructionObserver(context) , m_descriptor(streamDescriptor) { - m_descriptor->setOwner(this); + m_descriptor->setClient(this); MediaStreamTrackVector audioTrackVector; size_t numberOfAudioTracks = m_descriptor->numberOfAudioComponents(); @@ -107,7 +107,7 @@ MediaStream::MediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStream MediaStream::~MediaStream() { - m_descriptor->setOwner(0); + m_descriptor->setClient(0); m_audioTracks->detachOwner(); m_videoTracks->detachOwner(); } diff --git a/Source/WebCore/Modules/mediastream/MediaStream.h b/Source/WebCore/Modules/mediastream/MediaStream.h index fc8d6679e..642ec0f92 100644 --- a/Source/WebCore/Modules/mediastream/MediaStream.h +++ b/Source/WebCore/Modules/mediastream/MediaStream.h @@ -37,7 +37,7 @@ namespace WebCore { -class MediaStream : public RefCounted<MediaStream>, public MediaStreamDescriptorOwner, public EventTarget, public ContextDestructionObserver { +class MediaStream : public RefCounted<MediaStream>, public MediaStreamDescriptorClient, public EventTarget, public ContextDestructionObserver { public: enum ReadyState { LIVE = 1, @@ -58,7 +58,7 @@ public: virtual bool isLocal() const { return false; } - // MediaStreamDescriptorOwner + // MediaStreamDescriptorClient virtual void streamEnded() OVERRIDE; MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } @@ -82,7 +82,7 @@ private: virtual void refEventTarget() OVERRIDE { ref(); } virtual void derefEventTarget() OVERRIDE { deref(); } - // MediaStreamDescriptorOwner + // MediaStreamDescriptorClient virtual void addTrack(MediaStreamComponent*) OVERRIDE; virtual void removeTrack(MediaStreamComponent*) OVERRIDE; diff --git a/Source/WebCore/Modules/mediastream/PeerConnection00.cpp b/Source/WebCore/Modules/mediastream/PeerConnection00.cpp index 8556d08c1..89fc607fa 100644 --- a/Source/WebCore/Modules/mediastream/PeerConnection00.cpp +++ b/Source/WebCore/Modules/mediastream/PeerConnection00.cpp @@ -412,9 +412,9 @@ void PeerConnection00::didAddRemoteStream(PassRefPtr<MediaStreamDescriptor> stre void PeerConnection00::didRemoveRemoteStream(MediaStreamDescriptor* streamDescriptor) { ASSERT(scriptExecutionContext()->isContextThread()); - ASSERT(streamDescriptor->owner()); + ASSERT(streamDescriptor->client()); - RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->owner()); + RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->client()); stream->streamEnded(); if (m_readyState == CLOSED) diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp index d2f90723e..8583517f8 100644 --- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp +++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp @@ -483,9 +483,9 @@ void RTCPeerConnection::didAddRemoteStream(PassRefPtr<MediaStreamDescriptor> str void RTCPeerConnection::didRemoveRemoteStream(MediaStreamDescriptor* streamDescriptor) { ASSERT(scriptExecutionContext()->isContextThread()); - ASSERT(streamDescriptor->owner()); + ASSERT(streamDescriptor->client()); - RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->owner()); + RefPtr<MediaStream> stream = static_cast<MediaStream*>(streamDescriptor->client()); stream->streamEnded(); if (m_readyState == ReadyStateClosed) diff --git a/Source/WebCore/Modules/notifications/NotificationCenter.cpp b/Source/WebCore/Modules/notifications/NotificationCenter.cpp index 326976d71..0ebb54740 100644 --- a/Source/WebCore/Modules/notifications/NotificationCenter.cpp +++ b/Source/WebCore/Modules/notifications/NotificationCenter.cpp @@ -55,11 +55,6 @@ NotificationCenter::NotificationCenter(ScriptExecutionContext* context, Notifica { } -Document* NotificationCenter::document() const { - ScriptExecutionContext* context = scriptExecutionContext(); - return context->isDocument() ? static_cast<Document*>(context) : 0; -} - #if ENABLE(LEGACY_NOTIFICATIONS) int NotificationCenter::checkPermission() { diff --git a/Source/WebCore/Modules/notifications/NotificationCenter.h b/Source/WebCore/Modules/notifications/NotificationCenter.h index b17de9d5d..3f6d68902 100644 --- a/Source/WebCore/Modules/notifications/NotificationCenter.h +++ b/Source/WebCore/Modules/notifications/NotificationCenter.h @@ -85,7 +85,6 @@ public: int checkPermission(); void requestPermission(PassRefPtr<VoidCallback>); #endif - Document* document() const; virtual void stop() OVERRIDE; diff --git a/Source/WebCore/Resources/pagepopups/calendarPicker.css b/Source/WebCore/Resources/pagepopups/calendarPicker.css index 8133d71b0..330ac3dd6 100644 --- a/Source/WebCore/Resources/pagepopups/calendarPicker.css +++ b/Source/WebCore/Resources/pagepopups/calendarPicker.css @@ -219,3 +219,8 @@ body { .cancel-button { float: right; } + +.preparing .available, +.preparing .unavailable { + -webkit-transition: none; +} diff --git a/Source/WebCore/Resources/pagepopups/calendarPicker.js b/Source/WebCore/Resources/pagepopups/calendarPicker.js index c2d3deb16..f599c96e9 100644 --- a/Source/WebCore/Resources/pagepopups/calendarPicker.js +++ b/Source/WebCore/Resources/pagepopups/calendarPicker.js @@ -310,6 +310,9 @@ function openCalendarPicker() { function CalendarPicker(element, config) { Picker.call(this, element, config); this._element.classList.add("calendar-picker"); + this._element.classList.add("preparing"); + this._handleWindowResizeBound = this._handleWindowResize.bind(this); + window.addEventListener("resize", this._handleWindowResizeBound, false); // We assume this._config.min is a valid date. this.minimumDate = (typeof this._config.min !== "undefined") ? parseDateString(this._config.min) : CalendarPicker.MinimumPossibleDate; // We assume this._config.max is a valid date. @@ -339,6 +342,10 @@ CalendarPicker.MaximumPossibleDate = new Date(8640000000000000.0); CalendarPicker.DefaultStepScaleFactor = 86400000; CalendarPicker.DefaultStepBase = 0.0; +CalendarPicker.prototype._handleWindowResize = function() { + this._element.classList.remove("preparing"); +}; + CalendarPicker.prototype.cleanup = function() { document.body.removeEventListener("keydown", this._handleBodyKeyDownBound, false); }; diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri index 9346b471e..0dd49e7a3 100644 --- a/Source/WebCore/Target.pri +++ b/Source/WebCore/Target.pri @@ -318,6 +318,7 @@ SOURCES += \ css/SelectorChecker.cpp \ css/ShadowValue.cpp \ css/StyleBuilder.cpp \ + css/StyleInvalidationAnalysis.cpp \ css/StyleMedia.cpp \ css/StylePropertySet.cpp \ css/StylePropertyShorthand.cpp \ @@ -1490,6 +1491,7 @@ HEADERS += \ css/SiblingTraversalStrategies.h \ css/StyleMedia.h \ css/StyleBuilder.h \ + css/StyleInvalidationAnalysis.h \ css/StylePropertySet.h \ css/StylePropertyShorthand.h \ css/StyleResolver.h \ @@ -3894,6 +3896,7 @@ enable?(WEBGL) { html/canvas/OESStandardDerivatives.h \ html/canvas/OESTextureFloat.h \ html/canvas/OESVertexArrayObject.h \ + html/canvas/OESElementIndexUint.h \ html/canvas/WebGLTexture.h \ html/canvas/WebGLUniformLocation.h \ html/canvas/WebGLVertexArrayObjectOES.h \ @@ -3927,6 +3930,7 @@ enable?(WEBGL) { html/canvas/OESStandardDerivatives.cpp \ html/canvas/OESTextureFloat.cpp \ html/canvas/OESVertexArrayObject.cpp \ + html/canvas/OESElementIndexUint.cpp \ html/canvas/WebGLTexture.cpp \ html/canvas/WebGLUniformLocation.cpp \ html/canvas/WebGLVertexArrayObjectOES.cpp diff --git a/Source/WebCore/UseV8.cmake b/Source/WebCore/UseV8.cmake index 5cd42c803..5cd42c803 100755..100644 --- a/Source/WebCore/UseV8.cmake +++ b/Source/WebCore/UseV8.cmake diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in index bc6fd9bbc..278d224c9 100644 --- a/Source/WebCore/WebCore.exp.in +++ b/Source/WebCore/WebCore.exp.in @@ -400,6 +400,7 @@ __ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE __ZN7WebCore15setDOMExceptionEPN3JSC9ExecStateEi __ZN7WebCore15toDOMStringListEPN3JSC9ExecStateENS0_7JSValueE __ZN7WebCore15visitedLinkHashEPKtj +__ZN7WebCore15visitedLinkHashERKN3WTF6StringE __ZN7WebCore16AbstractDatabase14setIsAvailableEb __ZN7WebCore16ApplicationCache18diskUsageForOriginEPNS_14SecurityOriginE __ZN7WebCore16ApplicationCache20deleteCacheForOriginEPNS_14SecurityOriginE @@ -629,6 +630,7 @@ __ZN7WebCore25HistoryPropertyListWriterC2Ev __ZN7WebCore25ImmutableStylePropertySetD1Ev __ZN7WebCore25addLanguageChangeObserverEPvPFvS0_E __ZN7WebCore25computeViewportAttributesENS_17ViewportArgumentsEiiifNS_7IntSizeE +__ZN7WebCore25jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_ __ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv __ZN7WebCore26UserTypingGestureIndicator28focusedElementAtGestureStartEv __ZN7WebCore26stopObservingCookieChangesEv @@ -702,7 +704,6 @@ __ZN7WebCore4Page22allVisitedStateChangedEPNS_9PageGroupE __ZN7WebCore4Page23clearUndoRedoOperationsEv __ZN7WebCore4Page24resumeScriptedAnimationsEv __ZN7WebCore4Page25suspendScriptedAnimationsEv -__ZN7WebCore4Page27setJavaScriptURLsAreAllowedEb __ZN7WebCore4Page31setCustomHTMLTokenizerChunkSizeEi __ZN7WebCore4Page31setCustomHTMLTokenizerTimeDelayEd __ZN7WebCore4Page32setMemoryCacheClientCallsEnabledEb @@ -730,7 +731,7 @@ __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE __ZN7WebCore50restrictScaleFactorToInitialScaleIfNotUserScalableERNS_18ViewportAttributesE __ZN7WebCore5Color11transparentE __ZN7WebCore5Color5whiteE -__ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b +__ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_RKNS_7IntRectEbNS_13ScrollbarModeEbSA_b __ZN7WebCore5Frame13rangeForPointERKNS_8IntPointE __ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE __ZN7WebCore5Frame17setPageZoomFactorEf @@ -2305,8 +2306,7 @@ __ZN7WebCore28InspectorFrontendClientLocal14frontendLoadedEv __ZN7WebCore28InspectorFrontendClientLocal15canAttachWindowEv __ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb __ZN7WebCore28InspectorFrontendClientLocal18isDebuggingEnabledEv -__ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv -__ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv +__ZN7WebCore28InspectorFrontendClientLocal18requestSetDockSideENS_23InspectorFrontendClient8DockSideE __ZN7WebCore28InspectorFrontendClientLocal19setDebuggingEnabledEb __ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv __ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKN3WTF6StringE @@ -2361,7 +2361,6 @@ __NPN_UTF8FromIdentifier __ZN7WebCore16ScriptController20windowScriptNPObjectEv __ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv __ZN7WebCore17HTMLPlugInElement11getNPObjectEv -__ZN7WebCore25jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_ __ZNK7WebCore14SecurityOrigin9canAccessEPKS0_ __ZNK7WebCore4KURL7hasPathEv #endif diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi index c9fda66b4..08c5d67f3 100644 --- a/Source/WebCore/WebCore.gypi +++ b/Source/WebCore/WebCore.gypi @@ -1162,6 +1162,7 @@ 'html/canvas/OESStandardDerivatives.idl', 'html/canvas/OESTextureFloat.idl', 'html/canvas/OESVertexArrayObject.idl', + 'html/canvas/OESElementIndexUint.idl', 'html/canvas/Uint16Array.idl', 'html/canvas/Uint32Array.idl', 'html/canvas/Uint8Array.idl', @@ -2636,6 +2637,8 @@ 'css/SiblingTraversalStrategies.h', 'css/StyleBuilder.cpp', 'css/StyleBuilder.h', + 'css/StyleInvalidationAnalysis.cpp', + 'css/StyleInvalidationAnalysis.h', 'css/StyleMedia.cpp', 'css/StyleMedia.h', 'css/StylePropertySet.cpp', @@ -4321,6 +4324,8 @@ 'html/canvas/OESTextureFloat.h', 'html/canvas/OESVertexArrayObject.cpp', 'html/canvas/OESVertexArrayObject.h', + 'html/canvas/OESElementIndexUint.cpp', + 'html/canvas/OESElementIndexUint.h', 'html/canvas/WebGLActiveInfo.h', 'html/canvas/WebGLBuffer.cpp', 'html/canvas/WebGLBuffer.h', @@ -4914,6 +4919,8 @@ 'platform/graphics/chromium/CompositorHUDFontAtlas.h', 'platform/graphics/chromium/CrossProcessFontLoading.h', 'platform/graphics/chromium/CrossProcessFontLoading.mm', + 'platform/graphics/chromium/DeferredImageDecoder.cpp', + 'platform/graphics/chromium/DeferredImageDecoder.h', 'platform/graphics/chromium/DrawingBufferChromium.cpp', 'platform/graphics/chromium/Extensions3DChromium.h', 'platform/graphics/chromium/FontCacheAndroid.cpp', @@ -4933,10 +4940,18 @@ 'platform/graphics/chromium/IconChromiumAndroid.cpp', 'platform/graphics/chromium/ImageBufferDataSkia.h', 'platform/graphics/chromium/ImageChromium.cpp', + 'platform/graphics/chromium/ImageDecodingStore.cpp', + 'platform/graphics/chromium/ImageDecodingStore.h', + 'platform/graphics/chromium/ImageFrameGenerator.cpp', + 'platform/graphics/chromium/ImageFrameGenerator.h', + 'platform/graphics/chromium/LazyDecodingPixelRef.cpp', + 'platform/graphics/chromium/LazyDecodingPixelRef.h', 'platform/graphics/chromium/MediaPlayerPrivateChromium.h', 'platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp', 'platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.h', 'platform/graphics/chromium/PlatformIcon.h', + 'platform/graphics/chromium/ScaledImageFragment.cpp', + 'platform/graphics/chromium/ScaledImageFragment.h', 'platform/graphics/chromium/SimpleFontDataChromiumWin.cpp', 'platform/graphics/chromium/TransparencyWin.cpp', 'platform/graphics/chromium/TransparencyWin.h', @@ -7798,6 +7813,8 @@ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESTextureFloat.h', '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESVertexArrayObject.cpp', '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESVertexArrayObject.h', + '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESElementIndexUint.cpp', + '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESElementIndexUint.h', '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOverflowEvent.cpp', '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOverflowEvent.h', '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPageTransitionEvent.cpp', diff --git a/Source/WebCore/WebCore.order b/Source/WebCore/WebCore.order index cec0f748f..503ebd731 100644 --- a/Source/WebCore/WebCore.order +++ b/Source/WebCore/WebCore.order @@ -31742,7 +31742,6 @@ __Z3kitPN7WebCore17CSSPrimitiveValueE -[DOMRange collapse:] -[DOMText splitText:] -[DOMRange setStartAfter:] -__ZN7WebCore4Page27setJavaScriptURLsAreAllowedEb __ZN3WTF9HashTableIPN7WebCore18CSSParserValueListES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E16lookupForWritingERKS3_ __ZN3WTF9HashTableIPN7WebCore18CSSParserValueListES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E4findIS3_NS_22IdentityHashTranslatorIS3_S3_S7_EEEENS_17HashTableIteratorIS3_S3_S5_S7_S9_S9_EERKT_ __ZN7WebCoreL32max_device_widthMediaFeatureEvalEPNS_8CSSValueEPNS_11RenderStyleEPNS_5FrameENS_18MediaFeaturePrefixE diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj index c064b78e7..8e4d8515f 100755 --- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj +++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj @@ -37786,6 +37786,14 @@ RelativePath="..\css\StyleBuilder.h"
>
</File>
+ <File
+ RelativePath="..\css\StyleInvalidationAnalysis.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\css\StyleInvalidationAnalysis.h"
+ >
+ </File>
<File
RelativePath="..\css\StyleMedia.cpp"
>
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj index d3d4b6944..3689f46b6 100644 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj @@ -1634,6 +1634,8 @@ 52CCA9E815E3F64C0053C77F /* DOMDOMNamedFlowCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 52CCA9E515E3F64C0053C77F /* DOMDOMNamedFlowCollection.h */; }; 52CCA9E915E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52CCA9E615E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm */; }; 52CCA9EA15E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 52CCA9E715E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h */; }; + 52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */; }; + 52F10866162B6DA8009AC81E /* MixedContentChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F10863162B6D82009AC81E /* MixedContentChecker.h */; settings = {ATTRIBUTES = (Private, ); }; }; 52F52E1114A0134F00ACC397 /* NSScrollerImpDetails.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */; }; 5317612213C516690026E454 /* StyleFlexibleBoxData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5317612013C516690026E454 /* StyleFlexibleBoxData.cpp */; }; 5317612313C516690026E454 /* StyleFlexibleBoxData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5317612113C516690026E454 /* StyleFlexibleBoxData.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1756,7 +1758,6 @@ 656D373E0ADBA5DE00A4554D /* FrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37260ADBA5DE00A4554D /* FrameLoaderClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 656D373F0ADBA5DE00A4554D /* ResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37270ADBA5DE00A4554D /* ResourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; 656D37410ADBA5DE00A4554D /* MainResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37290ADBA5DE00A4554D /* MainResourceLoader.h */; }; - 52F10866162B6DA8009AC81E /* MixedContentChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F10863162B6D82009AC81E /* MixedContentChecker.h */; settings = {ATTRIBUTES = (Private, ); }; }; 656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D372B0ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; 656D37480ADBA5DE00A4554D /* SubresourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D37300ADBA5DE00A4554D /* SubresourceLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6571DCC81385E6A400702DD0 /* MemoryPressureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 657EDA071385CB97004E0645 /* MemoryPressureHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1997,6 +1998,10 @@ 7E12E91015FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E12E90E15FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp */; }; 7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E33CD00127F340D00BE8F17 /* PurgePriority.h */; settings = {ATTRIBUTES = (Private, ); }; }; 7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */; }; + 7E46F6FA1627A2CA00062223 /* JSOESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */; }; + 7E46F6FB1627A2CA00062223 /* JSOESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */; }; + 7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */; }; + 7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */; }; 7E99AF510B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */; }; 7E99AF530B13846468FB01A5 /* WindowFocusAllowedIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 7EE6845F12D26E3800E79415 /* AuthenticationCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EE6844C12D26E3800E79415 /* AuthenticationCF.cpp */; }; @@ -3338,7 +3343,6 @@ 93D9D53C0DA27E180077216C /* RangeBoundaryPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; 93E227E00AF589AD00D48324 /* DocumentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */; }; 93E227E10AF589AD00D48324 /* MainResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DC0AF589AD00D48324 /* MainResourceLoader.cpp */; }; - 52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */; }; 93E227E30AF589AD00D48324 /* ResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */; }; 93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */; }; 93E241FF0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E241FE0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -6153,6 +6157,8 @@ E45322AB140CE267005A0F92 /* SelectorQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45322A9140CE267005A0F92 /* SelectorQuery.cpp */; }; E45322AC140CE267005A0F92 /* SelectorQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = E45322AA140CE267005A0F92 /* SelectorQuery.h */; }; E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; + E47127CA163438A100ED6F5A /* StyleInvalidationAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */; }; + E47127CB163438AE00ED6F5A /* StyleInvalidationAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */; }; E4778B7F115A581A00B5D372 /* JSCustomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4778B7D115A581A00B5D372 /* JSCustomEvent.cpp */; }; E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E4778B7E115A581A00B5D372 /* JSCustomEvent.h */; }; E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = E47B4BE60E71241600038854 /* CachedResourceHandle.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -8838,6 +8844,8 @@ 52CCA9E515E3F64C0053C77F /* DOMDOMNamedFlowCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMNamedFlowCollection.h; sourceTree = "<group>"; }; 52CCA9E615E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMDOMNamedFlowCollection.mm; sourceTree = "<group>"; }; 52CCA9E715E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMNamedFlowCollectionInternal.h; sourceTree = "<group>"; }; + 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MixedContentChecker.cpp; sourceTree = "<group>"; }; + 52F10863162B6D82009AC81E /* MixedContentChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MixedContentChecker.h; sourceTree = "<group>"; }; 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSScrollerImpDetails.mm; sourceTree = "<group>"; }; 5317612013C516690026E454 /* StyleFlexibleBoxData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleFlexibleBoxData.cpp; path = style/StyleFlexibleBoxData.cpp; sourceTree = "<group>"; }; 5317612113C516690026E454 /* StyleFlexibleBoxData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleFlexibleBoxData.h; path = style/StyleFlexibleBoxData.h; sourceTree = "<group>"; }; @@ -8968,7 +8976,6 @@ 656D37260ADBA5DE00A4554D /* FrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoaderClient.h; sourceTree = "<group>"; }; 656D37270ADBA5DE00A4554D /* ResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceLoader.h; sourceTree = "<group>"; }; 656D37290ADBA5DE00A4554D /* MainResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MainResourceLoader.h; sourceTree = "<group>"; }; - 52F10863162B6D82009AC81E /* MixedContentChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MixedContentChecker.h; sourceTree = "<group>"; }; 656D372B0ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NetscapePlugInStreamLoader.h; sourceTree = "<group>"; }; 656D37300ADBA5DE00A4554D /* SubresourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SubresourceLoader.h; sourceTree = "<group>"; }; 657EDA061385CB97004E0645 /* MemoryPressureHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryPressureHandler.cpp; sourceTree = "<group>"; }; @@ -9236,6 +9243,10 @@ 7E12E90E15FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomFilterMeshGenerator.cpp; path = filters/CustomFilterMeshGenerator.cpp; sourceTree = "<group>"; }; 7E33CD00127F340D00BE8F17 /* PurgePriority.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgePriority.h; sourceTree = "<group>"; }; 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SubresourceLoaderCF.cpp; path = cf/SubresourceLoaderCF.cpp; sourceTree = "<group>"; }; + 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESElementIndexUint.cpp; sourceTree = "<group>"; }; + 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESElementIndexUint.h; sourceTree = "<group>"; }; + 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESElementIndexUint.cpp; path = canvas/OESElementIndexUint.cpp; sourceTree = "<group>"; }; + 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESElementIndexUint.h; path = canvas/OESElementIndexUint.h; sourceTree = "<group>"; }; 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFocusAllowedIndicator.cpp; sourceTree = "<group>"; }; 7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFocusAllowedIndicator.h; sourceTree = "<group>"; }; 7EE6844C12D26E3800E79415 /* AuthenticationCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationCF.cpp; sourceTree = "<group>"; }; @@ -10554,7 +10565,6 @@ 93D9D53B0DA27E180077216C /* RangeBoundaryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangeBoundaryPoint.h; sourceTree = "<group>"; }; 93E227DB0AF589AD00D48324 /* DocumentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentLoader.cpp; sourceTree = "<group>"; }; 93E227DC0AF589AD00D48324 /* MainResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainResourceLoader.cpp; sourceTree = "<group>"; }; - 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MixedContentChecker.cpp; sourceTree = "<group>"; }; 93E227DD0AF589AD00D48324 /* NetscapePlugInStreamLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePlugInStreamLoader.cpp; sourceTree = "<group>"; }; 93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoader.cpp; sourceTree = "<group>"; }; 93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubresourceLoader.cpp; sourceTree = "<group>"; }; @@ -13554,6 +13564,8 @@ E462A4A0113E71BE004A4220 /* IntPointHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntPointHash.h; sourceTree = "<group>"; }; E4778B7D115A581A00B5D372 /* JSCustomEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomEvent.cpp; sourceTree = "<group>"; }; E4778B7E115A581A00B5D372 /* JSCustomEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomEvent.h; sourceTree = "<group>"; }; + E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleInvalidationAnalysis.cpp; sourceTree = "<group>"; }; + E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleInvalidationAnalysis.h; sourceTree = "<group>"; }; E47B4BE60E71241600038854 /* CachedResourceHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedResourceHandle.h; sourceTree = "<group>"; }; E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceHandle.cpp; sourceTree = "<group>"; }; E47E276416036ED200EE2AFB /* DocumentStyleSheetCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentStyleSheetCollection.h; sourceTree = "<group>"; }; @@ -15144,6 +15156,8 @@ 49484FAE102CF01E00187DD3 /* canvas */ = { isa = PBXGroup; children = ( + 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */, + 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */, 49EECDCC10503C2300099FAB /* ArrayBuffer.idl */, 49EECDC910503C2300099FAB /* ArrayBufferView.idl */, 6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */, @@ -18493,6 +18507,8 @@ CDB859F9160D493E00E5B07F /* JSMediaKeyEvent.h */, 1059457515B42A0D004D37FD /* JSMicroDataItemValue.cpp */, 1059457915B42A43004D37FD /* JSMicroDataItemValue.h */, + 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */, + 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */, 9001787E12E0370700648462 /* JSOESStandardDerivatives.cpp */, 9001787F12E0370700648462 /* JSOESStandardDerivatives.h */, 6EBF0E7412A9868800DB1709 /* JSOESTextureFloat.cpp */, @@ -21301,6 +21317,8 @@ 5728BD9D1625369600C40B56 /* SiblingTraversalStrategies.h */, E100EE731546EAC100BA11D1 /* StyleBuilder.cpp */, E100EE741546EAC100BA11D1 /* StyleBuilder.h */, + E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */, + E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */, 0FF5026E102BA9660066F39A /* StyleMedia.cpp */, 0FF5026F102BA96A0066F39A /* StyleMedia.h */, 0FF50270102BA96A0066F39A /* StyleMedia.idl */, @@ -25621,6 +25639,9 @@ E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */, 977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */, FD537353137B651800008DCE /* ZeroPole.h in Headers */, + 7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */, + 7E46F6FB1627A2CA00062223 /* JSOESElementIndexUint.h in Headers */, + E47127CB163438AE00ED6F5A /* StyleInvalidationAnalysis.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -28728,6 +28749,9 @@ E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */, 977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */, FD537352137B651800008DCE /* ZeroPole.cpp in Sources */, + 7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */, + 7E46F6FA1627A2CA00062223 /* JSOESElementIndexUint.cpp in Sources */, + E47127CA163438A100ED6F5A /* StyleInvalidationAnalysis.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp index 8e32eb501..665abc087 100644 --- a/Source/WebCore/accessibility/AXObjectCache.cpp +++ b/Source/WebCore/accessibility/AXObjectCache.cpp @@ -316,8 +316,14 @@ AccessibilityObject* AXObjectCache::getOrCreate(Node* node) if (node->renderer()) return getOrCreate(node->renderer()); + if (!node->parentElement()) + return 0; + // It's only allowed to create an AccessibilityObject from a Node if it's in a canvas subtree. - if (!node->parentElement() || !node->parentElement()->isInCanvasSubtree()) + // Or if it's a hidden element, but we still want to expose it because of other ARIA attributes. + bool inCanvasSubtree = node->parentElement()->isInCanvasSubtree(); + bool isHidden = !node->renderer() && isNodeAriaVisible(node); + if (!inCanvasSubtree && !isHidden) return 0; RefPtr<AccessibilityObject> newObj = createFromNode(node); @@ -783,6 +789,17 @@ bool AXObjectCache::nodeIsTextControl(const Node* node) const AccessibilityObject* axObject = getOrCreate(const_cast<Node*>(node)); return axObject && axObject->isTextControl(); } + +bool isNodeAriaVisible(Node* node) +{ + if (!node) + return false; + + if (!node->isElementNode()) + return false; + + return equalIgnoringCase(toElement(node)->getAttribute(aria_hiddenAttr), "false"); +} } // namespace WebCore diff --git a/Source/WebCore/accessibility/AXObjectCache.h b/Source/WebCore/accessibility/AXObjectCache.h index 8f0f76567..fdfd5afbf 100644 --- a/Source/WebCore/accessibility/AXObjectCache.h +++ b/Source/WebCore/accessibility/AXObjectCache.h @@ -208,7 +208,9 @@ private: }; bool nodeHasRole(Node*, const String& role); - +// This will let you know if aria-hidden was explicitly set to false. +bool isNodeAriaVisible(Node*); + #if !HAVE(ACCESSIBILITY) inline AXObjectCache::AXObjectCache(const Document* doc) : m_document(const_cast<Document*>(doc)), m_notificationPostTimer(this, 0) { } inline AXObjectCache::~AXObjectCache() { } @@ -224,6 +226,7 @@ inline AccessibilityObject* AXObjectCache::rootObject() { return 0; } inline AccessibilityObject* AXObjectCache::rootObjectForFrame(Frame*) { return 0; } inline Element* AXObjectCache::rootAXEditableElement(Node*) { return 0; } inline bool nodeHasRole(Node*, const String&) { return false; } +inline bool isNodeAriaVisible(Node*) { return true; } inline const Element* AXObjectCache::rootAXEditableElement(const Node*) { return 0; } inline void AXObjectCache::attachWrapper(AccessibilityObject*) { } inline void AXObjectCache::checkedStateChanged(Node*) { } diff --git a/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp b/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp index 5e2106bae..22322879a 100644 --- a/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp +++ b/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp @@ -66,7 +66,7 @@ PassRefPtr<AccessibilityARIAGrid> AccessibilityARIAGrid::create(RenderObject* re return adoptRef(obj); } -bool AccessibilityARIAGrid::addChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount) +bool AccessibilityARIAGrid::addTableCellChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount) { if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole) return false; @@ -114,7 +114,7 @@ void AccessibilityARIAGrid::addChildren() unsigned columnCount = 0; for (RefPtr<AccessibilityObject> child = firstChild(); child; child = child->nextSibling()) { - if (!addChild(child.get(), appendedRows, columnCount)) { + if (!addTableCellChild(child.get(), appendedRows, columnCount)) { // in case the render tree doesn't match the expected ARIA hierarchy, look at the children if (!child->hasChildren()) @@ -125,7 +125,7 @@ void AccessibilityARIAGrid::addChildren() AccessibilityChildrenVector children = child->children(); size_t length = children.size(); for (size_t i = 0; i < length; ++i) - addChild(children[i].get(), appendedRows, columnCount); + addTableCellChild(children[i].get(), appendedRows, columnCount); } } diff --git a/Source/WebCore/accessibility/AccessibilityARIAGrid.h b/Source/WebCore/accessibility/AccessibilityARIAGrid.h index 67e8804f3..02da5b19f 100644 --- a/Source/WebCore/accessibility/AccessibilityARIAGrid.h +++ b/Source/WebCore/accessibility/AccessibilityARIAGrid.h @@ -58,7 +58,7 @@ private: virtual bool supportsSelectedRows() { return true; } virtual bool isMultiSelectable() const { return true; } - bool addChild(AccessibilityObject*, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount); + bool addTableCellChild(AccessibilityObject*, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount); }; } // namespace WebCore diff --git a/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp b/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp index 13ff212f2..9089f66f3 100644 --- a/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp +++ b/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp @@ -94,6 +94,21 @@ KURL AccessibilityImageMapLink::url() const return m_areaElement->href(); } + +void AccessibilityImageMapLink::accessibilityText(Vector<AccessibilityText>& textOrder) +{ + String description = accessibilityDescription(); + if (!description.isEmpty()) + textOrder.append(AccessibilityText(description, AlternativeText)); + + const AtomicString& titleText = getAttribute(titleAttr); + if (!titleText.isEmpty()) + textOrder.append(AccessibilityText(titleText, TitleTagText)); + + const AtomicString& summary = getAttribute(summaryAttr); + if (!summary.isEmpty()) + textOrder.append(AccessibilityText(summary, SummaryText)); +} String AccessibilityImageMapLink::accessibilityDescription() const { diff --git a/Source/WebCore/accessibility/AccessibilityImageMapLink.h b/Source/WebCore/accessibility/AccessibilityImageMapLink.h index bc6ce3cb9..0447b6381 100644 --- a/Source/WebCore/accessibility/AccessibilityImageMapLink.h +++ b/Source/WebCore/accessibility/AccessibilityImageMapLink.h @@ -73,6 +73,7 @@ private: RefPtr<HTMLAreaElement> m_areaElement; RefPtr<HTMLMapElement> m_mapElement; + virtual void accessibilityText(Vector<AccessibilityText>&); virtual bool isImageMapLink() const { return true; } }; diff --git a/Source/WebCore/accessibility/AccessibilityMediaControls.cpp b/Source/WebCore/accessibility/AccessibilityMediaControls.cpp index 3d380df1a..887c7e2f4 100644 --- a/Source/WebCore/accessibility/AccessibilityMediaControls.cpp +++ b/Source/WebCore/accessibility/AccessibilityMediaControls.cpp @@ -140,6 +140,22 @@ String AccessibilityMediaControl::controlTypeName() const return String(); } +void AccessibilityMediaControl::accessibilityText(Vector<AccessibilityText>& textOrder) +{ + String description = accessibilityDescription(); + if (!description.isEmpty()) + textOrder.append(AccessibilityText(description, AlternativeText)); + + String title = this->title(); + if (!title.isEmpty()) + textOrder.append(AccessibilityText(title, AlternativeText)); + + String helptext = helpText(); + if (!helptext.isEmpty()) + textOrder.append(AccessibilityText(helptext, HelpText)); +} + + String AccessibilityMediaControl::title() const { DEFINE_STATIC_LOCAL(const String, controlsPanel, (ASCIILiteral("ControlsPanel"))); diff --git a/Source/WebCore/accessibility/AccessibilityMediaControls.h b/Source/WebCore/accessibility/AccessibilityMediaControls.h index 05c03ee05..30d9d5e39 100644 --- a/Source/WebCore/accessibility/AccessibilityMediaControls.h +++ b/Source/WebCore/accessibility/AccessibilityMediaControls.h @@ -54,6 +54,7 @@ protected: explicit AccessibilityMediaControl(RenderObject*); MediaControlElementType controlType() const; String controlTypeName() const; + virtual void accessibilityText(Vector<AccessibilityText>&); }; @@ -107,6 +108,7 @@ public: private: explicit AccessibilityMediaTimeDisplay(RenderObject*); + virtual bool isMediaControlLabel() const { return true; } }; diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp index 0f94838e7..49b83ea6d 100644 --- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp @@ -59,6 +59,7 @@ #include "HTMLTextFormControlElement.h" #include "HitTestRequest.h" #include "HitTestResult.h" +#include "LabelableElement.h" #include "LocalizedStrings.h" #include "MathMLNames.h" #include "NodeList.h" @@ -221,6 +222,26 @@ LayoutRect AccessibilityNodeObject::elementRect() const { return boundingBoxRect(); } + +LayoutRect AccessibilityNodeObject::boundingBoxRect() const +{ + // AccessibilityNodeObjects have no mechanism yet to return a size or position. + // For now, let's return the position of the ancestor that does have a position, + // and make it the width of that parent, and about the height of a line of text, so that it's clear the object is a child of the parent. + + LayoutRect boundingBox; + + for (AccessibilityObject* positionProvider = parentObject(); positionProvider; positionProvider = positionProvider->parentObject()) { + if (positionProvider->isAccessibilityRenderObject()) { + LayoutRect parentRect = positionProvider->elementRect(); + boundingBox.setSize(LayoutSize(parentRect.width(), FractionalLayoutUnit(std::min(10.0f, parentRect.height().toFloat())))); + boundingBox.setLocation(parentRect.location()); + break; + } + } + + return boundingBox; +} void AccessibilityNodeObject::setNode(Node* node) { @@ -283,6 +304,32 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole() return UnknownRole; } +void AccessibilityNodeObject::insertChild(AccessibilityObject* child, unsigned index) +{ + if (!child) + return; + + // If the parent is asking for this child's children, then either it's the first time (and clearing is a no-op), + // or its visibility has changed. In the latter case, this child may have a stale child cached. + // This can prevent aria-hidden changes from working correctly. Hence, whenever a parent is getting children, ensure data is not stale. + child->clearChildren(); + + if (child->accessibilityIsIgnored()) { + AccessibilityChildrenVector children = child->children(); + size_t length = children.size(); + for (size_t i = 0; i < length; ++i) + m_children.insert(index + i, children[i]); + } else { + ASSERT(child->parentObject() == this); + m_children.insert(index, child); + } +} + +void AccessibilityNodeObject::addChild(AccessibilityObject* child) +{ + insertChild(child, m_children.size()); +} + void AccessibilityNodeObject::addChildren() { // If the need to add more children in addition to existing children arises, @@ -298,19 +345,8 @@ void AccessibilityNodeObject::addChildren() if (renderer() && !m_node->hasTagName(canvasTag)) return; - for (Node* child = m_node->firstChild(); child; child = child->nextSibling()) { - RefPtr<AccessibilityObject> obj = axObjectCache()->getOrCreate(child); - obj->clearChildren(); - if (obj->accessibilityIsIgnored()) { - AccessibilityChildrenVector children = obj->children(); - size_t length = children.size(); - for (size_t i = 0; i < length; ++i) - m_children.append(children[i]); - } else { - ASSERT(obj->parentObject() == this); - m_children.append(obj); - } - } + for (Node* child = m_node->firstChild(); child; child = child->nextSibling()) + addChild(axObjectCache()->getOrCreate(child)); } bool AccessibilityNodeObject::canHaveChildren() const @@ -1001,14 +1037,18 @@ bool AccessibilityNodeObject::isGenericFocusableElement() const HTMLLabelElement* AccessibilityNodeObject::labelForElement(Element* element) const { - RefPtr<NodeList> list = element->document()->getElementsByTagName("label"); - unsigned len = list->length(); - for (unsigned i = 0; i < len; i++) { - if (list->item(i)->hasTagName(labelTag)) { - HTMLLabelElement* label = static_cast<HTMLLabelElement*>(list->item(i)); - if (label->control() == element) - return label; - } + if (!element->isHTMLElement() || !toHTMLElement(element)->isLabelable()) + return 0; + + const AtomicString& id = element->getIdAttribute(); + if (!id.isEmpty()) { + if (HTMLLabelElement* label = element->treeScope()->labelElementForId(id)) + return label; + } + + for (Element* parent = element->parentElement(); parent; parent = parent->parentElement()) { + if (parent->hasTagName(labelTag)) + return static_cast<HTMLLabelElement*>(parent); } return 0; @@ -1074,6 +1114,215 @@ AccessibilityObject* AccessibilityNodeObject::menuButtonForMenu() const return 0; } +void AccessibilityNodeObject::titleElementText(Vector<AccessibilityText>& textOrder) +{ + Node* node = this->node(); + if (!node) + return; + + bool isInputTag = node->hasTagName(inputTag); + if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl()) { + HTMLLabelElement* label = labelForElement(toElement(node)); + if (label) { + AccessibilityObject* labelObject = axObjectCache()->getOrCreate(label); + textOrder.append(AccessibilityText(label->innerText(), LabelByElementText, labelObject)); + return; + } + } + + AccessibilityObject* titleUIElement = this->titleUIElement(); + if (titleUIElement) + textOrder.append(AccessibilityText(String(), LabelByElementText, titleUIElement)); +} + +void AccessibilityNodeObject::alternativeText(Vector<AccessibilityText>& textOrder) const +{ + if (isWebArea()) { + String webAreaText = alternativeTextForWebArea(); + if (!webAreaText.isEmpty()) + textOrder.append(AccessibilityText(webAreaText, AlternativeText)); + return; + } + + ariaLabeledByText(textOrder); + + const AtomicString& ariaLabel = getAttribute(aria_labelAttr); + if (!ariaLabel.isEmpty()) + textOrder.append(AccessibilityText(ariaLabel, AlternativeText)); + + if (isImage() || isInputImage() || isNativeImage() || isCanvas()) { + // Images should use alt as long as the attribute is present, even if empty. + // Otherwise, it should fallback to other methods, like the title attribute. + const AtomicString& alt = getAttribute(altAttr); + if (!alt.isNull()) + textOrder.append(AccessibilityText(alt, AlternativeText)); + } + +#if ENABLE(MATHML) + Node* node = this->node(); + if (node && node->isElementNode() && toElement(node)->isMathMLElement()) + textOrder.append(AccessibilityText(getAttribute(MathMLNames::alttextAttr), AlternativeText)); +#endif +} + +void AccessibilityNodeObject::visibleText(Vector<AccessibilityText>& textOrder) const +{ + Node* node = this->node(); + if (!node) + return; + + bool isInputTag = node->hasTagName(inputTag); + if (isInputTag) { + HTMLInputElement* input = static_cast<HTMLInputElement*>(node); + if (input->isTextButton()) { + textOrder.append(AccessibilityText(input->valueWithDefault(), VisibleText)); + return; + } + } + + // If this node isn't rendered, there's no inner text we can extract from a select element. + if (!isAccessibilityRenderObject() && node->hasTagName(selectTag)) + return; + + bool useTextUnderElement = false; + + switch (roleValue()) { + case PopUpButtonRole: + case ButtonRole: + case ToggleButtonRole: + case CheckBoxRole: + case ListBoxOptionRole: + case MenuButtonRole: + case MenuItemRole: + case RadioButtonRole: + case TabRole: + useTextUnderElement = true; + break; + default: + break; + } + + // If it's focusable but it's not content editable or a known control type, then it will appear to + // the user as a single atomic object, so we should use its text as the default title. + if (isHeading() || isLink() || isGenericFocusableElement()) + useTextUnderElement = true; + + if (useTextUnderElement) { + String text = textUnderElement(); + if (!text.isEmpty()) + textOrder.append(AccessibilityText(text, ChildrenText)); + } +} + +void AccessibilityNodeObject::helpText(Vector<AccessibilityText>& textOrder) const +{ + const AtomicString& ariaHelp = getAttribute(aria_helpAttr); + if (!ariaHelp.isEmpty()) + textOrder.append(AccessibilityText(ariaHelp, HelpText)); + + String describedBy = ariaDescribedByAttribute(); + if (!describedBy.isEmpty()) + textOrder.append(AccessibilityText(describedBy, SummaryText)); + + // Add help type text that is derived from ancestors. + for (Node* curr = node(); curr; curr = curr->parentNode()) { + const AtomicString& summary = getAttribute(summaryAttr); + if (!summary.isEmpty()) + textOrder.append(AccessibilityText(summary, SummaryText)); + + // The title attribute should be used as help text unless it is already being used as descriptive text. + const AtomicString& title = getAttribute(titleAttr); + if (!title.isEmpty()) + textOrder.append(AccessibilityText(title, TitleTagText)); + + // Only take help text from an ancestor element if its a group or an unknown role. If help was + // added to those kinds of elements, it is likely it was meant for a child element. + AccessibilityObject* axObj = axObjectCache()->getOrCreate(curr); + if (!axObj) + return; + + AccessibilityRole role = axObj->roleValue(); + if (role != GroupRole && role != UnknownRole) + break; + } +} + +void AccessibilityNodeObject::accessibilityText(Vector<AccessibilityText>& textOrder) +{ + titleElementText(textOrder); + alternativeText(textOrder); + visibleText(textOrder); + helpText(textOrder); + + String placeholder = placeholderValue(); + if (!placeholder.isEmpty()) + textOrder.append(AccessibilityText(placeholder, PlaceholderText)); +} + +void AccessibilityNodeObject::ariaLabeledByText(Vector<AccessibilityText>& textOrder) const +{ + String ariaLabeledBy = ariaLabeledByAttribute(); + if (!ariaLabeledBy.isEmpty()) { + Vector<Element*> elements; + ariaLabeledByElements(elements); + + Vector<RefPtr<AccessibilityObject> > axElements; + unsigned length = elements.size(); + for (unsigned k = 0; k < length; k++) { + RefPtr<AccessibilityObject> axElement = axObjectCache()->getOrCreate(elements[k]); + axElements.append(axElement); + } + + textOrder.append(AccessibilityText(ariaLabeledBy, AlternativeText, axElements)); + } +} + +String AccessibilityNodeObject::alternativeTextForWebArea() const +{ + // The WebArea description should follow this order: + // aria-label on the <html> + // title on the <html> + // <title> inside the <head> (of it was set through JS) + // name on the <html> + // For iframes: + // aria-label on the <iframe> + // title on the <iframe> + // name on the <iframe> + + Document* document = this->document(); + if (!document) + return String(); + + // Check if the HTML element has an aria-label for the webpage. + if (Element* documentElement = document->documentElement()) { + const AtomicString& ariaLabel = documentElement->getAttribute(aria_labelAttr); + if (!ariaLabel.isEmpty()) + return ariaLabel; + } + + Node* owner = document->ownerElement(); + if (owner) { + if (owner->hasTagName(frameTag) || owner->hasTagName(iframeTag)) { + const AtomicString& title = static_cast<HTMLFrameElementBase*>(owner)->getAttribute(titleAttr); + if (!title.isEmpty()) + return title; + return static_cast<HTMLFrameElementBase*>(owner)->getNameAttribute(); + } + if (owner->isHTMLElement()) + return toHTMLElement(owner)->getNameAttribute(); + } + + String documentTitle = document->title(); + if (!documentTitle.isEmpty()) + return documentTitle; + + owner = document->body(); + if (owner && owner->isHTMLElement()) + return toHTMLElement(owner)->getNameAttribute(); + + return String(); +} + String AccessibilityNodeObject::accessibilityDescription() const { // Static text should not have a description, it should only have a stringValue. @@ -1186,7 +1435,9 @@ String AccessibilityNodeObject::textUnderElement() const // If this could be fixed, it'd be more accurate use TextIterator here. if (node->isElementNode()) return toElement(node)->innerText(); - + else if (node->isTextNode()) + return toText(node)->wholeText(); + return String(); } @@ -1341,6 +1592,14 @@ String AccessibilityNodeObject::accessibilityDescriptionForElements(Vector<Eleme return builder.toString(); } +String AccessibilityNodeObject::ariaDescribedByAttribute() const +{ + Vector<Element*> elements; + elementsFromAttribute(elements, aria_describedbyAttr); + + return accessibilityDescriptionForElements(elements); +} + void AccessibilityNodeObject::elementsFromAttribute(Vector<Element*>& elements, const QualifiedName& attribute) const { Node* node = this->node(); diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.h b/Source/WebCore/accessibility/AccessibilityNodeObject.h index d65b1e0ba..e1e161b22 100644 --- a/Source/WebCore/accessibility/AccessibilityNodeObject.h +++ b/Source/WebCore/accessibility/AccessibilityNodeObject.h @@ -158,6 +158,9 @@ protected: virtual AccessibilityRole determineAccessibilityRole(); virtual void addChildren(); + virtual void addChild(AccessibilityObject*); + virtual void insertChild(AccessibilityObject*, unsigned index); + virtual bool canHaveChildren() const; virtual bool accessibilityIsIgnored() const; AccessibilityRole ariaRoleAttribute() const; @@ -174,13 +177,23 @@ protected: void ariaLabeledByElements(Vector<Element*>& elements) const; String accessibilityDescriptionForElements(Vector<Element*> &elements) const; void elementsFromAttribute(Vector<Element*>& elements, const QualifiedName&) const; - + virtual LayoutRect boundingBoxRect() const; + String ariaDescribedByAttribute() const; + Element* menuElementForMenuButton() const; Element* menuItemElementForMenu() const; AccessibilityObject* menuButtonForMenu() const; private: Node* m_node; + + virtual void accessibilityText(Vector<AccessibilityText>&); + void titleElementText(Vector<AccessibilityText>&); + void alternativeText(Vector<AccessibilityText>&) const; + void visibleText(Vector<AccessibilityText>&) const; + void helpText(Vector<AccessibilityText>&) const; + String alternativeTextForWebArea() const; + void ariaLabeledByText(Vector<AccessibilityText>&) const; }; inline AccessibilityNodeObject* toAccessibilityNodeObject(AccessibilityObject* object) diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp index b9bd9a987..ed071e216 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityObject.cpp @@ -1776,6 +1776,19 @@ bool AccessibilityObject::ariaPressedIsPresent() const return !getAttribute(aria_pressedAttr).isEmpty(); } +TextIteratorBehavior AccessibilityObject::textIteratorBehaviorForTextRange() const +{ + TextIteratorBehavior behavior = TextIteratorIgnoresStyleVisibility; + +#if PLATFORM(GTK) + // We need to emit replaced elements for GTK, and present + // them with the 'object replacement character' (0xFFFC). + behavior = static_cast<TextIteratorBehavior>(behavior | TextIteratorEmitsObjectReplacementCharacters); +#endif + + return behavior; +} + AccessibilityRole AccessibilityObject::buttonRoleType() const { // If aria-pressed is present, then it should be exposed as a toggle button. diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h index be6211681..873a5c6ef 100644 --- a/Source/WebCore/accessibility/AccessibilityObject.h +++ b/Source/WebCore/accessibility/AccessibilityObject.h @@ -33,6 +33,7 @@ #include "FloatQuad.h" #include "FractionalLayoutRect.h" #include "LayoutTypes.h" +#include "TextIterator.h" #include "VisiblePosition.h" #include "VisibleSelection.h" #include <wtf/Forward.h> @@ -201,6 +202,41 @@ enum AccessibilityRole { WindowRole, }; +enum AccessibilityTextSource { + AlternativeText, + ChildrenText, + SummaryText, + HelpText, + VisibleText, + TitleTagText, + PlaceholderText, + LabelByElementText, +}; + +struct AccessibilityText { + String text; + AccessibilityTextSource textSource; + Vector<RefPtr<AccessibilityObject> > textElements; + + AccessibilityText(const String& t, const AccessibilityTextSource& s) + : text(t) + , textSource(s) + { } + + AccessibilityText(const String& t, const AccessibilityTextSource& s, const Vector<RefPtr<AccessibilityObject> > elements) + : text(t) + , textSource(s) + , textElements(elements) + { } + + AccessibilityText(const String& t, const AccessibilityTextSource& s, const RefPtr<AccessibilityObject> element) + : text(t) + , textSource(s) + { + textElements.append(element); + } +}; + enum AccessibilityOrientation { AccessibilityOrientationVertical, AccessibilityOrientationHorizontal, @@ -371,6 +407,7 @@ public: virtual bool isSpinButton() const { return roleValue() == SpinButtonRole; } virtual bool isSpinButtonPart() const { return false; } virtual bool isMockObject() const { return false; } + virtual bool isMediaControlLabel() const { return false; } bool isTextControl() const { return roleValue() == TextAreaRole || roleValue() == TextFieldRole; } bool isARIATextControl() const; bool isTabList() const { return roleValue() == TabListRole; } @@ -430,9 +467,6 @@ public: virtual bool canSetSelectedChildrenAttribute() const { return false; } virtual bool canSetExpandedAttribute() const { return false; } - // A programmatic way to set a name on an AccessibleObject. - virtual void setAccessibleName(const AtomicString&) { } - virtual Node* node() const { return 0; } virtual RenderObject* renderer() const { return 0; } virtual bool accessibilityIsIgnored() const { return true; } @@ -501,11 +535,28 @@ public: virtual bool isPresentationalChildOfAriaRole() const { return false; } virtual bool ariaRoleHasPresentationalChildren() const { return false; } - void setRoleValue(AccessibilityRole role) { m_role = role; } - virtual AccessibilityRole roleValue() const { return m_role; } + // Accessibility Text + virtual void accessibilityText(Vector<AccessibilityText>&) { }; + + // A programmatic way to set a name on an AccessibleObject. + virtual void setAccessibleName(const AtomicString&) { } + + // Accessibility Text - (To be deprecated). + virtual String accessibilityDescription() const { return String(); } + virtual String title() const { return String(); } + virtual String helpText() const { return String(); } + + // Methods for determining accessibility text. + virtual String stringValue() const { return String(); } + virtual String textUnderElement() const { return String(); } + virtual String text() const { return String(); } + virtual int textLength() const { return 0; } virtual String ariaLabeledByAttribute() const { return String(); } virtual String ariaDescribedByAttribute() const { return String(); } - virtual String accessibilityDescription() const { return String(); } + const AtomicString& placeholderValue() const; + + void setRoleValue(AccessibilityRole role) { m_role = role; } + virtual AccessibilityRole roleValue() const { return m_role; } virtual AXObjectCache* axObjectCache() const; AXID axObjectID() const { return m_id; } @@ -523,18 +574,13 @@ public: virtual IntPoint clickPoint(); static IntRect boundingBoxForQuads(RenderObject*, const Vector<FloatQuad>&); + TextIteratorBehavior textIteratorBehaviorForTextRange() const; virtual PlainTextRange selectedTextRange() const { return PlainTextRange(); } unsigned selectionStart() const { return selectedTextRange().start; } unsigned selectionEnd() const { return selectedTextRange().length; } virtual KURL url() const { return KURL(); } virtual VisibleSelection selection() const { return VisibleSelection(); } - virtual String stringValue() const { return String(); } - virtual String title() const { return String(); } - virtual String helpText() const { return String(); } - virtual String textUnderElement() const { return String(); } - virtual String text() const { return String(); } - virtual int textLength() const { return 0; } virtual String selectedText() const { return String(); } virtual const AtomicString& accessKey() const { return nullAtom; } const String& actionVerb() const; @@ -546,7 +592,6 @@ public: virtual FrameView* documentFrameView() const; String language() const; virtual unsigned hierarchicalLevel() const { return 0; } - const AtomicString& placeholderValue() const; virtual void setFocused(bool) { } virtual void setSelectedText(const String&) { } @@ -569,6 +614,9 @@ public: virtual void updateAccessibilityRole() { } const AccessibilityChildrenVector& children(); virtual void addChildren() { } + virtual void addChild(AccessibilityObject*) { } + virtual void insertChild(AccessibilityObject*, unsigned) { } + virtual bool canHaveChildren() const { return true; } virtual bool hasChildren() const { return m_haveChildren; } virtual void updateChildrenIfNecessary(); diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp index 535de5753..687716c54 100644 --- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp +++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp @@ -79,7 +79,6 @@ #include "RenderedPosition.h" #include "Text.h" #include "TextControlInnerElements.h" -#include "TextIterator.h" #include "htmlediting.h" #include "visible_units.h" #include <wtf/StdLibExtras.h> @@ -599,19 +598,6 @@ String AccessibilityRenderObject::helpText() const return String(); } -static TextIteratorBehavior textIteratorBehaviorForTextRange() -{ - TextIteratorBehavior behavior = TextIteratorIgnoresStyleVisibility; - -#if PLATFORM(GTK) - // We need to emit replaced elements for GTK, and present - // them with the 'object replacement character' (0xFFFC). - behavior = static_cast<TextIteratorBehavior>(behavior | TextIteratorEmitsObjectReplacementCharacters); -#endif - - return behavior; -} - String AccessibilityRenderObject::textUnderElement() const { if (!m_renderer) @@ -725,72 +711,6 @@ HTMLLabelElement* AccessibilityRenderObject::labelElementContainer() const return 0; } -String AccessibilityRenderObject::ariaDescribedByAttribute() const -{ - Vector<Element*> elements; - elementsFromAttribute(elements, aria_describedbyAttr); - - return accessibilityDescriptionForElements(elements); -} - -String AccessibilityRenderObject::webAreaAccessibilityDescription() const -{ - // The WebArea description should follow this order: - // aria-label on the <html> - // title on the <html> - // <title> inside the <head> (of it was set through JS) - // name on the <html> - // For iframes: - // aria-label on the <iframe> - // title on the <iframe> - // name on the <iframe> - - if (!m_renderer) - return String(); - - Document* document = m_renderer->document(); - - // Check if the HTML element has an aria-label for the webpage. - if (Element* documentElement = document->documentElement()) { - const AtomicString& ariaLabel = documentElement->getAttribute(aria_labelAttr); - if (!ariaLabel.isEmpty()) - return ariaLabel; - } - - Node* owner = document->ownerElement(); - if (owner) { - if (owner->hasTagName(frameTag) || owner->hasTagName(iframeTag)) { - const AtomicString& title = static_cast<HTMLFrameElementBase*>(owner)->getAttribute(titleAttr); - if (!title.isEmpty()) - return title; - return static_cast<HTMLFrameElementBase*>(owner)->getNameAttribute(); - } - if (owner->isHTMLElement()) - return toHTMLElement(owner)->getNameAttribute(); - } - - String documentTitle = document->title(); - if (!documentTitle.isEmpty()) - return documentTitle; - - owner = document->body(); - if (owner && owner->isHTMLElement()) - return toHTMLElement(owner)->getNameAttribute(); - - return String(); -} - -String AccessibilityRenderObject::accessibilityDescription() const -{ - if (!m_renderer) - return String(); - - if (isWebArea()) - return webAreaAccessibilityDescription(); - - return AccessibilityNodeObject::accessibilityDescription(); -} - LayoutRect AccessibilityRenderObject::boundingBoxRect() const { RenderObject* obj = m_renderer; @@ -1047,7 +967,7 @@ AccessibilityObject* AccessibilityRenderObject::titleUIElement() const // if isFieldset is true, the renderer is guaranteed to be a RenderFieldset if (isFieldset()) - return axObjectCache()->getOrCreate(toRenderFieldset(m_renderer)->findLegend()); + return axObjectCache()->getOrCreate(toRenderFieldset(m_renderer)->findLegend(RenderFieldset::IncludeFloatingOrOutOfFlow)); Node* element = m_renderer->node(); if (!element) @@ -1101,10 +1021,17 @@ AccessibilityObjectInclusion AccessibilityRenderObject::accessibilityIsIgnoredBa { // The following cases can apply to any element that's a subclass of AccessibilityRenderObject. - // Ignore invisible elements. - if (!m_renderer || m_renderer->style()->visibility() != VISIBLE) + if (!m_renderer) return IgnoreObject; + if (m_renderer->style()->visibility() != VISIBLE) { + // aria-hidden is meant to override visibility as the determinant in AX hierarchy inclusion. + if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "false")) + return DefaultBehavior; + + return IgnoreObject; + } + // Anything marked as aria-hidden or a child of something aria-hidden must be hidden. if (ariaIsHidden()) return IgnoreObject; @@ -2717,6 +2644,59 @@ void AccessibilityRenderObject::updateAttachmentViewParents() } #endif +// Hidden children are those that are not rendered or visible, but are specifically marked as aria-hidden=false, +// meaning that they should be exposed to the AX hierarchy. +void AccessibilityRenderObject::addHiddenChildren() +{ + Node* node = this->node(); + if (!node) + return; + + // First do a quick run through to determine if we have any hidden nodes (most often we will not). + // If we do have hidden nodes, we need to determine where to insert them so they match DOM order as close as possible. + bool shouldInsertHiddenNodes = false; + for (Node* child = node->firstChild(); child; child = child->nextSibling()) { + if (!child->renderer() && isNodeAriaVisible(child)) { + shouldInsertHiddenNodes = true; + break; + } + } + + if (!shouldInsertHiddenNodes) + return; + + // Iterate through all of the children, including those that may have already been added, and + // try to insert hidden nodes in the correct place in the DOM order. + unsigned insertionIndex = 0; + for (Node* child = node->firstChild(); child; child = child->nextSibling()) { + if (child->renderer()) { + // Find out where the last render sibling is located within m_children. + AccessibilityObject* childObject = axObjectCache()->get(child->renderer()); + if (childObject && childObject->accessibilityIsIgnored()) { + AccessibilityChildrenVector children = childObject->children(); + if (children.size()) + childObject = children.last().get(); + else + childObject = 0; + } + + if (childObject) + insertionIndex = m_children.find(childObject) + 1; + continue; + } + + if (!isNodeAriaVisible(child)) + continue; + + unsigned previousSize = m_children.size(); + if (insertionIndex > previousSize) + insertionIndex = previousSize; + + insertChild(axObjectCache()->getOrCreate(child), insertionIndex); + insertionIndex += (m_children.size() - previousSize); + } +} + void AccessibilityRenderObject::addChildren() { // If the need to add more children in addition to existing children arises, @@ -2728,24 +2708,10 @@ void AccessibilityRenderObject::addChildren() if (!canHaveChildren()) return; - // add all unignored acc children - for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSibling()) { - // If the parent is asking for this child's children, then either it's the first time (and clearing is a no-op), - // or its visibility has changed. In the latter case, this child may have a stale child cached. - // This can prevent aria-hidden changes from working correctly. Hence, whenever a parent is getting children, ensure data is not stale. - obj->clearChildren(); - - if (obj->accessibilityIsIgnored()) { - AccessibilityChildrenVector children = obj->children(); - unsigned length = children.size(); - for (unsigned i = 0; i < length; ++i) - m_children.append(children[i]); - } else { - ASSERT(obj->parentObject() == this); - m_children.append(obj); - } - } + for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSibling()) + addChild(obj.get()); + addHiddenChildren(); addAttachmentChildren(); addImageMapChildren(); addTextFieldChildren(); diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.h b/Source/WebCore/accessibility/AccessibilityRenderObject.h index 539b5e273..b1752d3f1 100644 --- a/Source/WebCore/accessibility/AccessibilityRenderObject.h +++ b/Source/WebCore/accessibility/AccessibilityRenderObject.h @@ -143,8 +143,6 @@ public: virtual PlainTextRange selectedTextRange() const; virtual VisibleSelection selection() const; virtual String stringValue() const; - virtual String ariaDescribedByAttribute() const; - virtual String accessibilityDescription() const; virtual String helpText() const; virtual String textUnderElement() const; virtual String text() const; @@ -248,6 +246,7 @@ private: bool isDescendantOfElementType(const QualifiedName& tagName) const; // This returns true if it's focusable but it's not content editable and it's not a control or ARIA control. + void addHiddenChildren(); void addTextFieldChildren(); void addImageMapChildren(); void addCanvasChildren(); @@ -261,8 +260,6 @@ private: bool elementAttributeValue(const QualifiedName&) const; void setElementAttributeValue(const QualifiedName&, bool); - String webAreaAccessibilityDescription() const; - virtual ESpeak speakProperty() const; virtual const AtomicString& ariaLiveRegionStatus() const; diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm index a4394ba20..552f9ff2c 100644 --- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm +++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm @@ -1387,10 +1387,18 @@ static id textMarkerRangeFromVisiblePositions(AXObjectCache *cache, VisiblePosit - (id)remoteAccessibilityParentObject { - if (!m_object || !m_object->document() || !m_object->document()->frame()) + if (!m_object) + return nil; + + Document* document = m_object->document(); + if (!document) return nil; - return m_object->document()->frame()->loader()->client()->accessibilityRemoteObject(); + Frame* frame = document->frame(); + if (!frame) + return nil; + + return frame->loader()->client()->accessibilityRemoteObject(); } static void convertToVector(NSArray* array, AccessibilityObject::AccessibilityChildrenVector& vector) @@ -1818,6 +1826,103 @@ static NSString* roleValueToNSString(AccessibilityRole value) return [self remoteAccessibilityParentObject]; } +// FIXME: Different kinds of elements are putting the title tag to use in different +// AX fields. This should be rectified, but in the initial patch I want to achieve +// parity with existing behavior. +- (BOOL)titleTagShouldBeUsedInDescriptionField +{ + return (m_object->isLink() && !m_object->isImageMapLink()) || m_object->isImage(); +} + +// This should be the "visible" text that's actually on the screen if possible. +// If there's alternative text, that can override the title. +- (NSString *)accessibilityTitle +{ + // Static text objects should not have a title. Its content is communicated in its AXValue. + if (m_object->roleValue() == StaticTextRole) + return [NSString string]; + + Vector<AccessibilityText> textOrder; + m_object->accessibilityText(textOrder); + + unsigned length = textOrder.size(); + for (unsigned k = 0; k < length; k++) { + const AccessibilityText& text = textOrder[k]; + + // Once we encounter visible text, or the text from our children that should be used foremost. + if (text.textSource == VisibleText || text.textSource == ChildrenText) + return text.text; + + // If there's an element that labels this object and it's not exposed, then we should use + // that text as our title. + if (text.textSource == LabelByElementText && !m_object->exposesTitleUIElement()) + return text.text; + + // FIXME: The title tag is used in certain cases for the title. This usage should + // probably be in the description field since it's not "visible". + if (text.textSource == TitleTagText && ![self titleTagShouldBeUsedInDescriptionField]) + return text.text; + } + + return [NSString string]; +} + +- (NSString *)accessibilityDescription +{ + // Static text objects should not have a description. Its content is communicated in its AXValue. + // One exception is the media control labels that have a value and a description. Those are set programatically. + if (m_object->roleValue() == StaticTextRole && !m_object->isMediaControlLabel()) + return [NSString string]; + + Vector<AccessibilityText> textOrder; + m_object->accessibilityText(textOrder); + + unsigned length = textOrder.size(); + for (unsigned k = 0; k < length; k++) { + const AccessibilityText& text = textOrder[k]; + + if (text.textSource == AlternativeText) + return text.text; + + if (text.textSource == TitleTagText && [self titleTagShouldBeUsedInDescriptionField]) + return text.text; + } + + return [NSString string]; +} + +- (NSString *)accessibilityHelpText +{ + Vector<AccessibilityText> textOrder; + m_object->accessibilityText(textOrder); + + unsigned length = textOrder.size(); + bool descriptiveTextAvailable = false; + for (unsigned k = 0; k < length; k++) { + const AccessibilityText& text = textOrder[k]; + + if (text.textSource == HelpText || text.textSource == SummaryText) + return text.text; + + // If an element does NOT have other descriptive text the title tag should be used as its descriptive text. + // But, if those ARE available, then the title tag should be used for help text instead. + switch (text.textSource) { + case AlternativeText: + case VisibleText: + case ChildrenText: + case LabelByElementText: + descriptiveTextAvailable = true; + default: + break; + } + + if (text.textSource == TitleTagText && descriptiveTextAvailable) + return text.text; + } + + return [NSString string]; +} + // FIXME: split up this function in a better way. // suggestions: Use a hash table that maps attribute names to function calls, // or maybe pointers to member functions @@ -1984,7 +2089,8 @@ static NSString* roleValueToNSString(AccessibilityRole value) if ([[[self attachmentView] accessibilityAttributeNames] containsObject:NSAccessibilityTitleAttribute]) return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityTitleAttribute]; } - return m_object->title(); + + return [self accessibilityTitle]; } if ([attributeName isEqualToString: NSAccessibilityDescriptionAttribute]) { @@ -1992,7 +2098,7 @@ static NSString* roleValueToNSString(AccessibilityRole value) if ([[[self attachmentView] accessibilityAttributeNames] containsObject:NSAccessibilityDescriptionAttribute]) return [[self attachmentView] accessibilityAttributeValue:NSAccessibilityDescriptionAttribute]; } - return m_object->accessibilityDescription(); + return [self accessibilityDescription]; } if ([attributeName isEqualToString: NSAccessibilityValueAttribute]) { @@ -2046,7 +2152,7 @@ static NSString* roleValueToNSString(AccessibilityRole value) return [NSNumber numberWithFloat:m_object->maxValueForRange()]; if ([attributeName isEqualToString: NSAccessibilityHelpAttribute]) - return m_object->helpText(); + return [self accessibilityHelpText]; if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute]) return [NSNumber numberWithBool: m_object->isFocused()]; diff --git a/Source/WebCore/bindings/ScriptControllerBase.cpp b/Source/WebCore/bindings/ScriptControllerBase.cpp index 9b006d2c2..cc5246362 100644 --- a/Source/WebCore/bindings/ScriptControllerBase.cpp +++ b/Source/WebCore/bindings/ScriptControllerBase.cpp @@ -75,7 +75,6 @@ bool ScriptController::executeIfJavaScriptURL(const KURL& url, ShouldReplaceDocu return false; if (!m_frame->page() - || !m_frame->page()->javaScriptURLsAreAllowed() || !m_frame->document()->contentSecurityPolicy()->allowJavaScriptURLs(m_frame->document()->url(), eventHandlerPosition().m_line) || m_frame->inViewSourceMode()) return true; diff --git a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp index 5a99ed670..7cd87d13e 100644 --- a/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp +++ b/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp @@ -62,9 +62,9 @@ bool RuntimeEnabledFeatures::isScriptedSpeechEnabled = false; #endif #if ENABLE(MEDIA_STREAM) -bool RuntimeEnabledFeatures::isMediaStreamEnabled = false; +bool RuntimeEnabledFeatures::isMediaStreamEnabled = true; bool RuntimeEnabledFeatures::isPeerConnectionEnabled = true; -bool RuntimeEnabledFeatures::isDeprecatedPeerConnectionEnabled = true; +bool RuntimeEnabledFeatures::isDeprecatedPeerConnectionEnabled = false; #endif #if ENABLE(GAMEPAD) diff --git a/Source/WebCore/bindings/gobject/DOMObjectCache.cpp b/Source/WebCore/bindings/gobject/DOMObjectCache.cpp index dd7d04971..878875048 100644 --- a/Source/WebCore/bindings/gobject/DOMObjectCache.cpp +++ b/Source/WebCore/bindings/gobject/DOMObjectCache.cpp @@ -97,8 +97,17 @@ void DOMObjectCache::clearByFrame(WebCore::Frame* frame) // If this is the last unref we are going to do, // disconnect the weak ref. We cannot do it afterwards // because the object might be dead at that point. - if (data->timesReturned == 1) + if (data->timesReturned == 1) { g_object_weak_unref(data->object, weakRefNotify, &objectDead); + // At this point, the next time the DOMObject is + // unref'ed it will be finalized, + // DOMObject::finalize() will call + // DOMObjectCache::forget(), which will free 'data'. + // Toggling 'objectDead' here will ensure we don't + // dereference an invalid pointer in the next + // iteration. + objectDead = TRUE; + } data->timesReturned--; g_object_unref(data->object); } diff --git a/Source/WebCore/bindings/gobject/GNUmakefile.am b/Source/WebCore/bindings/gobject/GNUmakefile.am index 2328f95e3..88ed16c07 100644 --- a/Source/WebCore/bindings/gobject/GNUmakefile.am +++ b/Source/WebCore/bindings/gobject/GNUmakefile.am @@ -173,6 +173,8 @@ webkitgtk_gdom_built_sources += \ DerivedSources/webkit/WebKitDOMHTMLParamElementPrivate.h \ DerivedSources/webkit/WebKitDOMHTMLPreElement.cpp \ DerivedSources/webkit/WebKitDOMHTMLPreElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLPropertiesCollection.cpp \ + DerivedSources/webkit/WebKitDOMHTMLPropertiesCollectionPrivate.h \ DerivedSources/webkit/WebKitDOMHTMLQuoteElement.cpp \ DerivedSources/webkit/WebKitDOMHTMLQuoteElementPrivate.h \ DerivedSources/webkit/WebKitDOMHTMLScriptElement.cpp \ @@ -211,6 +213,8 @@ webkitgtk_gdom_built_sources += \ DerivedSources/webkit/WebKitDOMMemoryInfoPrivate.h \ DerivedSources/webkit/WebKitDOMMessagePort.cpp \ DerivedSources/webkit/WebKitDOMMessagePortPrivate.h \ + DerivedSources/webkit/WebKitDOMMicroDataItemValue.cpp \ + DerivedSources/webkit/WebKitDOMMicroDataItemValuePrivate.h \ DerivedSources/webkit/WebKitDOMMouseEvent.cpp \ DerivedSources/webkit/WebKitDOMMouseEventPrivate.h \ DerivedSources/webkit/WebKitDOMNamedNodeMap.cpp \ @@ -227,6 +231,8 @@ webkitgtk_gdom_built_sources += \ DerivedSources/webkit/WebKitDOMNodePrivate.h \ DerivedSources/webkit/WebKitDOMProcessingInstruction.cpp \ DerivedSources/webkit/WebKitDOMProcessingInstructionPrivate.h \ + DerivedSources/webkit/WebKitDOMPropertyNodeList.cpp \ + DerivedSources/webkit/WebKitDOMPropertyNodeListPrivate.h \ DerivedSources/webkit/WebKitDOMRange.cpp \ DerivedSources/webkit/WebKitDOMRangePrivate.h \ DerivedSources/webkit/WebKitDOMScreen.cpp \ @@ -357,6 +363,7 @@ webkitgtk_built_h_api += \ DerivedSources/webkit/WebKitDOMHTMLParagraphElement.h \ DerivedSources/webkit/WebKitDOMHTMLParamElement.h \ DerivedSources/webkit/WebKitDOMHTMLPreElement.h \ + DerivedSources/webkit/WebKitDOMHTMLPropertiesCollection.h \ DerivedSources/webkit/WebKitDOMHTMLQuoteElement.h \ DerivedSources/webkit/WebKitDOMHTMLScriptElement.h \ DerivedSources/webkit/WebKitDOMHTMLSelectElement.h \ @@ -383,8 +390,10 @@ webkitgtk_built_h_api += \ DerivedSources/webkit/WebKitDOMHistory.h \ DerivedSources/webkit/WebKitDOMLocation.h \ DerivedSources/webkit/WebKitDOMMemoryInfo.h \ + DerivedSources/webkit/WebKitDOMMicroDataItemValue.h \ DerivedSources/webkit/WebKitDOMObject.h \ DerivedSources/webkit/WebKitDOMNavigator.h \ + DerivedSources/webkit/WebKitDOMPropertyNodeList.h \ DerivedSources/webkit/WebKitDOMScreen.h \ DerivedSources/webkit/WebKitDOMWebKitAnimation.h \ DerivedSources/webkit/WebKitDOMWebKitAnimationList.h \ diff --git a/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp index f4af55d82..c93f3401e 100644 --- a/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp +++ b/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp @@ -39,6 +39,7 @@ #include "JSHTMLImageElement.h" #include "JSImageData.h" #include "JSInt32Array.h" +#include "JSOESElementIndexUint.h" #include "JSOESStandardDerivatives.h" #include "JSOESTextureFloat.h" #include "JSOESVertexArrayObject.h" @@ -57,6 +58,7 @@ #include "JSWebGLVertexArrayObjectOES.h" #include "JSWebKitCSSMatrix.h" #include "NotImplemented.h" +#include "OESElementIndexUint.h" #include "OESStandardDerivatives.h" #include "OESTextureFloat.h" #include "OESVertexArrayObject.h" @@ -200,6 +202,8 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten return toJS(exec, globalObject, static_cast<OESTextureFloat*>(extension)); case WebGLExtension::OESVertexArrayObjectName: return toJS(exec, globalObject, static_cast<OESVertexArrayObject*>(extension)); + case WebGLExtension::OESElementIndexUintName: + return toJS(exec, globalObject, static_cast<OESElementIndexUint*>(extension)); case WebGLExtension::WebGLDebugRendererInfoName: return toJS(exec, globalObject, static_cast<WebGLDebugRendererInfo*>(extension)); case WebGLExtension::WebGLDebugShadersName: diff --git a/Source/WebCore/bindings/js/PageScriptDebugServer.cpp b/Source/WebCore/bindings/js/PageScriptDebugServer.cpp index ed743cc9e..ed743cc9e 100755..100644 --- a/Source/WebCore/bindings/js/PageScriptDebugServer.cpp +++ b/Source/WebCore/bindings/js/PageScriptDebugServer.cpp diff --git a/Source/WebCore/bindings/objc/DOMEvents.mm b/Source/WebCore/bindings/objc/DOMEvents.mm index d7ba17f4c..d7ba17f4c 100755..100644 --- a/Source/WebCore/bindings/objc/DOMEvents.mm +++ b/Source/WebCore/bindings/objc/DOMEvents.mm diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm index 0b405ac3e..acb7a348b 100644 --- a/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm +++ b/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm @@ -239,6 +239,10 @@ sub SkipFunction { return 1; } + if ($function->signature->name eq "setRangeText" && @{$function->parameters} == 1) { + return 1; + } + if ($codeGenerator->GetSequenceType($functionReturnType)) { return 1; } diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm index 8c9d868de..a90306cd4 100644 --- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm +++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm @@ -212,12 +212,14 @@ void V8${implClassName}::visitDOMWrapper(DOMDataStore* store, void* object, v8:: { ${implClassName}* impl = static_cast<${implClassName}*>(object); END - if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot" || + if (GetGenerateIsReachable($dataNode) eq "ImplDocument" || + GetGenerateIsReachable($dataNode) eq "ImplElementRoot" || GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot" || GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot" || GetGenerateIsReachable($dataNode) eq "ImplBaseRoot") { my $methodName; + $methodName = "document" if (GetGenerateIsReachable($dataNode) eq "ImplDocument"); $methodName = "element" if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot"); $methodName = "owner" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot"); $methodName = "ownerNode" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot"); @@ -481,11 +483,11 @@ END if (@enabledPerContextFunctions) { push(@headerContent, <<END); - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*); + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>); END } else { push(@headerContent, <<END); - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } END } @@ -832,17 +834,7 @@ static v8::Handle<v8::Value> ${implClassName}ConstructorGetter(v8::Local<v8::Str V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); if (!perContextData) return v8Undefined(); -END - - if ($implClassName eq "DOMWindow") { - push(@implContentDecls, " return perContextData->constructorForType(WrapperTypeInfo::unwrap(data), V8DOMWindow::toNative(info.Holder())->document());\n"); -END - } elsif ($implClassName eq "WorkerContext") { - push(@implContentDecls, " return perContextData->constructorForType(WrapperTypeInfo::unwrap(data), V8WorkerContext::toNative(info.Holder()));\n") - } else { - push(@implContentDecls, " return perContextData->constructorForType(WrapperTypeInfo::unwrap(data), 0);\n"); - } - push(@implContentDecls, <<END); + return perContextData->constructorForType(WrapperTypeInfo::unwrap(data)); } END } @@ -3065,8 +3057,9 @@ END void ${className}::installPerContextProperties(v8::Handle<v8::Object> instance, ${nativeType}* impl) { v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype()); + ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext()); // When building QtWebkit with V8 this variable is unused when none of the features are enabled. - UNUSED_PARAM(proto); + UNUSED_PARAM(context); END # Setup the enable-by-settings attrs if we have them @@ -3074,7 +3067,7 @@ END my $enableFunction = GetContextEnableFunction($runtimeAttr->signature); my $conditionalString = $codeGenerator->GenerateConditionalString($runtimeAttr->signature); push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; - push(@implContent, " if (${enableFunction}(impl->document())) {\n"); + push(@implContent, " if (context && context->isDocument() && ${enableFunction}(static_cast<Document*>(context))) {\n"); push(@implContent, " static const V8DOMConfiguration::BatchedAttribute attrData =\\\n"); GenerateSingleBatchedAttribute($interfaceName, $runtimeAttr, ";", " "); push(@implContent, <<END); @@ -3090,15 +3083,16 @@ END if (@enabledPerContextFunctions) { push(@implContent, <<END); -void ${className}::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto, ScriptExecutionContext* context) +void ${className}::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto) { UNUSED_PARAM(proto); - UNUSED_PARAM(context); END # Setup the enable-by-settings functions if we have them push(@implContent, <<END); v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate()); UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. + + ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext()); END foreach my $runtimeFunc (@enabledPerContextFunctions) { @@ -3431,13 +3425,14 @@ END } push(@implContent, <<END); - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); END - if (IsNodeSubType($dataNode) || $interfaceName eq "NotificationCenter") { + if (IsNodeSubType($dataNode)) { push(@implContent, <<END); - document = impl->document(); + deprecatedDocument = impl->document(); END } @@ -3452,7 +3447,7 @@ END context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/IDLAttributes.txt b/Source/WebCore/bindings/scripts/IDLAttributes.txt index df3d56d9b..db5884c5f 100644 --- a/Source/WebCore/bindings/scripts/IDLAttributes.txt +++ b/Source/WebCore/bindings/scripts/IDLAttributes.txt @@ -53,7 +53,7 @@ DoNotCheckSecurityOnGetter DoNotCheckSecurityOnSetter EventTarget ExtendsDOMGlobalObject -GenerateIsReachable=ImplElementRoot|ImplBaseRoot +GenerateIsReachable=ImplDocument|ImplElementRoot|ImplBaseRoot Immutable ImplementedAs=* IndexedGetter @@ -118,7 +118,7 @@ V8DependentLifetime V8DoNotCheckSignature V8EnabledAtRuntime=* V8EnabledPerContext=* -V8GenerateIsReachable=ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot|ImplBaseRoot +V8GenerateIsReachable=ImplDocument|ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot|ImplBaseRoot V8MeasureAs=* V8ReadOnly V8Unforgeable diff --git a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp index a2f0a511b..f35ba87f0 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp @@ -150,8 +150,9 @@ 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())); - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -162,7 +163,7 @@ v8::Handle<v8::Object> V8Float64Array::wrapSlow(PassRefPtr<Float64Array> impl, v context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h index 1824b2753..afb01344e 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h @@ -48,7 +48,7 @@ public: static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, Float64Array*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<Float64Array>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp index b5924ffcf..a5b0be2eb 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp @@ -178,8 +178,9 @@ bool V8TestActiveDOMObject::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestActiveDOMObject::wrapSlow(PassRefPtr<TestActiveDOMObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -190,7 +191,7 @@ v8::Handle<v8::Object> V8TestActiveDOMObject::wrapSlow(PassRefPtr<TestActiveDOMO context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h index 81498e256..7baeacca9 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h @@ -48,7 +48,7 @@ public: static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data); static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data); static void installPerContextProperties(v8::Handle<v8::Object>, TestActiveDOMObject*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestActiveDOMObject>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp index eef443b61..8de0428f7 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp @@ -112,8 +112,9 @@ bool V8TestCustomNamedGetter::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestCustomNamedGetter::wrapSlow(PassRefPtr<TestCustomNamedGetter> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -124,7 +125,7 @@ v8::Handle<v8::Object> V8TestCustomNamedGetter::wrapSlow(PassRefPtr<TestCustomNa context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h index d07e7a554..ea334b0e4 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h @@ -47,7 +47,7 @@ public: static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestCustomNamedGetter*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestCustomNamedGetter>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp index 736911aef..b6c70b99c 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp @@ -149,8 +149,9 @@ bool V8TestEventConstructor::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestEventConstructor::wrapSlow(PassRefPtr<TestEventConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -161,7 +162,7 @@ v8::Handle<v8::Object> V8TestEventConstructor::wrapSlow(PassRefPtr<TestEventCons context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h index 2399c87fa..9961280f0 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h @@ -48,7 +48,7 @@ public: static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestEventConstructor*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestEventConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp index 517984d8f..9d9fd61b2 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp @@ -173,8 +173,9 @@ bool V8TestEventTarget::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestEventTarget::wrapSlow(PassRefPtr<TestEventTarget> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -185,7 +186,7 @@ v8::Handle<v8::Object> V8TestEventTarget::wrapSlow(PassRefPtr<TestEventTarget> i context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h index 7981adc4b..f9b1f7af1 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h @@ -49,7 +49,7 @@ public: static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCount + 0; static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1; static void installPerContextProperties(v8::Handle<v8::Object>, TestEventTarget*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestEventTarget>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp index 563d084a7..07e880f74 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp @@ -103,8 +103,9 @@ bool V8TestException::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestException::wrapSlow(PassRefPtr<TestException> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -115,7 +116,7 @@ v8::Handle<v8::Object> V8TestException::wrapSlow(PassRefPtr<TestException> impl, context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestException.h b/Source/WebCore/bindings/scripts/test/V8/V8TestException.h index ff66cc594..99afe8b16 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestException.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestException.h @@ -46,7 +46,7 @@ public: static WrapperTypeInfo info; static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestException*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestException>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp index 173c233b3..066da9c7e 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp @@ -342,8 +342,9 @@ ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> objec v8::Handle<v8::Object> V8TestInterface::wrapSlow(PassRefPtr<TestInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -354,7 +355,7 @@ v8::Handle<v8::Object> V8TestInterface::wrapSlow(PassRefPtr<TestInterface> impl, context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h index 535b7d0db..850c0cb5b 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h @@ -51,7 +51,7 @@ public: static v8::Handle<v8::Value> namedPropertySetter(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestInterface*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp index c3fca0476..53d5f993f 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp @@ -112,8 +112,9 @@ bool V8TestMediaQueryListListener::HasInstance(v8::Handle<v8::Value> value) v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(PassRefPtr<TestMediaQueryListListener> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -124,7 +125,7 @@ v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(PassRefPtr<TestMed context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h index b0a2ef70d..f88598046 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h @@ -46,7 +46,7 @@ public: static WrapperTypeInfo info; static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestMediaQueryListListener*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestMediaQueryListListener>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp index f2ed819df..400fd4ace 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp @@ -152,8 +152,9 @@ ActiveDOMObject* V8TestNamedConstructor::toActiveDOMObject(v8::Handle<v8::Object v8::Handle<v8::Object> V8TestNamedConstructor::wrapSlow(PassRefPtr<TestNamedConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -164,7 +165,7 @@ v8::Handle<v8::Object> V8TestNamedConstructor::wrapSlow(PassRefPtr<TestNamedCons context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h index 2fc0099ae..838b11538 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h @@ -53,7 +53,7 @@ public: static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestNamedConstructor*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestNamedConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp index 470c382c8..89bfedc47 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp @@ -112,9 +112,10 @@ v8::Handle<v8::Object> V8TestNode::wrapSlow(PassRefPtr<TestNode> impl, v8::Handl { v8::Handle<v8::Object> wrapper; ASSERT(static_cast<void*>(static_cast<Node*>(impl.get())) == static_cast<void*>(impl.get())); - Document* document = 0; - UNUSED_PARAM(document); - document = impl->document(); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); + deprecatedDocument = impl->document(); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -125,7 +126,7 @@ v8::Handle<v8::Object> V8TestNode::wrapSlow(PassRefPtr<TestNode> impl, v8::Handl context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h index 6b42e5bb5..fd3338839 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h @@ -47,7 +47,7 @@ public: static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestNode*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestNode>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp index 4609f1f83..3ae63a605 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp @@ -1031,7 +1031,7 @@ static v8::Handle<v8::Value> TestObjConstructorGetter(v8::Local<v8::String> name V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); if (!perContextData) return v8Undefined(); - return perContextData->constructorForType(WrapperTypeInfo::unwrap(data), 0); + return perContextData->constructorForType(WrapperTypeInfo::unwrap(data)); } static void TestObjReplaceableAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { @@ -2326,27 +2326,29 @@ bool V8TestObj::HasInstance(v8::Handle<v8::Value> value) void V8TestObj::installPerContextProperties(v8::Handle<v8::Object> instance, TestObj* impl) { v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype()); + ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext()); // When building QtWebkit with V8 this variable is unused when none of the features are enabled. - UNUSED_PARAM(proto); - if (ContextFeatures::enabledPerContextAttr1Enabled(impl->document())) { + UNUSED_PARAM(context); + if (context && context->isDocument() && ContextFeatures::enabledPerContextAttr1Enabled(static_cast<Document*>(context))) { static const V8DOMConfiguration::BatchedAttribute attrData =\ // Attribute 'enabledPerContextAttr1' (Type: 'attribute' ExtAttr: 'V8EnabledPerContext') {"enabledPerContextAttr1", TestObjV8Internal::enabledPerContextAttr1AttrGetter, TestObjV8Internal::enabledPerContextAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; V8DOMConfiguration::configureAttribute(instance, proto, attrData); } - if (ContextFeatures::featureNameEnabled(impl->document())) { + if (context && context->isDocument() && ContextFeatures::featureNameEnabled(static_cast<Document*>(context))) { static const V8DOMConfiguration::BatchedAttribute attrData =\ // Attribute 'enabledPerContextAttr2' (Type: 'attribute' ExtAttr: 'V8EnabledPerContext') {"enabledPerContextAttr2", TestObjV8Internal::enabledPerContextAttr2AttrGetter, TestObjV8Internal::enabledPerContextAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; V8DOMConfiguration::configureAttribute(instance, proto, attrData); } } -void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto, ScriptExecutionContext* context) +void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> proto) { UNUSED_PARAM(proto); - UNUSED_PARAM(context); v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate()); UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. + + ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext()); if (context && context->isDocument() && ContextFeatures::enabledPerContextMethod1Enabled(static_cast<Document*>(context))) { proto->Set(v8::String::NewSymbol("enabledPerContextMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethod1Callback, v8Undefined(), defaultSignature)->GetFunction()); } @@ -2358,8 +2360,9 @@ void V8TestObj::installPerContextPrototypeProperties(v8::Handle<v8::Object> prot v8::Handle<v8::Object> V8TestObj::wrapSlow(PassRefPtr<TestObj> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -2370,7 +2373,7 @@ v8::Handle<v8::Object> V8TestObj::wrapSlow(PassRefPtr<TestObj> impl, v8::Handle< context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h index 29c55353d..621e297af 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h @@ -52,7 +52,7 @@ public: static void customAttrAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value>, const v8::AccessorInfo&); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestObj*); - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*); + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>); private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestObj>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp index 153e09d76..9c6f36b80 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp @@ -295,8 +295,9 @@ bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> val v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(PassRefPtr<TestSerializedScriptValueInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) { v8::Handle<v8::Object> wrapper; - Document* document = 0; - UNUSED_PARAM(document); + // Please don't add any more uses of this variable. + Document* deprecatedDocument = 0; + UNUSED_PARAM(deprecatedDocument); v8::Handle<v8::Context> context; if (!creationContext.IsEmpty() && creationContext->CreationContext() != v8::Context::GetCurrent()) { @@ -307,7 +308,7 @@ v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(PassRefPtr context->Enter(); } - wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get()); + wrapper = V8DOMWrapper::instantiateV8Object(deprecatedDocument, &info, impl.get()); if (!context.IsEmpty()) context->Exit(); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h index bfe6c99e9..63c222a0b 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h @@ -49,7 +49,7 @@ public: static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&); static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0; static void installPerContextProperties(v8::Handle<v8::Object>, TestSerializedScriptValueInterface*) { } - static void installPerContextPrototypeProperties(v8::Handle<v8::Object>, ScriptExecutionContext*) { } + static void installPerContextPrototypeProperties(v8::Handle<v8::Object>) { } private: static v8::Handle<v8::Object> wrapSlow(PassRefPtr<TestSerializedScriptValueInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*); }; diff --git a/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp b/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp index 83ae9b2fd..6a8311fb6 100644 --- a/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp +++ b/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp @@ -180,6 +180,9 @@ static PassRefPtr<IDBKey> createIDBKeyFromScriptValueAndKeyPath(const ScriptValu IDBParseKeyPath(keyPath, keyPathElements, error); ASSERT(error == IDBKeyPathParseErrorNone); + v8::HandleScope handleScope; + v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext()); + v8::Handle<v8::Value> v8Value(value.v8Value()); v8::Handle<v8::Value> v8Key(getNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size())); if (v8Key.IsEmpty()) diff --git a/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp b/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp index b4857b453..b4857b453 100755..100644 --- a/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp +++ b/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp diff --git a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp index 8a41b56a7..de65721a3 100644 --- a/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp +++ b/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp @@ -442,9 +442,8 @@ void V8DOMWindowShell::createContext() bool V8DOMWindowShell::installDOMWindow() { - Document* document = m_frame->document(); - DOMWindow* window = document->domWindow(); - v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(V8PerContextData::from(m_context.get())->constructorForType(&V8DOMWindow::info, document)); + DOMWindow* window = m_frame->document()->domWindow(); + v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(V8PerContextData::from(m_context.get())->constructorForType(&V8DOMWindow::info)); if (windowWrapper.IsEmpty()) return false; diff --git a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp index fbb9fd2c9..c768da892 100644 --- a/Source/WebCore/bindings/v8/V8DOMWrapper.cpp +++ b/Source/WebCore/bindings/v8/V8DOMWrapper.cpp @@ -111,18 +111,20 @@ PassRefPtr<NodeFilter> V8DOMWrapper::wrapNativeNodeFilter(v8::Handle<v8::Value> return NodeFilter::create(V8NodeFilterCondition::create(filter)); } -v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(Document* document, WrapperTypeInfo* type, void* impl) +v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(Document* deprecatedDocument, WrapperTypeInfo* type, void* impl) { V8PerContextData* perContextData = 0; + // Please don't add any more uses of deprecatedDocument. We want to remove it. + // If we have a pointer to the frame, we cna get the V8PerContextData // directly, which is faster than going through V8. - if (document && document->frame()) - perContextData = perContextDataForCurrentWorld(document->frame()); + if (deprecatedDocument && deprecatedDocument->frame()) + perContextData = perContextDataForCurrentWorld(deprecatedDocument->frame()); else perContextData = V8PerContextData::from(v8::Context::GetCurrent()); - v8::Local<v8::Object> instance = perContextData ? perContextData->createWrapperFromCache(type, document) : V8ObjectConstructor::newInstance(type->getTemplate()->GetFunction()); + v8::Local<v8::Object> instance = perContextData ? perContextData->createWrapperFromCache(type) : V8ObjectConstructor::newInstance(type->getTemplate()->GetFunction()); // Avoid setting the DOM wrapper for failed allocations. if (instance.IsEmpty()) diff --git a/Source/WebCore/bindings/v8/V8GCController.cpp b/Source/WebCore/bindings/v8/V8GCController.cpp index 0b3dade8f..9007dab97 100644 --- a/Source/WebCore/bindings/v8/V8GCController.cpp +++ b/Source/WebCore/bindings/v8/V8GCController.cpp @@ -66,77 +66,38 @@ namespace WebCore { -typedef HashMap<Node*, v8::Object*> DOMNodeMap; -typedef HashMap<void*, v8::Object*> DOMObjectMap; - #ifndef NDEBUG -class DOMObjectVisitor : public DOMWrapperMap<void>::Visitor { -public: - void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper) - { - WrapperTypeInfo* type = V8DOMWrapper::domWrapperType(wrapper); - UNUSED_PARAM(type); - UNUSED_PARAM(object); - } -}; - class EnsureWeakDOMNodeVisitor : public DOMWrapperMap<Node>::Visitor { public: - void visitDOMWrapper(DOMDataStore* store, Node* object, v8::Persistent<v8::Object> wrapper) + void visitDOMWrapper(DOMDataStore*, Node*, v8::Persistent<v8::Object> wrapper) { - UNUSED_PARAM(object); ASSERT(wrapper.IsWeak()); } }; #endif // NDEBUG -class SpecialCasePrologueObjectHandler { -public: - static bool process(void* object, v8::Persistent<v8::Object> wrapper, WrapperTypeInfo* typeInfo) - { - // Additional handling of message port ensuring that entangled ports also - // have their wrappers entangled. This should ideally be handled when the - // ports are actually entangled in MessagePort::entangle, but to avoid - // forking MessagePort.* this is postponed to GC time. Having this postponed - // has the drawback that the wrappers are "entangled/unentangled" for each - // GC even though their entaglement most likely is still the same. - if (V8MessagePort::info.equals(typeInfo)) { - // Mark each port as in-use if it's entangled. For simplicity's sake, we assume all ports are remotely entangled, - // since the Chromium port implementation can't tell the difference. - MessagePort* port1 = static_cast<MessagePort*>(object); - if (port1->isEntangled() || port1->hasPendingActivity()) - wrapper.ClearWeak(); - return true; - } - return false; - } -}; - -class SpecialCasePrologueNodeHandler { -public: - static bool process(Node* object, v8::Persistent<v8::Object> wrapper, WrapperTypeInfo* typeInfo) - { - UNUSED_PARAM(object); - UNUSED_PARAM(wrapper); - UNUSED_PARAM(typeInfo); - return false; - } -}; - -template<typename T, typename S> -class GCPrologueVisitor : public DOMWrapperMap<T>::Visitor { +template<typename T> +class ActiveDOMObjectPrologueVisitor : public DOMWrapperMap<T>::Visitor { public: - void visitDOMWrapper(DOMDataStore* store, T* object, v8::Persistent<v8::Object> wrapper) + void visitDOMWrapper(DOMDataStore*, T* object, v8::Persistent<v8::Object> wrapper) { WrapperTypeInfo* typeInfo = V8DOMWrapper::domWrapperType(wrapper); - if (!S::process(object, wrapper, typeInfo)) { - ActiveDOMObject* activeDOMObject = typeInfo->toActiveDOMObject(wrapper); - if (activeDOMObject && activeDOMObject->hasPendingActivity()) + if (V8MessagePort::info.equals(typeInfo)) { + // Mark each port as in-use if it's entangled. For simplicity's sake, + // we assume all ports are remotely entangled, since the Chromium port + // implementation can't tell the difference. + MessagePort* port = reinterpret_cast<MessagePort*>(object); + if (port->isEntangled() || port->hasPendingActivity()) wrapper.ClearWeak(); + return; } + + ActiveDOMObject* activeDOMObject = typeInfo->toActiveDOMObject(wrapper); + if (activeDOMObject && activeDOMObject->hasPendingActivity()) + wrapper.ClearWeak(); } }; @@ -257,9 +218,17 @@ static GroupId calculateGroupId(Node* node) return GroupId(root); } -class GrouperVisitor : public DOMWrapperMap<Node>::Visitor, public DOMWrapperMap<void>::Visitor { +class ObjectVisitor : public DOMWrapperMap<void>::Visitor { public: - void visitDOMWrapper(DOMDataStore* store, Node* node, v8::Persistent<v8::Object> wrapper) + void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper) + { + V8DOMWrapper::domWrapperType(wrapper)->visitDOMWrapper(store, object, wrapper); + } +}; + +class NodeVisitor : public DOMWrapperMap<Node>::Visitor { +public: + void visitDOMWrapper(DOMDataStore*, Node* node, v8::Persistent<v8::Object> wrapper) { if (node->hasEventListeners()) { Vector<v8::Persistent<v8::Value> > listeners; @@ -282,12 +251,6 @@ public: m_grouper.append(GrouperItem(groupId, wrapper)); } - void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper) - { - WrapperTypeInfo* info = V8DOMWrapper::domWrapperType(wrapper); - info->visitDOMWrapper(store, object, wrapper); - } - void applyGrouping() { // Group by sorting by the group id. @@ -336,32 +299,23 @@ private: // Create object groups for DOM tree nodes. void V8GCController::gcPrologue() { + TRACE_EVENT_BEGIN0("v8", "GC"); + v8::HandleScope scope; -#if PLATFORM(CHROMIUM) - TRACE_EVENT_BEGIN0("v8", "GC"); -#endif + ActiveDOMObjectPrologueVisitor<void> activeObjectVisitor; + visitActiveDOMObjects(&activeObjectVisitor); + ActiveDOMObjectPrologueVisitor<Node> activeNodeVisitor; + visitActiveDOMNodes(&activeNodeVisitor); -#ifndef NDEBUG - DOMObjectVisitor domObjectVisitor; - visitDOMObjects(&domObjectVisitor); -#endif + NodeVisitor nodeVisitor; + visitDOMNodes(&nodeVisitor); + visitActiveDOMNodes(&nodeVisitor); + nodeVisitor.applyGrouping(); + + ObjectVisitor objectVisitor; + visitDOMObjects(&objectVisitor); - // Run through all objects with possible pending activity making their - // wrappers non weak if there is pending activity. - GCPrologueVisitor<void, SpecialCasePrologueObjectHandler> prologueObjectVisitor; - visitActiveDOMObjects(&prologueObjectVisitor); - GCPrologueVisitor<Node, SpecialCasePrologueNodeHandler> prologueNodeVisitor; - visitActiveDOMNodes(&prologueNodeVisitor); - - // Create object groups. - GrouperVisitor grouperVisitor; - visitDOMNodes(&grouperVisitor); - visitActiveDOMNodes(&grouperVisitor); - visitDOMObjects(&grouperVisitor); - grouperVisitor.applyGrouping(); - - // Clean single element cache for string conversions. V8PerIsolateData* data = V8PerIsolateData::current(); data->stringCache()->clearOnGC(); } @@ -445,17 +399,11 @@ void V8GCController::gcEpilogue() #endif #ifndef NDEBUG - // Check all survivals are weak. - DOMObjectVisitor domObjectVisitor; - visitDOMObjects(&domObjectVisitor); - EnsureWeakDOMNodeVisitor weakDOMNodeVisitor; visitDOMNodes(&weakDOMNodeVisitor); #endif -#if PLATFORM(CHROMIUM) TRACE_EVENT_END0("v8", "GC"); -#endif } void V8GCController::checkMemoryUsage() diff --git a/Source/WebCore/bindings/v8/V8PerContextData.cpp b/Source/WebCore/bindings/v8/V8PerContextData.cpp index 15efe5a95..9764620d4 100644 --- a/Source/WebCore/bindings/v8/V8PerContextData.cpp +++ b/Source/WebCore/bindings/v8/V8PerContextData.cpp @@ -100,13 +100,13 @@ bool V8PerContextData::init() #undef V8_STORE_PRIMORDIAL -v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(WrapperTypeInfo* type, ScriptExecutionContext* context) +v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(WrapperTypeInfo* type) { ASSERT(!m_errorPrototype.isEmpty()); ASSERT(!m_objectPrototype.isEmpty()); v8::Context::Scope scope(m_context); - v8::Local<v8::Function> function = constructorForType(type, context); + v8::Local<v8::Function> function = constructorForType(type); v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function); if (!instance.IsEmpty()) { m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New(instance)); @@ -115,7 +115,7 @@ v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(WrapperTy return v8::Local<v8::Object>(); } -v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(WrapperTypeInfo* type, ScriptExecutionContext* context) +v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(WrapperTypeInfo* type) { ASSERT(!m_errorPrototype.isEmpty()); ASSERT(!m_objectPrototype.isEmpty()); @@ -132,7 +132,7 @@ v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(WrapperType v8::Local<v8::Value> prototypeValue = function->Get(v8::String::NewSymbol("prototype")); if (!prototypeValue.IsEmpty() && prototypeValue->IsObject()) { v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(prototypeValue); - type->installPerContextPrototypeProperties(prototypeObject, context); + type->installPerContextPrototypeProperties(prototypeObject); if (type->wrapperTypePrototype == WrapperTypeErrorPrototype) prototypeObject->SetPrototype(m_errorPrototype.get()); } diff --git a/Source/WebCore/bindings/v8/V8PerContextData.h b/Source/WebCore/bindings/v8/V8PerContextData.h index 3557ade6d..8c3c437e2 100644 --- a/Source/WebCore/bindings/v8/V8PerContextData.h +++ b/Source/WebCore/bindings/v8/V8PerContextData.h @@ -63,18 +63,18 @@ public: // To create JS Wrapper objects, we create a cache of a 'boiler plate' // object, and then simply Clone that object each time we need a new one. // This is faster than going through the full object creation process. - v8::Local<v8::Object> createWrapperFromCache(WrapperTypeInfo* type, ScriptExecutionContext* context) + v8::Local<v8::Object> createWrapperFromCache(WrapperTypeInfo* type) { v8::Persistent<v8::Object> boilerplate = m_wrapperBoilerplates.get(type); - return !boilerplate.IsEmpty() ? boilerplate->Clone() : createWrapperFromCacheSlowCase(type, context); + return !boilerplate.IsEmpty() ? boilerplate->Clone() : createWrapperFromCacheSlowCase(type); } - v8::Local<v8::Function> constructorForType(WrapperTypeInfo* type, ScriptExecutionContext* context) + v8::Local<v8::Function> constructorForType(WrapperTypeInfo* type) { v8::Persistent<v8::Function> function = m_constructorMap.get(type); if (!function.IsEmpty()) return v8::Local<v8::Function>::New(function); - return constructorForTypeSlowCase(type, context); + return constructorForTypeSlowCase(type); } V8NPObjectMap* v8NPObjectMap() @@ -90,8 +90,8 @@ private: void dispose(); - v8::Local<v8::Object> createWrapperFromCacheSlowCase(WrapperTypeInfo*, ScriptExecutionContext*); - v8::Local<v8::Function> constructorForTypeSlowCase(WrapperTypeInfo*, ScriptExecutionContext*); + v8::Local<v8::Object> createWrapperFromCacheSlowCase(WrapperTypeInfo*); + v8::Local<v8::Function> constructorForTypeSlowCase(WrapperTypeInfo*); // For each possible type of wrapper, we keep a boilerplate object. // The boilerplate is used to create additional wrappers of the same type. diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp index b2e065605..ee27ebf27 100644 --- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp +++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp @@ -175,7 +175,7 @@ bool WorkerContextExecutionProxy::initializeIfNeeded() if (!m_workerContext->isDedicatedWorkerContext()) contextType = &V8SharedWorkerContext::info; #endif - v8::Handle<v8::Function> workerContextConstructor = m_perContextData->constructorForType(contextType, m_workerContext); + v8::Handle<v8::Function> workerContextConstructor = m_perContextData->constructorForType(contextType); v8::Local<v8::Object> jsWorkerContext = V8ObjectConstructor::newInstance(workerContextConstructor); // Bail out if allocation failed. if (jsWorkerContext.IsEmpty()) { diff --git a/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp b/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp index 3c25ad8c5..3c25ad8c5 100755..100644 --- a/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp +++ b/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp diff --git a/Source/WebCore/bindings/v8/WrapperTypeInfo.h b/Source/WebCore/bindings/v8/WrapperTypeInfo.h index 3c4befaa8..a4bd4998d 100644 --- a/Source/WebCore/bindings/v8/WrapperTypeInfo.h +++ b/Source/WebCore/bindings/v8/WrapperTypeInfo.h @@ -37,7 +37,6 @@ namespace WebCore { class ActiveDOMObject; class DOMDataStore; - class ScriptExecutionContext; static const int v8DOMWrapperTypeIndex = 0; static const int v8DOMWrapperObjectIndex = 1; @@ -49,7 +48,7 @@ namespace WebCore { typedef void (*DerefObjectFunction)(void*); typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>); typedef void (*DOMWrapperVisitorFunction)(DOMDataStore*, void*, v8::Persistent<v8::Object>); - typedef void (*InstallPerContextPrototypePropertiesFunction)(v8::Handle<v8::Object>, ScriptExecutionContext*); + typedef void (*InstallPerContextPrototypePropertiesFunction)(v8::Handle<v8::Object>); enum WrapperTypePrototype { WrapperTypeObjectPrototype, @@ -90,10 +89,10 @@ namespace WebCore { derefObjectFunction(object); } - void installPerContextPrototypeProperties(v8::Handle<v8::Object> proto, ScriptExecutionContext* context) + void installPerContextPrototypeProperties(v8::Handle<v8::Object> proto) { if (installPerContextPrototypePropertiesFunction) - installPerContextPrototypePropertiesFunction(proto, context); + installPerContextPrototypePropertiesFunction(proto); } ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object> object) diff --git a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp index 6de9ce8e2..6de9ce8e2 100755..100644 --- a/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp diff --git a/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp b/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp index b49a153e7..b49a153e7 100755..100644 --- a/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp diff --git a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp index 06354969d..4156832d2 100644 --- a/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp @@ -47,6 +47,7 @@ #include "V8Int16Array.h" #include "V8Int32Array.h" #include "V8Int8Array.h" +#include "V8OESElementIndexUint.h" #include "V8OESStandardDerivatives.h" #include "V8OESTextureFloat.h" #include "V8OESVertexArrayObject.h" @@ -191,6 +192,10 @@ static v8::Handle<v8::Value> toV8Object(WebGLExtension* extension, v8::Handle<v8 extensionObject = toV8(static_cast<OESVertexArrayObject*>(extension), contextObject, isolate); referenceName = "oesVertexArrayObjectName"; break; + case WebGLExtension::OESElementIndexUintName: + extensionObject = toV8(static_cast<OESElementIndexUint*>(extension), contextObject, isolate); + referenceName = "oesElementIndexUintName"; + break; case WebGLExtension::WebGLDebugRendererInfoName: extensionObject = toV8(static_cast<WebGLDebugRendererInfo*>(extension), contextObject, isolate); referenceName = "webGLDebugRendererInfoName"; diff --git a/Source/WebCore/css/CSSCalculationValue.h b/Source/WebCore/css/CSSCalculationValue.h index 044cf32a4..044cf32a4 100755..100644 --- a/Source/WebCore/css/CSSCalculationValue.h +++ b/Source/WebCore/css/CSSCalculationValue.h diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp index 7307402bf..586c133ea 100644 --- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -181,10 +181,10 @@ static const CSSPropertyID computedProperties[] = { CSSPropertyTabSize, CSSPropertyTextAlign, CSSPropertyTextDecoration, -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) CSSPropertyWebkitTextDecorationLine, CSSPropertyWebkitTextDecorationStyle, -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT CSSPropertyTextIndent, CSSPropertyTextRendering, CSSPropertyTextShadow, @@ -1219,7 +1219,7 @@ static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecorati return list; } -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorationStyle textDecorationStyle) { switch (textDecorationStyle) { @@ -1238,7 +1238,7 @@ static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorat ASSERT_NOT_REACHED(); return cssValuePool().createExplicitInitialValue(); } -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepeat yRepeat) { @@ -2026,12 +2026,12 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert return cssValuePool().createValue(style->textAlign()); case CSSPropertyTextDecoration: return renderTextDecorationFlagsToCSSValue(style->textDecoration()); -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextDecorationLine: return renderTextDecorationFlagsToCSSValue(style->textDecoration()); case CSSPropertyWebkitTextDecorationStyle: return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle()); -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT case CSSPropertyWebkitTextDecorationsInEffect: return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect()); case CSSPropertyWebkitTextFillColor: diff --git a/Source/WebCore/css/CSSGrammar.y.in b/Source/WebCore/css/CSSGrammar.y.in index 733ae8eda..4b894fb95 100644 --- a/Source/WebCore/css/CSSGrammar.y.in +++ b/Source/WebCore/css/CSSGrammar.y.in @@ -91,6 +91,9 @@ static inline int cssyyerror(void*, const char*) %token IMPORT_SYM %token PAGE_SYM %token MEDIA_SYM +#if ENABLE_CSS3_CONDITIONAL_RULES +%token SUPPORTS_SYM +#endif %token FONT_FACE_SYM %token CHARSET_SYM %token NAMESPACE_SYM @@ -126,6 +129,11 @@ static inline int cssyyerror(void*, const char*) %token MEDIA_ONLY %token MEDIA_NOT %token MEDIA_AND +#if ENABLE_CSS3_CONDITIONAL_RULES +%token SUPPORTS_NOT +%token SUPPORTS_AND +%token SUPPORTS_OR +#endif %token <number> REMS %token <number> QEMS @@ -189,6 +197,9 @@ static inline int cssyyerror(void*, const char*) %type <rule> block_rule %type <rule> block_valid_rule %type <rule> region +#if ENABLE_CSS3_CONDITIONAL_RULES +%type <rule> supports +#endif %type <string> maybe_ns_prefix @@ -209,6 +220,15 @@ static inline int cssyyerror(void*, const char*) %type <mediaQueryExpList> media_query_exp_list %type <mediaQueryExpList> maybe_and_media_query_exp_list +#if ENABLE_CSS3_CONDITIONAL_RULES +%type <boolean> supports_condition +%type <boolean> supports_condition_in_parens +%type <boolean> supports_negation +%type <boolean> supports_conjunction +%type <boolean> supports_disjunction +%type <boolean> supports_declaration_condition +#endif + %type <string> keyframe_name %type <keyframe> keyframe_rule %type <keyframeRuleList> keyframes_rule @@ -379,6 +399,9 @@ valid_rule: | namespace | import | region +#if ENABLE_CSS3_CONDITIONAL_RULES + | supports +#endif ; rule: @@ -416,6 +439,9 @@ block_rule: | namespace | import | media +#if ENABLE_CSS3_CONDITIONAL_RULES + | supports +#endif ; at_import_header_end_maybe_space: @@ -611,6 +637,74 @@ medium: } ; +#if ENABLE_CSS3_CONDITIONAL_RULES +supports: + SUPPORTS_SYM maybe_space supports_condition '{' maybe_space block_rule_list save_block { + CSSParser* p = static_cast<CSSParser*>(parser); + if ($3 && $6 && p->m_styleSheet) { + for (unsigned i = 0; i < $6->size(); i++) + p->m_styleSheet->parserAppendRule($6->at(i).release()); + } + $$ = 0; + } + ; + +supports_condition: + supports_condition_in_parens + | supports_negation + | supports_conjunction + | supports_disjunction + ; + +supports_negation: + SUPPORTS_NOT maybe_space supports_condition_in_parens { + $$ = !$3; + } + ; + +supports_conjunction: + supports_condition_in_parens SUPPORTS_AND maybe_space supports_condition_in_parens { + $$ = $1 && $4; + } + | supports_conjunction SUPPORTS_AND maybe_space supports_condition_in_parens { + $$ = $1 && $4; + } + ; + +supports_disjunction: + supports_condition_in_parens SUPPORTS_OR maybe_space supports_condition_in_parens { + $$ = $1 || $4; + } + | supports_disjunction SUPPORTS_OR maybe_space supports_condition_in_parens { + $$ = $1 || $4; + } + ; + +supports_condition_in_parens: + '(' maybe_space supports_condition ')' maybe_space { + $$ = $3; + } + | supports_declaration_condition + ; + +supports_declaration_condition: + '(' maybe_space property ':' maybe_space expr prio ')' maybe_space { + $$ = false; + CSSParser* p = static_cast<CSSParser*>(parser); + if ($3 && $6) { + p->m_valueList = p->sinkFloatingValueList($6); + int oldParsedProperties = p->m_parsedProperties->size(); + $$ = p->parseValue(static_cast<CSSPropertyID>($3), $7); + // We just need to know if the declaration is supported as it is written. Rollback any additions. + if ($$) + p->rollbackLastProperties(p->m_parsedProperties->size() - oldParsedProperties); + p->m_valueList = nullptr; + } + p->markPropertyEnd($7, false); + } + ; +#endif + before_keyframes_rule: /* empty */ { parser->markRuleHeaderStart(CSSRuleSourceData::KEYFRAMES_RULE); diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp index f20b61018..af3bab602 100644 --- a/Source/WebCore/css/CSSParser.cpp +++ b/Source/WebCore/css/CSSParser.cpp @@ -2121,7 +2121,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) // none | [ underline || overline || line-through || blink ] | inherit return parseTextDecoration(propId, important); -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextDecorationLine: // none | [ underline || overline || line-through ] | inherit return parseTextDecoration(propId, important); @@ -2131,7 +2131,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy) validPrimitive = true; break; -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT case CSSPropertyZoom: // normal | reset | document | <number> | <percentage> | inherit if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocument) @@ -8033,7 +8033,7 @@ bool CSSParser::parsePerspectiveOrigin(CSSPropertyID propId, CSSPropertyID& prop void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important) { -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) // The text-decoration-line property takes priority over text-decoration, unless the latter has important priority set. if (propId == CSSPropertyTextDecoration && !important && m_currentShorthand == CSSPropertyInvalid) { for (unsigned i = 0; i < m_parsedProperties->size(); ++i) { @@ -8041,7 +8041,7 @@ void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSVa return; } } -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT addProperty(propId, value, important); } @@ -8059,11 +8059,11 @@ bool CSSParser::parseTextDecoration(CSSPropertyID propId, bool important) while (isValid && value) { switch (value->id) { case CSSValueBlink: -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) // Blink value is not accepted by -webkit-text-decoration-line. isValid = propId != CSSPropertyWebkitTextDecorationLine; break; -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT case CSSValueUnderline: case CSSValueOverline: case CSSValueLineThrough: @@ -9140,7 +9140,7 @@ inline void CSSParser::detectAtToken(int length, bool hasEscape) CharacterType* name = tokenStart<CharacterType>(); ASSERT(name[0] == '@' && length >= 2); - // charset, font-face, import, media, namespace, page, + // charset, font-face, import, media, namespace, page, supports, // -webkit-keyframes, and -webkit-mediaquery are not affected by hasEscape. switch (toASCIILowerUnchecked(name[1])) { case 'b': @@ -9241,6 +9241,15 @@ inline void CSSParser::detectAtToken(int length, bool hasEscape) } return; +#if ENABLE(CSS3_CONDITIONAL_RULES) + case 's': + if (length == 9 && isEqualToCSSIdentifier(name + 2, "upports")) { + m_parsingMode = SupportsMode; + m_token = SUPPORTS_SYM; + } + return; +#endif + case 't': if (hasEscape) return; @@ -9323,6 +9332,25 @@ inline void CSSParser::detectAtToken(int length, bool hasEscape) } } +#if ENABLE(CSS3_CONDITIONAL_RULES) +template <typename CharacterType> +inline void CSSParser::detectSupportsToken(int length) +{ + ASSERT(m_parsingMode == SupportsMode); + CharacterType* name = tokenStart<CharacterType>(); + + if (length == 2) { + if (isASCIIAlphaCaselessEqual(name[0], 'o') && isASCIIAlphaCaselessEqual(name[1], 'r')) + m_token = SUPPORTS_OR; + } else if (length == 3) { + if (isASCIIAlphaCaselessEqual(name[0], 'a') && isASCIIAlphaCaselessEqual(name[1], 'n') && isASCIIAlphaCaselessEqual(name[2], 'd')) + m_token = SUPPORTS_AND; + else if (isASCIIAlphaCaselessEqual(name[0], 'n') && isASCIIAlphaCaselessEqual(name[1], 'o') && isASCIIAlphaCaselessEqual(name[2], 't')) + m_token = SUPPORTS_NOT; + } +} +#endif + template <typename SrcCharacterType> int CSSParser::realLex(void* yylvalWithoutType) { @@ -9361,6 +9389,14 @@ restartAfterComment: m_token = IDENT; if (UNLIKELY(*currentCharacter<SrcCharacterType>() == '(')) { +#if ENABLE(CSS3_CONDITIONAL_RULES) + if (m_parsingMode == SupportsMode && !hasEscape) { + detectSupportsToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>()); + if (m_token != IDENT) + break; + } +#endif + m_token = FUNCTION; if (!hasEscape) detectFunctionTypeToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>()); @@ -9379,6 +9415,10 @@ restartAfterComment: } else if (UNLIKELY(m_parsingMode != NormalMode) && !hasEscape) { if (m_parsingMode == MediaQueryMode) detectMediaQueryToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>()); +#if ENABLE(CSS3_CONDITIONAL_RULES) + else if (m_parsingMode == SupportsMode) + detectSupportsToken<SrcCharacterType>(result - tokenStart<SrcCharacterType>()); +#endif else if (m_parsingMode == NthChildMode && isASCIIAlphaCaselessEqual(tokenStart<SrcCharacterType>()[0], 'n')) { if (result - tokenStart<SrcCharacterType>() == 1) { // String "n" is IDENT but "n+1" is NTH. diff --git a/Source/WebCore/css/CSSParser.h b/Source/WebCore/css/CSSParser.h index 469c12dff..75668cf30 100644 --- a/Source/WebCore/css/CSSParser.h +++ b/Source/WebCore/css/CSSParser.h @@ -435,6 +435,10 @@ private: inline void detectDashToken(int); template <typename CharacterType> inline void detectAtToken(int, bool); +#if ENABLE(CSS3_CONDITIONAL_RULES) + template <typename CharacterType> + inline void detectSupportsToken(int); +#endif template <typename CharacterType> inline void setRuleHeaderEnd(const CharacterType*); @@ -483,6 +487,9 @@ private: enum ParsingMode { NormalMode, MediaQueryMode, +#if ENABLE(CSS3_CONDITIONAL_RULES) + SupportsMode, +#endif NthChildMode }; diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h index 3dd09a660..06c18ba9f 100644 --- a/Source/WebCore/css/CSSPrimitiveValueMappings.h +++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h @@ -2203,7 +2203,7 @@ template<> inline CSSPrimitiveValue::operator ETextDecoration() const return TDNONE; } -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) template<> inline CSSPrimitiveValue::operator TextDecorationStyle() const { switch (m_value.ident) { @@ -2222,7 +2222,7 @@ template<> inline CSSPrimitiveValue::operator TextDecorationStyle() const ASSERT_NOT_REACHED(); return TextDecorationStyleSolid; } -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e) : CSSValue(PrimitiveClass) diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp index 83e73b99a..b412fdbfa 100644 --- a/Source/WebCore/css/CSSProperty.cpp +++ b/Source/WebCore/css/CSSProperty.cpp @@ -348,9 +348,9 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) case CSSPropertyWebkitPrintColorAdjust: case CSSPropertyWebkitRtlOrdering: case CSSPropertyWebkitTextCombine: -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextDecorationLine: -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT case CSSPropertyWebkitTextDecorationsInEffect: case CSSPropertyWebkitTextEmphasis: case CSSPropertyWebkitTextEmphasisColor: @@ -648,9 +648,9 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) case CSSPropertyWebkitPerspectiveOrigin: case CSSPropertyWebkitPerspectiveOriginX: case CSSPropertyWebkitPerspectiveOriginY: -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextDecorationStyle: -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT case CSSPropertyWebkitTransform: case CSSPropertyWebkitTransformOrigin: case CSSPropertyWebkitTransformOriginX: diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in index 63fa06d94..8776e04be 100644 --- a/Source/WebCore/css/CSSPropertyNames.in +++ b/Source/WebCore/css/CSSPropertyNames.in @@ -354,7 +354,7 @@ z-index -webkit-rtl-ordering -webkit-text-combine -epub-text-combine = -webkit-text-combine -#if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION +#if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT -webkit-text-decoration-line -webkit-text-decoration-style #endif diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in index c2d128c62..37eafdca9 100644 --- a/Source/WebCore/css/CSSValueKeywords.in +++ b/Source/WebCore/css/CSSValueKeywords.in @@ -451,7 +451,7 @@ static thick thin underline -#if defined(ENABLE_CSS3_TEXT_DECORATION) && ENABLE_CSS3_TEXT_DECORATION +#if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT wavy #endif -webkit-nowrap diff --git a/Source/WebCore/css/SelectorChecker.cpp b/Source/WebCore/css/SelectorChecker.cpp index 7a107c5c1..eb5b9f387 100644 --- a/Source/WebCore/css/SelectorChecker.cpp +++ b/Source/WebCore/css/SelectorChecker.cpp @@ -1333,32 +1333,6 @@ bool SelectorChecker::isFrameFocused(const Element* element) return element->document()->frame() && element->document()->frame()->selection()->isFocusedAndActive(); } -bool SelectorChecker::determineSelectorScopes(const CSSSelectorList& selectorList, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes) -{ - for (CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector)) { - CSSSelector* scopeSelector = 0; - // This picks the widest scope, not the narrowest, to minimize the number of found scopes. - for (CSSSelector* current = selector; current; current = current->tagHistory()) { - // Prefer ids over classes. - if (current->m_match == CSSSelector::Id) - scopeSelector = current; - else if (current->m_match == CSSSelector::Class && (!scopeSelector || scopeSelector->m_match != CSSSelector::Id)) - scopeSelector = current; - CSSSelector::Relation relation = current->relation(); - if (relation != CSSSelector::Descendant && relation != CSSSelector::Child && relation != CSSSelector::SubSelector) - break; - } - if (!scopeSelector) - return false; - ASSERT(scopeSelector->m_match == CSSSelector::Class || scopeSelector->m_match == CSSSelector::Id); - if (scopeSelector->m_match == CSSSelector::Id) - idScopes.add(scopeSelector->value().impl()); - else - classScopes.add(scopeSelector->value().impl()); - } - return true; -} - template bool SelectorChecker::checkOneSelector(const SelectorChecker::SelectorCheckingContext&, const ShadowDOMSiblingTraversalStrategy&) const; diff --git a/Source/WebCore/css/SelectorChecker.h b/Source/WebCore/css/SelectorChecker.h index dccf563e0..9eadada59 100644 --- a/Source/WebCore/css/SelectorChecker.h +++ b/Source/WebCore/css/SelectorChecker.h @@ -119,10 +119,6 @@ public: enum LinkMatchMask { MatchLink = 1, MatchVisited = 2, MatchAll = MatchLink | MatchVisited }; static unsigned determineLinkMatchType(const CSSSelector*); - // Find the ids or classes selectors are scoped to. The selectors only apply to elements in subtrees where the root element matches the scope. - static bool determineSelectorScopes(const CSSSelectorList&, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes); - static bool elementMatchesSelectorScopes(const StyledElement*, const HashSet<AtomicStringImpl*>& idScopes, const HashSet<AtomicStringImpl*>& classScopes); - private: bool checkScrollbarPseudoClass(CSSSelector*) const; static bool isFrameFocused(const Element*); @@ -229,20 +225,6 @@ inline bool SelectorChecker::fastCheckRightmostAttributeSelector(const Element* return true; } -inline bool SelectorChecker::elementMatchesSelectorScopes(const StyledElement* element, const HashSet<AtomicStringImpl*>& idScopes, const HashSet<AtomicStringImpl*>& classScopes) -{ - if (!idScopes.isEmpty() && element->hasID() && idScopes.contains(element->idForStyleResolution().impl())) - return true; - if (classScopes.isEmpty() || !element->hasClass()) - return false; - const SpaceSplitString& classNames = element->classNames(); - for (unsigned i = 0; i < classNames.size(); ++i) { - if (classScopes.contains(classNames[i].impl())) - return true; - } - return false; -} - } #endif diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp index d6284ed2e..5795defc4 100644 --- a/Source/WebCore/css/StyleBuilder.cpp +++ b/Source/WebCore/css/StyleBuilder.cpp @@ -1916,10 +1916,10 @@ StyleBuilder::StyleBuilder() setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler()); setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler()); setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler()); -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler()); setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler()); -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler()); setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler()); setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler()); diff --git a/Source/WebCore/css/StyleInvalidationAnalysis.cpp b/Source/WebCore/css/StyleInvalidationAnalysis.cpp new file mode 100644 index 000000000..2da6732cd --- /dev/null +++ b/Source/WebCore/css/StyleInvalidationAnalysis.cpp @@ -0,0 +1,136 @@ +/* + * 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 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" +#include "StyleInvalidationAnalysis.h" + +#include "CSSSelectorList.h" +#include "Document.h" +#include "StyleRuleImport.h" +#include "StyleSheetContents.h" +#include "StyledElement.h" + +namespace WebCore { + +StyleInvalidationAnalysis::StyleInvalidationAnalysis(const Vector<StyleSheetContents*>& sheets) + : m_dirtiesAllStyle(false) +{ + for (unsigned i = 0; i < sheets.size() && !m_dirtiesAllStyle; ++i) + analyzeStyleSheet(sheets[i]); +} + +static bool determineSelectorScopes(const CSSSelectorList& selectorList, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes) +{ + for (CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector)) { + CSSSelector* scopeSelector = 0; + // This picks the widest scope, not the narrowest, to minimize the number of found scopes. + for (CSSSelector* current = selector; current; current = current->tagHistory()) { + // Prefer ids over classes. + if (current->m_match == CSSSelector::Id) + scopeSelector = current; + else if (current->m_match == CSSSelector::Class && (!scopeSelector || scopeSelector->m_match != CSSSelector::Id)) + scopeSelector = current; + CSSSelector::Relation relation = current->relation(); + if (relation != CSSSelector::Descendant && relation != CSSSelector::Child && relation != CSSSelector::SubSelector) + break; + } + if (!scopeSelector) + return false; + ASSERT(scopeSelector->m_match == CSSSelector::Class || scopeSelector->m_match == CSSSelector::Id); + if (scopeSelector->m_match == CSSSelector::Id) + idScopes.add(scopeSelector->value().impl()); + else + classScopes.add(scopeSelector->value().impl()); + } + return true; +} + +void StyleInvalidationAnalysis::analyzeStyleSheet(StyleSheetContents* styleSheetContents) +{ + ASSERT(!styleSheetContents->isLoading()); + + // See if all rules on the sheet are scoped to some specific ids or classes. + // Then test if we actually have any of those in the tree at the moment. + const Vector<RefPtr<StyleRuleImport> >& importRules = styleSheetContents->importRules(); + for (unsigned i = 0; i < importRules.size(); ++i) { + if (!importRules[i]->styleSheet()) + continue; + analyzeStyleSheet(importRules[i]->styleSheet()); + if (m_dirtiesAllStyle) + return; + } + const Vector<RefPtr<StyleRuleBase> >& rules = styleSheetContents->childRules(); + for (unsigned i = 0; i < rules.size(); i++) { + StyleRuleBase* rule = rules[i].get(); + if (!rule->isStyleRule()) { + // FIXME: Media rules and maybe some others could be allowed. + m_dirtiesAllStyle = true; + return; + } + StyleRule* styleRule = static_cast<StyleRule*>(rule); + if (!determineSelectorScopes(styleRule->selectorList(), m_idScopes, m_classScopes)) { + m_dirtiesAllStyle = true; + return; + } + } +} + +static bool elementMatchesSelectorScopes(const StyledElement* element, const HashSet<AtomicStringImpl*>& idScopes, const HashSet<AtomicStringImpl*>& classScopes) +{ + if (!idScopes.isEmpty() && element->hasID() && idScopes.contains(element->idForStyleResolution().impl())) + return true; + if (classScopes.isEmpty() || !element->hasClass()) + return false; + const SpaceSplitString& classNames = element->classNames(); + for (unsigned i = 0; i < classNames.size(); ++i) { + if (classScopes.contains(classNames[i].impl())) + return true; + } + return false; +} + +void StyleInvalidationAnalysis::invalidateStyle(Document* document) +{ + ASSERT(!m_dirtiesAllStyle); + if (m_idScopes.isEmpty() && m_classScopes.isEmpty()) + return; + Node* node = document->firstChild(); + while (node) { + if (!node->isStyledElement()) { + node = node->traverseNextNode(); + continue; + } + StyledElement* element = static_cast<StyledElement*>(node); + if (elementMatchesSelectorScopes(element, m_idScopes, m_classScopes)) { + element->setNeedsStyleRecalc(); + // The whole subtree is now invalidated, we can skip to the next sibling. + node = node->traverseNextSibling(); + continue; + } + node = node->traverseNextNode(); + } +} + +} diff --git a/Source/WebCore/css/StyleInvalidationAnalysis.h b/Source/WebCore/css/StyleInvalidationAnalysis.h new file mode 100644 index 000000000..7ad2cb935 --- /dev/null +++ b/Source/WebCore/css/StyleInvalidationAnalysis.h @@ -0,0 +1,56 @@ +/* + * 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 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 StyleInvalidationAnalysis_h +#define StyleInvalidationAnalysis_h + +#include <wtf/HashSet.h> +#include <wtf/PassOwnPtr.h> +#include <wtf/text/AtomicStringImpl.h> + +namespace WebCore { + +class Document; +class StyleSheetContents; + +class StyleInvalidationAnalysis { +public: + StyleInvalidationAnalysis(const Vector<StyleSheetContents*>&); + + bool dirtiesAllStyle() const { return m_dirtiesAllStyle; } + void invalidateStyle(Document*); + +private: + + void analyzeStyleSheet(StyleSheetContents*); + + bool m_dirtiesAllStyle; + HashSet<AtomicStringImpl*> m_idScopes; + HashSet<AtomicStringImpl*> m_classScopes; +}; + +} + +#endif diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp index 072a0f779..9318b7a16 100644 --- a/Source/WebCore/css/StyleResolver.cpp +++ b/Source/WebCore/css/StyleResolver.cpp @@ -199,12 +199,6 @@ if (isInitial) { \ return;\ } -#define HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(prop, Prop) \ -HANDLE_INHERIT_AND_INITIAL(prop, Prop) \ -if (primitiveValue) \ - m_style->set##Prop(*primitiveValue); - - static RuleSet* defaultStyle; static RuleSet* defaultQuirksStyle; static RuleSet* defaultPrintStyle; @@ -337,7 +331,7 @@ StyleResolver::StyleResolver(Document* document, bool matchAuthorAndUserStyles) #endif addStylesheetsFromSeamlessParents(); - appendAuthorStylesheets(0, styleSheetCollection->authorStyleSheets()); + appendAuthorStyleSheets(0, styleSheetCollection->activeAuthorStyleSheets()); } void StyleResolver::addStylesheetsFromSeamlessParents() @@ -345,14 +339,14 @@ void StyleResolver::addStylesheetsFromSeamlessParents() // Build a list of stylesheet lists from our ancestors, and walk that // list in reverse order so that the root-most sheets are appended first. Document* childDocument = document(); - Vector<const Vector<RefPtr<StyleSheet> >* > ancestorSheets; + Vector<const Vector<RefPtr<CSSStyleSheet> >* > ancestorSheets; while (HTMLIFrameElement* parentIFrame = childDocument->seamlessParentIFrame()) { Document* parentDocument = parentIFrame->document(); - ancestorSheets.append(&parentDocument->styleSheetCollection()->authorStyleSheets()); + ancestorSheets.append(&parentDocument->styleSheetCollection()->activeAuthorStyleSheets()); childDocument = parentDocument; } for (int i = ancestorSheets.size() - 1; i >= 0; i--) - appendAuthorStylesheets(0, *ancestorSheets[i]); + appendAuthorStyleSheets(0, *ancestorSheets[i]); } void StyleResolver::addAuthorRulesAndCollectUserRulesFromSheets(const Vector<RefPtr<CSSStyleSheet> >* userSheets, RuleSet& userStyle) @@ -405,17 +399,14 @@ void StyleResolver::resetAuthorStyle() m_authorStyle->disableAutoShrinkToFit(); } -void StyleResolver::appendAuthorStylesheets(unsigned firstNew, const Vector<RefPtr<StyleSheet> >& stylesheets) +void StyleResolver::appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet> >& styleSheets) { // This handles sheets added to the end of the stylesheet list only. In other cases the style resolver // needs to be reconstructed. To handle insertions too the rule order numbers would need to be updated. - unsigned size = stylesheets.size(); + unsigned size = styleSheets.size(); for (unsigned i = firstNew; i < size; ++i) { - if (!stylesheets[i]->isCSSStyleSheet()) - continue; - CSSStyleSheet* cssSheet = static_cast<CSSStyleSheet*>(stylesheets[i].get()); - if (cssSheet->disabled()) - continue; + CSSStyleSheet* cssSheet = styleSheets[i].get(); + ASSERT(!cssSheet->disabled()); if (cssSheet->mediaQueries() && !m_medium->eval(cssSheet->mediaQueries(), this)) continue; StyleSheetContents* sheet = cssSheet->contents(); @@ -1547,8 +1538,8 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS // be propagated from shadow host to distributed node. if (m_distributedToInsertionPoint) { ASSERT(element->parentElement()); - ASSERT(element->parentElement()->renderStyle()); - m_style->setUserModify(element->parentElement()->renderStyle()->userModify()); + if (RenderStyle* styleOfShadowHost = element->parentElement()->renderStyle()) + m_style->setUserModify(styleOfShadowHost->userModify()); } if (element->isLink()) { @@ -2212,33 +2203,6 @@ bool StyleResolver::checkRegionSelector(CSSSelector* regionSelector, Element* re return false; } - -bool StyleResolver::determineStylesheetSelectorScopes(StyleSheetContents* stylesheet, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes) -{ - ASSERT(!stylesheet->isLoading()); - - const Vector<RefPtr<StyleRuleImport> >& importRules = stylesheet->importRules(); - for (unsigned i = 0; i < importRules.size(); ++i) { - if (!importRules[i]->styleSheet()) - continue; - if (!determineStylesheetSelectorScopes(importRules[i]->styleSheet(), idScopes, classScopes)) - return false; - } - - const Vector<RefPtr<StyleRuleBase> >& rules = stylesheet->childRules(); - for (unsigned i = 0; i < rules.size(); i++) { - StyleRuleBase* rule = rules[i].get(); - if (rule->isStyleRule()) { - StyleRule* styleRule = static_cast<StyleRule*>(rule); - if (!SelectorChecker::determineSelectorScopes(styleRule->selectorList(), idScopes, classScopes)) - return false; - continue; - } - // FIXME: Media rules and maybe some others could be allowed. - return false; - } - return true; -} // ------------------------------------------------------------------------------------- // this is mostly boring stuff on how to apply a certain rule to the renderstyle... @@ -2608,13 +2572,10 @@ static void collectCSSOMWrappers(HashMap<StyleRule*, RefPtr<CSSStyleRule> >& wra static void collectCSSOMWrappers(HashMap<StyleRule*, RefPtr<CSSStyleRule> >& wrapperMap, DocumentStyleSheetCollection* styleSheetCollection) { - const Vector<RefPtr<StyleSheet> >& styleSheets = styleSheetCollection->authorStyleSheets(); - for (unsigned i = 0; i < styleSheets.size(); ++i) { - StyleSheet* styleSheet = styleSheets[i].get(); - if (!styleSheet->isCSSStyleSheet()) - continue; - collectCSSOMWrappers(wrapperMap, static_cast<CSSStyleSheet*>(styleSheet)); - } + const Vector<RefPtr<CSSStyleSheet> >& styleSheets = styleSheetCollection->activeAuthorStyleSheets(); + for (unsigned i = 0; i < styleSheets.size(); ++i) + collectCSSOMWrappers(wrapperMap, styleSheets[i].get()); + collectCSSOMWrappers(wrapperMap, styleSheetCollection->pageUserSheet()); { const Vector<RefPtr<CSSStyleSheet> >* pageGroupUserSheets = styleSheetCollection->pageGroupUserSheets(); @@ -3544,9 +3505,13 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) // CSS Text Layout Module Level 3: Vertical writing support case CSSPropertyWebkitWritingMode: { - HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(writingMode, WritingMode) + HANDLE_INHERIT_AND_INITIAL(writingMode, WritingMode); + + if (primitiveValue) + m_style->setWritingMode(*primitiveValue); + // FIXME: It is not ok to modify document state while applying style. - if (!isInherit && !isInitial && m_element && m_element == m_element->document()->documentElement()) + if (m_element && m_element == m_element->document()->documentElement()) m_element->document()->setWritingModeSetOnDocumentElement(true); FontDescription fontDescription = m_style->fontDescription(); fontDescription.setOrientation(m_style->isHorizontalWritingMode() ? Horizontal : Vertical); @@ -3868,10 +3833,10 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) #endif case CSSPropertyWebkitRtlOrdering: case CSSPropertyWebkitTextCombine: -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextDecorationLine: case CSSPropertyWebkitTextDecorationStyle: -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT case CSSPropertyWebkitTextEmphasisColor: case CSSPropertyWebkitTextEmphasisPosition: case CSSPropertyWebkitTextEmphasisStyle: diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h index 8c9587877..5b514ce55 100644 --- a/Source/WebCore/css/StyleResolver.h +++ b/Source/WebCore/css/StyleResolver.h @@ -163,10 +163,7 @@ public: bool hasParentNode() const { return m_parentNode; } void resetAuthorStyle(); - void appendAuthorStylesheets(unsigned firstNew, const Vector<RefPtr<StyleSheet> >&); - - // Find the ids or classes the selectors on a stylesheet are scoped to. The selectors only apply to elements in subtrees where the root element matches the scope. - static bool determineStylesheetSelectorScopes(StyleSheetContents*, HashSet<AtomicStringImpl*>& idScopes, HashSet<AtomicStringImpl*>& classScopes); + void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet> >&); private: void initForStyleResolve(Element*, RenderStyle* parentStyle = 0, PseudoId = NOPSEUDO); diff --git a/Source/WebCore/css/StyleSheetList.cpp b/Source/WebCore/css/StyleSheetList.cpp index 0f8fc2517..228ce718d 100644 --- a/Source/WebCore/css/StyleSheetList.cpp +++ b/Source/WebCore/css/StyleSheetList.cpp @@ -45,12 +45,12 @@ inline const Vector<RefPtr<StyleSheet> >& StyleSheetList::styleSheets() const { if (!m_document) return m_detachedStyleSheets; - return m_document->styleSheetCollection()->authorStyleSheets(); + return m_document->styleSheetCollection()->styleSheetsForStyleSheetList(); } void StyleSheetList::detachFromDocument() { - m_detachedStyleSheets = m_document->styleSheetCollection()->authorStyleSheets(); + m_detachedStyleSheets = m_document->styleSheetCollection()->styleSheetsForStyleSheetList(); m_document = 0; } diff --git a/Source/WebCore/css/StyleSheetList.idl b/Source/WebCore/css/StyleSheetList.idl index fc9aea501..362430e4f 100644 --- a/Source/WebCore/css/StyleSheetList.idl +++ b/Source/WebCore/css/StyleSheetList.idl @@ -20,10 +20,9 @@ // Introduced in DOM Level 2: [ - JSGenerateIsReachable=ImplDocument, + GenerateIsReachable=ImplDocument, IndexedGetter, - NamedGetter, - V8DependentLifetime + NamedGetter ] interface StyleSheetList { readonly attribute unsigned long length; StyleSheet item(in [Optional=DefaultIsUndefined] unsigned long index); diff --git a/Source/WebCore/dom/ContainerNode.cpp b/Source/WebCore/dom/ContainerNode.cpp index 9b178d82a..06aae46e1 100644 --- a/Source/WebCore/dom/ContainerNode.cpp +++ b/Source/WebCore/dom/ContainerNode.cpp @@ -33,6 +33,7 @@ #include "Frame.h" #include "FrameView.h" #include "InlineTextBox.h" +#include "InsertionPoint.h" #include "InspectorInstrumentation.h" #include "MemoryCache.h" #include "MutationEvent.h" @@ -976,8 +977,10 @@ static void dispatchChildInsertionEvents(Node* child) static void dispatchChildRemovalEvents(Node* child) { - if (child->isInShadowTree()) + if (child->isInShadowTree()) { + InspectorInstrumentation::willRemoveDOMNode(child->document(), child); return; + } ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); @@ -1030,4 +1033,20 @@ static void updateTreeAfterInsertion(ContainerNode* parent, Node* child, bool sh dispatchChildInsertionEvents(child); } +#ifndef NDEBUG +bool childAttachedAllowedWhenAttachingChildren(ContainerNode* node) +{ + if (node->isShadowRoot()) + return true; + + if (isInsertionPoint(node)) + return true; + + if (node->isElementNode() && toElement(node)->shadow()) + return true; + + return false; +} +#endif + } // namespace WebCore diff --git a/Source/WebCore/dom/ContainerNode.h b/Source/WebCore/dom/ContainerNode.h index 7979c63c8..dd4a9898d 100644 --- a/Source/WebCore/dom/ContainerNode.h +++ b/Source/WebCore/dom/ContainerNode.h @@ -126,7 +126,6 @@ public: void attachAsNode(); void attachChildren(); - void attachChildrenIfNeeded(); void attachChildrenLazily(); void detachChildren(); void detachChildrenIfNeeded(); @@ -175,6 +174,10 @@ private: Node* m_lastChild; }; +#ifndef NDEBUG +bool childAttachedAllowedWhenAttachingChildren(ContainerNode*); +#endif + inline ContainerNode* toContainerNode(Node* node) { ASSERT(!node || node->isContainerNode()); @@ -204,13 +207,8 @@ inline void ContainerNode::attachAsNode() inline void ContainerNode::attachChildren() { - for (Node* child = firstChild(); child; child = child->nextSibling()) - child->attach(); -} - -inline void ContainerNode::attachChildrenIfNeeded() -{ for (Node* child = firstChild(); child; child = child->nextSibling()) { + ASSERT(!child->attached() || childAttachedAllowedWhenAttachingChildren(this)); if (!child->attached()) child->attach(); } diff --git a/Source/WebCore/dom/DOMImplementation.idl b/Source/WebCore/dom/DOMImplementation.idl index e1ff7b973..1b9205420 100644 --- a/Source/WebCore/dom/DOMImplementation.idl +++ b/Source/WebCore/dom/DOMImplementation.idl @@ -19,8 +19,7 @@ */ [ - JSGenerateIsReachable=ImplDocument, - V8DependentLifetime + GenerateIsReachable=ImplDocument, ] interface DOMImplementation { // DOM Level 1 diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index efe89f40f..e85c8f1c0 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -797,7 +797,7 @@ void Document::setCompatibilityMode(CompatibilityMode mode) { if (m_compatibilityModeLocked || mode == m_compatibilityMode) return; - ASSERT(m_styleSheetCollection->authorStyleSheets().isEmpty()); + ASSERT(m_styleSheetCollection->activeAuthorStyleSheets().isEmpty()); bool wasInQuirksMode = inQuirksMode(); m_compatibilityMode = mode; selectorQueryCache()->invalidate(); @@ -1926,6 +1926,7 @@ void Document::updateLayout() updateStyleIfNeeded(); + StackStats::LayoutCheckPoint layoutCheckPoint; // Only do a layout if changes have occurred that make it necessary. FrameView* v = view(); if (v && renderer() && (v->layoutPending() || renderer()->needsLayout())) @@ -5241,6 +5242,9 @@ void Document::webkitExitFullscreen() // 6. Return, and run the remaining steps asynchronously. // 7. Optionally, perform some animation. + if (!page()) + return; + // Only exit out of full screen window mode if there are no remaining elements in the // full screen stack. if (!newTop) { diff --git a/Source/WebCore/dom/DocumentOrderedMap.cpp b/Source/WebCore/dom/DocumentOrderedMap.cpp index 1297e5102..bbd8b3b16 100644 --- a/Source/WebCore/dom/DocumentOrderedMap.cpp +++ b/Source/WebCore/dom/DocumentOrderedMap.cpp @@ -55,6 +55,11 @@ inline bool keyMatchesLowercasedMapName(AtomicStringImpl* key, Element* element) return element->hasTagName(mapTag) && static_cast<HTMLMapElement*>(element)->getName().lower().impl() == key; } +inline bool keyMatchesLabelForAttribute(AtomicStringImpl* key, Element* element) +{ + return element->hasTagName(labelTag) && element->getAttribute(forAttr).impl() == key; +} + void DocumentOrderedMap::clear() { m_map.clear(); @@ -149,5 +154,9 @@ Element* DocumentOrderedMap::getElementByLowercasedMapName(AtomicStringImpl* key return get<keyMatchesLowercasedMapName>(key, scope); } -} // namespace WebCore +Element* DocumentOrderedMap::getElementByLabelForAttribute(AtomicStringImpl* key, const TreeScope* scope) const +{ + return get<keyMatchesLabelForAttribute>(key, scope); +} +} // namespace WebCore diff --git a/Source/WebCore/dom/DocumentOrderedMap.h b/Source/WebCore/dom/DocumentOrderedMap.h index 7d12686c3..1f9039e61 100644 --- a/Source/WebCore/dom/DocumentOrderedMap.h +++ b/Source/WebCore/dom/DocumentOrderedMap.h @@ -52,6 +52,7 @@ public: Element* getElementById(AtomicStringImpl*, const TreeScope*) const; Element* getElementByMapName(AtomicStringImpl*, const TreeScope*) const; Element* getElementByLowercasedMapName(AtomicStringImpl*, const TreeScope*) const; + Element* getElementByLabelForAttribute(AtomicStringImpl*, const TreeScope*) const; void checkConsistency() const; @@ -80,4 +81,3 @@ inline bool DocumentOrderedMap::containsMultiple(AtomicStringImpl* id) const } // namespace WebCore #endif // DocumentOrderedMap_h - diff --git a/Source/WebCore/dom/DocumentStyleSheetCollection.cpp b/Source/WebCore/dom/DocumentStyleSheetCollection.cpp index 84cb8fce9..bfd1e5f0f 100644 --- a/Source/WebCore/dom/DocumentStyleSheetCollection.cpp +++ b/Source/WebCore/dom/DocumentStyleSheetCollection.cpp @@ -41,6 +41,7 @@ #include "SVGStyleElement.h" #include "SelectorChecker.h" #include "Settings.h" +#include "StyleInvalidationAnalysis.h" #include "StyleResolver.h" #include "StyleSheetContents.h" #include "StyleSheetList.h" @@ -347,34 +348,7 @@ void DocumentStyleSheetCollection::collectActiveStyleSheets(Vector<RefPtr<StyleS } } -bool DocumentStyleSheetCollection::testAddedStyleSheetRequiresStyleRecalc(StyleSheetContents* stylesheet) -{ - // See if all rules on the sheet are scoped to some specific ids or classes. - // Then test if we actually have any of those in the tree at the moment. - HashSet<AtomicStringImpl*> idScopes; - HashSet<AtomicStringImpl*> classScopes; - if (!StyleResolver::determineStylesheetSelectorScopes(stylesheet, idScopes, classScopes)) - return true; - // Invalidate the subtrees that match the scopes. - Node* node = m_document->firstChild(); - while (node) { - if (!node->isStyledElement()) { - node = node->traverseNextNode(); - continue; - } - StyledElement* element = static_cast<StyledElement*>(node); - if (SelectorChecker::elementMatchesSelectorScopes(element, idScopes, classScopes)) { - element->setNeedsStyleRecalc(); - // The whole subtree is now invalidated, we can skip to the next sibling. - node = node->traverseNextSibling(); - continue; - } - node = node->traverseNextNode(); - } - return false; -} - -void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, StyleResolverUpdateType& styleResolverUpdateType, bool& requiresFullStyleRecalc) +void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets, StyleResolverUpdateType& styleResolverUpdateType, bool& requiresFullStyleRecalc) { styleResolverUpdateType = Reconstruct; requiresFullStyleRecalc = true; @@ -398,16 +372,16 @@ void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag return; // Find out which stylesheets are new. - unsigned oldStylesheetCount = m_authorStyleSheets.size(); + unsigned oldStylesheetCount = m_activeAuthorStyleSheets.size(); if (newStylesheetCount < oldStylesheetCount) return; - Vector<StyleSheet*> addedSheets; + Vector<StyleSheetContents*> addedSheets; unsigned newIndex = 0; for (unsigned oldIndex = 0; oldIndex < oldStylesheetCount; ++oldIndex) { if (newIndex >= newStylesheetCount) return; - while (m_authorStyleSheets[oldIndex] != newStylesheets[newIndex]) { - addedSheets.append(newStylesheets[newIndex].get()); + while (m_activeAuthorStyleSheets[oldIndex] != newStylesheets[newIndex]) { + addedSheets.append(newStylesheets[newIndex]->contents()); ++newIndex; if (newIndex == newStylesheetCount) return; @@ -416,7 +390,7 @@ void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag } bool hasInsertions = !addedSheets.isEmpty(); while (newIndex < newStylesheetCount) { - addedSheets.append(newStylesheets[newIndex].get()); + addedSheets.append(newStylesheets[newIndex]->contents()); ++newIndex; } // If all new sheets were added at the end of the list we can just add them to existing StyleResolver. @@ -426,28 +400,33 @@ void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs. if (!m_document->body() || m_document->hasNodesWithPlaceholderStyle()) return; - for (unsigned i = 0; i < addedSheets.size(); ++i) { - if (!addedSheets[i]->isCSSStyleSheet()) - return; - if (addedSheets[i]->disabled()) - continue; - if (testAddedStyleSheetRequiresStyleRecalc(static_cast<CSSStyleSheet*>(addedSheets[i])->contents())) - return; - } + StyleInvalidationAnalysis invalidationAnalysis(addedSheets); + if (invalidationAnalysis.dirtiesAllStyle()) + return; + invalidationAnalysis.invalidateStyle(m_document); requiresFullStyleRecalc = false; } -static bool styleSheetsUseRemUnits(const Vector<RefPtr<StyleSheet> >& sheets) +static bool styleSheetsUseRemUnits(const Vector<RefPtr<CSSStyleSheet> >& sheets) { for (unsigned i = 0; i < sheets.size(); ++i) { - if (!sheets[i]->isCSSStyleSheet()) - continue; - if (static_cast<CSSStyleSheet*>(sheets[i].get())->contents()->usesRemUnits()) + if (sheets[i]->contents()->usesRemUnits()) return true; } return false; } +static void filterEnabledCSSStyleSheets(Vector<RefPtr<CSSStyleSheet> >& result, const Vector<RefPtr<StyleSheet> >& sheets) +{ + for (unsigned i = 0; i < sheets.size(); ++i) { + if (!sheets[i]->isCSSStyleSheet()) + continue; + if (sheets[i]->disabled()) + continue; + result.append(static_cast<CSSStyleSheet*>(sheets[i].get())); + } +} + bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag) { if (m_document->inStyleRecalc()) { @@ -462,12 +441,15 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag if (!m_document->renderer() || !m_document->attached()) return false; - Vector<RefPtr<StyleSheet> > newStylesheets; - collectActiveStyleSheets(newStylesheets); + Vector<RefPtr<StyleSheet> > activeStyleSheets; + collectActiveStyleSheets(activeStyleSheets); + + Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets; + filterEnabledCSSStyleSheets(activeCSSStyleSheets, activeStyleSheets); StyleResolverUpdateType styleResolverUpdateType; bool requiresFullStyleRecalc; - analyzeStyleSheetChange(updateFlag, newStylesheets, styleResolverUpdateType, requiresFullStyleRecalc); + analyzeStyleSheetChange(updateFlag, activeCSSStyleSheets, styleResolverUpdateType, requiresFullStyleRecalc); if (styleResolverUpdateType == Reconstruct) m_document->clearStyleResolver(); @@ -475,16 +457,17 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag StyleResolver* styleResolver = m_document->styleResolver(); if (styleResolverUpdateType == Reset) { styleResolver->resetAuthorStyle(); - styleResolver->appendAuthorStylesheets(0, newStylesheets); + styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets); } else { ASSERT(styleResolverUpdateType == Additive); - styleResolver->appendAuthorStylesheets(m_authorStyleSheets.size(), newStylesheets); + styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), activeCSSStyleSheets); } resetCSSFeatureFlags(); } - m_authorStyleSheets.swap(newStylesheets); + m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); + m_styleSheetsForStyleSheetList.swap(activeStyleSheets); - m_usesRemUnits = styleSheetsUseRemUnits(m_authorStyleSheets); + m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); m_needsUpdateActiveStylesheetsOnStyleRecalc = false; m_document->notifySeamlessChildDocumentsOfStylesheetUpdate(); @@ -498,7 +481,8 @@ void DocumentStyleSheetCollection::reportMemoryUsage(MemoryObjectInfo* memoryObj info.addMember(m_pageUserSheet); info.addMember(m_pageGroupUserSheets); info.addMember(m_userSheets); - info.addMember(m_authorStyleSheets); + info.addMember(m_activeAuthorStyleSheets); + info.addMember(m_styleSheetsForStyleSheetList); info.addListHashSet(m_styleSheetCandidateNodes); info.addMember(m_preferredStylesheetSetName); info.addMember(m_selectedStylesheetSetName); diff --git a/Source/WebCore/dom/DocumentStyleSheetCollection.h b/Source/WebCore/dom/DocumentStyleSheetCollection.h index 3fb45f9ed..b67d88866 100644 --- a/Source/WebCore/dom/DocumentStyleSheetCollection.h +++ b/Source/WebCore/dom/DocumentStyleSheetCollection.h @@ -49,7 +49,9 @@ public: DocumentStyleSheetCollection(Document*); ~DocumentStyleSheetCollection(); - const Vector<RefPtr<StyleSheet> >& authorStyleSheets() { return m_authorStyleSheets; } + const Vector<RefPtr<StyleSheet> >& styleSheetsForStyleSheetList() { return m_styleSheetsForStyleSheetList; } + + const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() { return m_activeAuthorStyleSheets; } CSSStyleSheet* pageUserSheet(); const Vector<RefPtr<CSSStyleSheet> >* pageGroupUserSheets() const; @@ -101,17 +103,17 @@ public: private: void collectActiveStyleSheets(Vector<RefPtr<StyleSheet> >&); - bool testAddedStyleSheetRequiresStyleRecalc(StyleSheetContents*); enum StyleResolverUpdateType { Reconstruct, Reset, Additive }; - void analyzeStyleSheetChange(UpdateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, StyleResolverUpdateType&, bool& requiresFullStyleRecalc); + void analyzeStyleSheetChange(UpdateFlag, const Vector<RefPtr<CSSStyleSheet> >& newStylesheets, StyleResolverUpdateType&, bool& requiresFullStyleRecalc); Document* m_document; - Vector<RefPtr<StyleSheet> > m_authorStyleSheets; + Vector<RefPtr<StyleSheet> > m_styleSheetsForStyleSheetList; + Vector<RefPtr<CSSStyleSheet> > m_activeAuthorStyleSheets; // Track the number of currently loading top-level stylesheets needed for rendering. // Sheets loaded using the @import directive are not included in this count. diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp index 7cba51f0d..97dc9c9f6 100644 --- a/Source/WebCore/dom/Element.cpp +++ b/Source/WebCore/dom/Element.cpp @@ -48,6 +48,7 @@ #include "HTMLElement.h" #include "HTMLFormCollection.h" #include "HTMLFrameOwnerElement.h" +#include "HTMLLabelElement.h" #include "HTMLNames.h" #include "HTMLOptionsCollection.h" #include "HTMLParserIdioms.h" @@ -959,17 +960,15 @@ Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio if (!nameValue.isNull()) updateName(nullAtom, nameValue); - return InsertionDone; -} + if (hasTagName(labelTag)) { + TreeScope* scope = treeScope(); + if (scope->shouldCacheLabelsByForAttribute()) + updateLabel(scope, nullAtom, fastGetAttribute(forAttr)); + } -static inline TreeScope* treeScopeOfParent(Node* node, ContainerNode* insertionPoint) -{ - if (Node* parent = node->parentNode()) - parent->treeScope(); - return insertionPoint->treeScope(); + return InsertionDone; } - void Element::removedFrom(ContainerNode* insertionPoint) { #if ENABLE(FULLSCREEN_API) @@ -986,11 +985,17 @@ void Element::removedFrom(ContainerNode* insertionPoint) if (insertionPoint->inDocument()) { const AtomicString& idValue = getIdAttribute(); if (!idValue.isNull() && inDocument()) - updateId(treeScopeOfParent(this, insertionPoint), idValue, nullAtom); + updateId(insertionPoint->treeScope(), idValue, nullAtom); const AtomicString& nameValue = getNameAttribute(); if (!nameValue.isNull()) updateName(nameValue, nullAtom); + + if (hasTagName(labelTag)) { + TreeScope* treeScope = insertionPoint->treeScope(); + if (treeScope->shouldCacheLabelsByForAttribute()) + updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom); + } } ContainerNode::removedFrom(insertionPoint); @@ -1011,7 +1016,7 @@ void Element::attach() if (ElementShadow* shadow = this->shadow()) { parentPusher.push(); shadow->attach(); - attachChildrenIfNeeded(); + attachChildren(); attachAsNode(); } else { if (firstChild()) @@ -2133,12 +2138,33 @@ bool Element::hasNamedNodeMap() const } #endif +void Element::updateLabel(TreeScope* scope, const AtomicString& oldForAttributeValue, const AtomicString& newForAttributeValue) +{ + ASSERT(hasTagName(labelTag)); + + if (!inDocument()) + return; + + if (oldForAttributeValue == newForAttributeValue) + return; + + if (!oldForAttributeValue.isEmpty()) + scope->removeLabel(oldForAttributeValue, static_cast<HTMLLabelElement*>(this)); + if (!newForAttributeValue.isEmpty()) + scope->addLabel(newForAttributeValue, static_cast<HTMLLabelElement*>(this)); +} + void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue) { if (isIdAttributeName(name)) updateId(oldValue, newValue); else if (name == HTMLNames::nameAttr) updateName(oldValue, newValue); + else if (name == HTMLNames::forAttr && hasTagName(labelTag)) { + TreeScope* scope = treeScope(); + if (scope->shouldCacheLabelsByForAttribute()) + updateLabel(scope, oldValue, newValue); + } #if ENABLE(MUTATION_OBSERVERS) if (OwnPtr<MutationObserverInterestGroup> recipients = MutationObserverInterestGroup::createForAttributesMutation(this, name)) diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h index 58e297d15..519c50d77 100644 --- a/Source/WebCore/dom/Element.h +++ b/Source/WebCore/dom/Element.h @@ -315,6 +315,7 @@ public: void updateId(const AtomicString& oldId, const AtomicString& newId); void updateId(TreeScope*, const AtomicString& oldId, const AtomicString& newId); void updateName(const AtomicString& oldName, const AtomicString& newName); + void updateLabel(TreeScope*, const AtomicString& oldForAttributeValue, const AtomicString& newForAttributeValue); void removeCachedHTMLCollection(HTMLCollection*, CollectionType); diff --git a/Source/WebCore/dom/QualifiedName.cpp b/Source/WebCore/dom/QualifiedName.cpp index 783604732..daf11ce0c 100644 --- a/Source/WebCore/dom/QualifiedName.cpp +++ b/Source/WebCore/dom/QualifiedName.cpp @@ -135,6 +135,12 @@ void QualifiedName::init() } } +const QualifiedName& nullQName() +{ + DEFINE_STATIC_LOCAL(QualifiedName, nullName, (nullAtom, nullAtom, nullAtom)); + return nullName; +} + const AtomicString& QualifiedName::localNameUpper() const { if (!m_impl->m_localNameUpper) @@ -158,6 +164,12 @@ void QualifiedName::QualifiedNameImpl::reportMemoryUsage(MemoryObjectInfo* memor info.addMember(m_localNameUpper); } +unsigned QualifiedName::QualifiedNameImpl::computeHash() const +{ + QualifiedNameComponents components = { m_prefix.impl(), m_localName.impl(), m_namespace.impl() }; + return hashComponents(components); +} + void createQualifiedName(void* targetAddress, const char* name, unsigned nameLength, const AtomicString& nameNamespace) { AtomicString atomicName(name, nameLength, AtomicString::ConstructFromLiteral); diff --git a/Source/WebCore/dom/QualifiedName.h b/Source/WebCore/dom/QualifiedName.h index 28fab552c..cb84611a3 100644 --- a/Source/WebCore/dom/QualifiedName.h +++ b/Source/WebCore/dom/QualifiedName.h @@ -44,6 +44,9 @@ public: return adoptRef(new QualifiedNameImpl(prefix, localName, namespaceURI)); } + unsigned computeHash() const; + + mutable unsigned m_existingHash; const AtomicString m_prefix; const AtomicString m_localName; const AtomicString m_namespace; @@ -53,7 +56,8 @@ public: private: QualifiedNameImpl(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI) - : m_prefix(prefix) + : m_existingHash(0) + , m_prefix(prefix) , m_localName(localName) , m_namespace(namespaceURI) { @@ -110,6 +114,8 @@ extern const QualifiedName anyName; inline const QualifiedName& anyQName() { return anyName; } #endif +const QualifiedName& nullQName(); + inline bool operator==(const AtomicString& a, const QualifiedName& q) { return a == q.localName(); } inline bool operator!=(const AtomicString& a, const QualifiedName& q) { return a != q.localName(); } inline bool operator==(const QualifiedName& q, const AtomicString& a) { return a == q.localName(); } @@ -125,8 +131,9 @@ struct QualifiedNameHash { static unsigned hash(const QualifiedName::QualifiedNameImpl* name) { - QualifiedNameComponents c = { name->m_prefix.impl(), name->m_localName.impl(), name->m_namespace.impl() }; - return hashComponents(c); + if (!name->m_existingHash) + name->m_existingHash = name->computeHash(); + return name->m_existingHash; } static bool equal(const QualifiedName& a, const QualifiedName& b) { return a == b; } @@ -150,7 +157,7 @@ namespace WTF { template<> struct HashTraits<WebCore::QualifiedName> : SimpleClassHashTraits<WebCore::QualifiedName> { static const bool emptyValueIsZero = false; - static WebCore::QualifiedName emptyValue() { return WebCore::QualifiedName(nullAtom, nullAtom, nullAtom); } + static WebCore::QualifiedName emptyValue() { return WebCore::nullQName(); } }; } diff --git a/Source/WebCore/dom/ShadowRoot.cpp b/Source/WebCore/dom/ShadowRoot.cpp index 5180a1c22..0da9f27a9 100644 --- a/Source/WebCore/dom/ShadowRoot.cpp +++ b/Source/WebCore/dom/ShadowRoot.cpp @@ -215,7 +215,7 @@ void ShadowRoot::attach() { StyleResolver* styleResolver = document()->styleResolver(); styleResolver->pushParentShadowRoot(this); - attachChildrenIfNeeded(); + attachChildren(); attachAsNode(); styleResolver->popParentShadowRoot(this); } diff --git a/Source/WebCore/dom/TreeScope.cpp b/Source/WebCore/dom/TreeScope.cpp index afd343fb6..ec723d3da 100644 --- a/Source/WebCore/dom/TreeScope.cpp +++ b/Source/WebCore/dom/TreeScope.cpp @@ -36,6 +36,7 @@ #include "Frame.h" #include "HTMLAnchorElement.h" #include "HTMLFrameOwnerElement.h" +#include "HTMLLabelElement.h" #include "HTMLMapElement.h" #include "HTMLNames.h" #include "IdTargetObserverRegistry.h" @@ -55,6 +56,7 @@ using namespace HTMLNames; TreeScope::TreeScope(ContainerNode* rootNode) : m_rootNode(rootNode) , m_parentTreeScope(0) + , m_shouldCacheLabelsByForAttribute(false) , m_idTargetObserverRegistry(IdTargetObserverRegistry::create()) { ASSERT(rootNode); @@ -72,6 +74,7 @@ void TreeScope::destroyTreeScopeData() { m_elementsById.clear(); m_imageMapsByName.clear(); + m_labelsByForAttribute.clear(); } void TreeScope::setParentTreeScope(TreeScope* newParentScope) @@ -144,6 +147,36 @@ HTMLMapElement* TreeScope::getImageMap(const String& url) const return static_cast<HTMLMapElement*>(m_imageMapsByName.getElementByMapName(AtomicString(name).impl(), this)); } +void TreeScope::addLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element) +{ + m_labelsByForAttribute.add(forAttributeValue.impl(), element); +} + +void TreeScope::removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement* element) +{ + m_labelsByForAttribute.remove(forAttributeValue.impl(), element); +} + +HTMLLabelElement* TreeScope::labelElementForId(const AtomicString& forAttributeValue) +{ + if (!m_shouldCacheLabelsByForAttribute) { + m_shouldCacheLabelsByForAttribute = true; + for (Node* node = rootNode(); node; node = node->traverseNextNode()) { + if (node->hasTagName(labelTag)) { + HTMLLabelElement* label = static_cast<HTMLLabelElement*>(node); + const AtomicString& forValue = label->fastGetAttribute(forAttr); + if (!forValue.isEmpty()) + addLabel(forValue, label); + } + } + } + + if (forAttributeValue.isEmpty()) + return 0; + + return static_cast<HTMLLabelElement*>(m_labelsByForAttribute.getElementByLabelForAttribute(forAttributeValue.impl(), this)); +} + DOMSelection* TreeScope::getSelection() const { if (!rootNode()->document()->frame()) diff --git a/Source/WebCore/dom/TreeScope.h b/Source/WebCore/dom/TreeScope.h index d9758b028..9cae54de8 100644 --- a/Source/WebCore/dom/TreeScope.h +++ b/Source/WebCore/dom/TreeScope.h @@ -35,6 +35,7 @@ namespace WebCore { class ContainerNode; class DOMSelection; class Element; +class HTMLLabelElement; class HTMLMapElement; class IdTargetObserverRegistry; class Node; @@ -62,6 +63,12 @@ public: void removeImageMap(HTMLMapElement*); HTMLMapElement* getImageMap(const String& url) const; + // For accessibility. + bool shouldCacheLabelsByForAttribute() const { return m_shouldCacheLabelsByForAttribute; } + void addLabel(const AtomicString& forAttributeValue, HTMLLabelElement*); + void removeLabel(const AtomicString& forAttributeValue, HTMLLabelElement*); + HTMLLabelElement* labelElementForId(const AtomicString& forAttributeValue); + DOMSelection* getSelection() const; // Find first anchor with the given name. @@ -94,6 +101,9 @@ private: DocumentOrderedMap m_elementsById; DocumentOrderedMap m_imageMapsByName; + DocumentOrderedMap m_labelsByForAttribute; + bool m_shouldCacheLabelsByForAttribute; + OwnPtr<IdTargetObserverRegistry> m_idTargetObserverRegistry; mutable RefPtr<DOMSelection> m_selection; diff --git a/Source/WebCore/dom/WheelEvent.cpp b/Source/WebCore/dom/WheelEvent.cpp index e76c33ace..e76c33ace 100755..100644 --- a/Source/WebCore/dom/WheelEvent.cpp +++ b/Source/WebCore/dom/WheelEvent.cpp diff --git a/Source/WebCore/dom/WheelEvent.h b/Source/WebCore/dom/WheelEvent.h index 13576890d..13576890d 100755..100644 --- a/Source/WebCore/dom/WheelEvent.h +++ b/Source/WebCore/dom/WheelEvent.h diff --git a/Source/WebCore/editing/ReplaceSelectionCommand.cpp b/Source/WebCore/editing/ReplaceSelectionCommand.cpp index 0029335e7..c2b219878 100644 --- a/Source/WebCore/editing/ReplaceSelectionCommand.cpp +++ b/Source/WebCore/editing/ReplaceSelectionCommand.cpp @@ -1265,7 +1265,7 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P if (positionOnlyToBeUpdated.containerNode() == text) positionOnlyToBeUpdated.moveToOffset(previous->length() + positionOnlyToBeUpdated.offsetInContainerNode()); else if (positionOnlyToBeUpdated.containerNode() == previous) - positionOnlyToBeUpdated.moveToPosition(text, position.offsetInContainerNode()); + positionOnlyToBeUpdated.moveToPosition(text, positionOnlyToBeUpdated.offsetInContainerNode()); } else updatePositionForNodeRemoval(positionOnlyToBeUpdated, previous.get()); @@ -1273,13 +1273,14 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P } if (text->nextSibling() && text->nextSibling()->isTextNode()) { RefPtr<Text> next = toText(text->nextSibling()); - insertTextIntoNode(text, text->length(), next->data()); + unsigned originalLength = text->length(); + insertTextIntoNode(text, originalLength, next->data()); if (!positionIsOffsetInAnchor) updatePositionForNodeRemoval(position, next.get()); if (positionOnlyToBeUpdatedIsOffsetInAnchor && positionOnlyToBeUpdated.containerNode() == next) - positionOnlyToBeUpdated.moveToPosition(text, text->length() + position.offsetInContainerNode()); + positionOnlyToBeUpdated.moveToPosition(text, originalLength + positionOnlyToBeUpdated.offsetInContainerNode()); else updatePositionForNodeRemoval(positionOnlyToBeUpdated, next.get()); diff --git a/Source/WebCore/html/BaseTextInputType.cpp b/Source/WebCore/html/BaseTextInputType.cpp index dfc823d87..9a9540f70 100644 --- a/Source/WebCore/html/BaseTextInputType.cpp +++ b/Source/WebCore/html/BaseTextInputType.cpp @@ -55,4 +55,9 @@ bool BaseTextInputType::supportsPlaceholder() const return true; } +bool BaseTextInputType::supportsSelectionAPI() const +{ + return true; +} + } // namespace WebCore diff --git a/Source/WebCore/html/BaseTextInputType.h b/Source/WebCore/html/BaseTextInputType.h index b2a56c9a4..9a2efe07f 100644 --- a/Source/WebCore/html/BaseTextInputType.h +++ b/Source/WebCore/html/BaseTextInputType.h @@ -45,6 +45,7 @@ private: virtual bool isTextType() const OVERRIDE; virtual bool patternMismatch(const String&) const OVERRIDE; virtual bool supportsPlaceholder() const OVERRIDE; + virtual bool supportsSelectionAPI() const OVERRIDE; }; } // namespace WebCore diff --git a/Source/WebCore/html/DateTimeInputType.cpp b/Source/WebCore/html/DateTimeInputType.cpp index 1746a13cf..c4c0473ba 100644 --- a/Source/WebCore/html/DateTimeInputType.cpp +++ b/Source/WebCore/html/DateTimeInputType.cpp @@ -160,6 +160,14 @@ void DateTimeInputType::setupLayoutParameters(DateTimeEditElement::LayoutParamet } #endif +String DateTimeInputType::sanitizeValue(const String& proposedValue) const +{ + DateComponents date; + if (!parseToDateComponents(proposedValue, &date)) + return String(); + return date.toString(); +} + } // namespace WebCore #endif diff --git a/Source/WebCore/html/DateTimeInputType.h b/Source/WebCore/html/DateTimeInputType.h index ee3842019..b0dda1049 100644 --- a/Source/WebCore/html/DateTimeInputType.h +++ b/Source/WebCore/html/DateTimeInputType.h @@ -57,6 +57,7 @@ private: virtual bool parseToDateComponentsInternal(const UChar*, unsigned length, DateComponents*) const OVERRIDE; virtual bool setMillisecondToDateComponents(double, DateComponents*) const OVERRIDE; virtual bool isDateTimeField() const OVERRIDE; + virtual String sanitizeValue(const String&) const OVERRIDE; #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) // BaseMultipleFieldsDateAndTimeInputType functions diff --git a/Source/WebCore/html/EmailInputType.cpp b/Source/WebCore/html/EmailInputType.cpp index 2395fc82f..cad4a3e0b 100644 --- a/Source/WebCore/html/EmailInputType.cpp +++ b/Source/WebCore/html/EmailInputType.cpp @@ -93,6 +93,11 @@ bool EmailInputType::isEmailField() const return true; } +bool EmailInputType::supportsSelectionAPI() const +{ + return false; +} + String EmailInputType::sanitizeValue(const String& proposedValue) const { String noLineBreakValue = proposedValue.removeCharacters(isHTMLLineBreak); diff --git a/Source/WebCore/html/EmailInputType.h b/Source/WebCore/html/EmailInputType.h index e9a7b9ac6..2d45347c7 100644 --- a/Source/WebCore/html/EmailInputType.h +++ b/Source/WebCore/html/EmailInputType.h @@ -46,6 +46,7 @@ private: virtual bool typeMismatch() const OVERRIDE; virtual String typeMismatchText() const OVERRIDE; virtual bool isEmailField() const OVERRIDE; + virtual bool supportsSelectionAPI() const OVERRIDE; virtual String sanitizeValue(const String&) const OVERRIDE; }; diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp index f9e3ebc38..7b777be13 100644 --- a/Source/WebCore/html/HTMLAnchorElement.cpp +++ b/Source/WebCore/html/HTMLAnchorElement.cpp @@ -35,7 +35,6 @@ #include "HTMLParserIdioms.h" #include "KeyboardEvent.h" #include "MouseEvent.h" -#include "Page.h" #include "PingLoader.h" #include "RenderImage.h" #include "SecurityOrigin.h" @@ -227,12 +226,6 @@ void HTMLAnchorElement::parseAttribute(const Attribute& attribute) if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "https") || parsedURL.startsWith("//")) prefetchDNS(document()->completeURL(parsedURL).host()); } - if (document()->page() && !document()->page()->javaScriptURLsAreAllowed() && protocolIsJavaScript(parsedURL)) { - clearIsLink(); - // FIXME: This is horribly factored. - if (Attribute* hrefAttribute = getAttributeItem(hrefAttr)) - hrefAttribute->setValue(nullAtom); - } } invalidateCachedVisitedLinkHash(); } else if (attribute.name() == nameAttr || attribute.name() == titleAttr) { diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp index 027f60f5e..c4a8bf675 100644 --- a/Source/WebCore/html/HTMLInputElement.cpp +++ b/Source/WebCore/html/HTMLInputElement.cpp @@ -1877,4 +1877,24 @@ void ListAttributeTargetObserver::idTargetChanged() } #endif +void HTMLInputElement::setRangeText(const String& replacement, ExceptionCode& ec) +{ + if (!m_inputType->supportsSelectionAPI()) { + ec = INVALID_STATE_ERR; + return; + } + + HTMLTextFormControlElement::setRangeText(replacement, ec); +} + +void HTMLInputElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode& ec) +{ + if (!m_inputType->supportsSelectionAPI()) { + ec = INVALID_STATE_ERR; + return; + } + + HTMLTextFormControlElement::setRangeText(replacement, start, end, selectionMode, ec); +} + } // namespace diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h index 4184dc977..ac013d980 100644 --- a/Source/WebCore/html/HTMLInputElement.h +++ b/Source/WebCore/html/HTMLInputElement.h @@ -287,6 +287,9 @@ public: static Vector<FileChooserFileInfo> filesFromFileInputFormControlState(const FormControlState&); + virtual void setRangeText(const String& replacement, ExceptionCode&) OVERRIDE; + virtual void setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode&) OVERRIDE; + protected: HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser); void createShadowSubtree(); diff --git a/Source/WebCore/html/HTMLInputElement.idl b/Source/WebCore/html/HTMLInputElement.idl index 3c360477a..4a86fe23f 100644 --- a/Source/WebCore/html/HTMLInputElement.idl +++ b/Source/WebCore/html/HTMLInputElement.idl @@ -78,6 +78,13 @@ interface HTMLInputElement : HTMLElement { [Custom] attribute long selectionStart; [Custom] attribute long selectionEnd; [Custom] attribute DOMString selectionDirection; + + void setRangeText(in DOMString replacement) raises(DOMException); + void setRangeText(in DOMString replacement, + in unsigned long start, + in unsigned long end, + in [Optional=DefaultIsNullString] DOMString selectionMode) raises(DOMException); + #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C [Custom] void setSelectionRange(in long start, in long end); #else diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp index ebeee1b40..753242110 100644 --- a/Source/WebCore/html/HTMLMediaElement.cpp +++ b/Source/WebCore/html/HTMLMediaElement.cpp @@ -1516,6 +1516,29 @@ void HTMLMediaElement::mediaPlayerNetworkStateChanged(MediaPlayer*) endProcessingMediaPlayerCallback(); } +static void logMediaLoadRequest(Page* page, const String& mediaEngine, const String& errorMessage, bool succeeded) +{ + if (!page || !page->settings()->diagnosticLoggingEnabled()) + return; + + ChromeClient* client = page->chrome()->client(); + + if (!succeeded) { + client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), errorMessage, DiagnosticLoggingKeys::failKey()); + return; + } + + client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), mediaEngine, DiagnosticLoggingKeys::noopKey()); + + if (!page->hasSeenAnyMediaEngine()) + client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey(), emptyString(), DiagnosticLoggingKeys::noopKey()); + + if (!page->hasSeenMediaEngine(mediaEngine)) + client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsMediaEngineKey(), mediaEngine, DiagnosticLoggingKeys::noopKey()); + + page->sawMediaEngine(mediaEngine); +} + static String stringForNetworkState(MediaPlayer::NetworkState state) { switch (state) { @@ -1567,8 +1590,7 @@ void HTMLMediaElement::mediaLoadingFailed(MediaPlayer::NetworkState error) mediaControls()->reportedError(); } - if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled()) - document()->page()->chrome()->client()->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), stringForNetworkState(error), DiagnosticLoggingKeys::failKey()); + logMediaLoadRequest(document()->page(), String(), stringForNetworkState(error), false); } void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state) @@ -1698,8 +1720,7 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state) if (renderer()) renderer()->updateFromElement(); - if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled()) - document()->page()->chrome()->client()->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), m_player->engineDescription(), DiagnosticLoggingKeys::noopKey()); + logMediaLoadRequest(document()->page(), m_player->engineDescription(), String(), true); } bool shouldUpdateDisplayState = false; diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp index 7e7c27513..f1720b8d5 100644 --- a/Source/WebCore/html/HTMLPlugInImageElement.cpp +++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp @@ -50,7 +50,9 @@ HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Doc { setHasCustomCallbacks(); - if (document->page() && document->page()->settings()->plugInSnapshottingEnabled()) + if (document->page() + && document->page()->settings()->plugInSnapshottingEnabled() + && !ScriptController::processingUserGesture()) setDisplayState(WaitingForSnapshot); } diff --git a/Source/WebCore/html/HTMLTextAreaElement.idl b/Source/WebCore/html/HTMLTextAreaElement.idl index df8867ace..ce9302676 100644 --- a/Source/WebCore/html/HTMLTextAreaElement.idl +++ b/Source/WebCore/html/HTMLTextAreaElement.idl @@ -50,6 +50,13 @@ interface HTMLTextAreaElement : HTMLElement { attribute long selectionStart; attribute long selectionEnd; attribute DOMString selectionDirection; + + void setRangeText(in DOMString replacement) raises(DOMException); + void setRangeText(in DOMString replacement, + in unsigned long start, + in unsigned long end, + in [Optional=DefaultIsNullString] DOMString selectionMode) raises(DOMException); + #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C void setSelectionRange(in long start, in long end); #else diff --git a/Source/WebCore/html/HTMLTextFormControlElement.cpp b/Source/WebCore/html/HTMLTextFormControlElement.cpp index fcde35ae6..7aacfcb67 100644 --- a/Source/WebCore/html/HTMLTextFormControlElement.cpp +++ b/Source/WebCore/html/HTMLTextFormControlElement.cpp @@ -229,6 +229,66 @@ static inline bool hasVisibleTextArea(RenderTextControl* textControl, HTMLElemen return textControl->style()->visibility() != HIDDEN && innerText && innerText->renderer() && innerText->renderBox()->height(); } + +void HTMLTextFormControlElement::setRangeText(const String& replacement, ExceptionCode& ec) +{ + setRangeText(replacement, selectionStart(), selectionEnd(), String(), ec); +} + +void HTMLTextFormControlElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode& ec) +{ + if (start > end) { + ec = INDEX_SIZE_ERR; + return; + } + + String text = innerTextValue(); + unsigned textLength = text.length(); + unsigned replacementLength = replacement.length(); + unsigned newSelectionStart = selectionStart(); + unsigned newSelectionEnd = selectionEnd(); + + start = std::min(start, textLength); + end = std::min(end, textLength); + + if (start < end) + text.replace(start, end - start, replacement); + else + text.insert(replacement, start); + + setInnerTextValue(text); + + // FIXME: What should happen to the value (as in value()) if there's no renderer? + if (!renderer()) + return; + + subtreeHasChanged(); + + if (equalIgnoringCase(selectionMode, "select")) { + newSelectionStart = start; + newSelectionEnd = start + replacementLength; + } else if (equalIgnoringCase(selectionMode, "start")) + newSelectionStart = newSelectionEnd = start; + else if (equalIgnoringCase(selectionMode, "end")) + newSelectionStart = newSelectionEnd = start + replacementLength; + else { + // Default is "preserve". + long delta = replacementLength - (end - start); + + if (newSelectionStart > end) + newSelectionStart += delta; + else if (newSelectionStart > start) + newSelectionStart = start; + + if (newSelectionEnd > end) + newSelectionEnd += delta; + else if (newSelectionEnd > start) + newSelectionEnd = start + replacementLength; + } + + setSelectionRange(newSelectionStart, newSelectionEnd, SelectionHasNoDirection); +} + void HTMLTextFormControlElement::setSelectionRange(int start, int end, const String& directionString) { TextFieldSelectionDirection direction = SelectionHasNoDirection; diff --git a/Source/WebCore/html/HTMLTextFormControlElement.h b/Source/WebCore/html/HTMLTextFormControlElement.h index f843d6dee..c7e869165 100644 --- a/Source/WebCore/html/HTMLTextFormControlElement.h +++ b/Source/WebCore/html/HTMLTextFormControlElement.h @@ -64,6 +64,8 @@ public: void setSelectionEnd(int); void setSelectionDirection(const String&); void select(); + virtual void setRangeText(const String& replacement, ExceptionCode&); + virtual void setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode&); void setSelectionRange(int start, int end, const String& direction); void setSelectionRange(int start, int end, TextFieldSelectionDirection = SelectionHasNoDirection); PassRefPtr<Range> selection() const; diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp index 38d79eea8..4195e8ed7 100644 --- a/Source/WebCore/html/InputType.cpp +++ b/Source/WebCore/html/InputType.cpp @@ -934,6 +934,11 @@ bool InputType::supportsIndeterminateAppearance() const return false; } +bool InputType::supportsSelectionAPI() const +{ + return false; +} + unsigned InputType::height() const { return 0; diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h index 87a4c12a8..0c2f010b7 100644 --- a/Source/WebCore/html/InputType.h +++ b/Source/WebCore/html/InputType.h @@ -306,6 +306,8 @@ public: virtual bool supportsIndeterminateAppearance() const; + virtual bool supportsSelectionAPI() const; + // Gets width and height of the input element if the type of the // element is image. It returns 0 if the element is not image type. virtual unsigned height() const; diff --git a/Source/WebCore/html/MonthInputType.cpp b/Source/WebCore/html/MonthInputType.cpp index b58743878..9bb2f9aef 100644 --- a/Source/WebCore/html/MonthInputType.cpp +++ b/Source/WebCore/html/MonthInputType.cpp @@ -154,7 +154,7 @@ String MonthInputType::formatDateTimeFieldsState(const DateTimeFieldsState& date void MonthInputType::setupLayoutParameters(DateTimeEditElement::LayoutParameters& layoutParameters, const DateComponents& date) const { - layoutParameters.dateTimeFormat = monthFormatInLDML(); + layoutParameters.dateTimeFormat = layoutParameters.localizer.monthFormat(); layoutParameters.fallbackDateTimeFormat = "MM/yyyy"; layoutParameters.minimumYear = fullYear(element()->fastGetAttribute(minAttr)); layoutParameters.maximumYear = fullYear(element()->fastGetAttribute(maxAttr)); diff --git a/Source/WebCore/html/canvas/DataView.cpp b/Source/WebCore/html/canvas/DataView.cpp index 3e55d3776..3e55d3776 100755..100644 --- a/Source/WebCore/html/canvas/DataView.cpp +++ b/Source/WebCore/html/canvas/DataView.cpp diff --git a/Source/WebCore/html/canvas/DataView.idl b/Source/WebCore/html/canvas/DataView.idl index e4ad072ab..e4ad072ab 100755..100644 --- a/Source/WebCore/html/canvas/DataView.idl +++ b/Source/WebCore/html/canvas/DataView.idl diff --git a/Source/WebCore/html/canvas/OESElementIndexUint.cpp b/Source/WebCore/html/canvas/OESElementIndexUint.cpp new file mode 100644 index 000000000..f9df0bc15 --- /dev/null +++ b/Source/WebCore/html/canvas/OESElementIndexUint.cpp @@ -0,0 +1,55 @@ +/* + * 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" + +#if ENABLE(WEBGL) + +#include "OESElementIndexUint.h" + +namespace WebCore { + +OESElementIndexUint::OESElementIndexUint(WebGLRenderingContext* context) + : WebGLExtension(context) +{ +} + +OESElementIndexUint::~OESElementIndexUint() +{ +} + +WebGLExtension::ExtensionName OESElementIndexUint::getName() const +{ + return OESElementIndexUintName; +} + +PassOwnPtr<OESElementIndexUint> OESElementIndexUint::create(WebGLRenderingContext* context) +{ + return adoptPtr(new OESElementIndexUint(context)); +} + +} // namespace WebCore + +#endif // ENABLE(WEBGL) diff --git a/Source/WebCore/html/canvas/OESElementIndexUint.h b/Source/WebCore/html/canvas/OESElementIndexUint.h new file mode 100644 index 000000000..c2d42873a --- /dev/null +++ b/Source/WebCore/html/canvas/OESElementIndexUint.h @@ -0,0 +1,47 @@ +/* + * 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. + */ + +#ifndef OESElementIndexUint_h +#define OESElementIndexUint_h + +#include "WebGLExtension.h" +#include <wtf/PassOwnPtr.h> + +namespace WebCore { + +class OESElementIndexUint : public WebGLExtension { +public: + static PassOwnPtr<OESElementIndexUint> create(WebGLRenderingContext*); + + virtual ~OESElementIndexUint(); + virtual ExtensionName getName() const; + +private: + OESElementIndexUint(WebGLRenderingContext*); +}; + +} // namespace WebCore + +#endif // OESElementIndexUint_h diff --git a/Source/WebCore/html/canvas/OESElementIndexUint.idl b/Source/WebCore/html/canvas/OESElementIndexUint.idl new file mode 100644 index 000000000..4a5640153 --- /dev/null +++ b/Source/WebCore/html/canvas/OESElementIndexUint.idl @@ -0,0 +1,33 @@ +/* + * 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. + */ + +module html { + interface [ + Conditional=WEBGL, + JSGenerateIsReachable=ImplContext, + OmitConstructor + ] OESElementIndexUint { + }; +} diff --git a/Source/WebCore/html/canvas/WebGLExtension.h b/Source/WebCore/html/canvas/WebGLExtension.h index 6968a02b4..ffec616ca 100644 --- a/Source/WebCore/html/canvas/WebGLExtension.h +++ b/Source/WebCore/html/canvas/WebGLExtension.h @@ -44,6 +44,7 @@ public: WebGLDebugShadersName, WebKitWebGLCompressedTextureS3TCName, // WEBKIT_ prefix until extension is official WebKitWebGLDepthTextureName, // WEBKIT_ prefix until extension is official + OESElementIndexUintName, }; void ref() { m_context->ref(); } diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp index 749d51914..f4c7ae128 100644 --- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp +++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp @@ -45,6 +45,7 @@ #include "ImageData.h" #include "IntSize.h" #include "NotImplemented.h" +#include "OESElementIndexUint.h" #include "OESStandardDerivatives.h" #include "OESTextureFloat.h" #include "OESVertexArrayObject.h" @@ -1690,7 +1691,18 @@ bool WebGLRenderingContext::validateElementArraySize(GC3Dsizei count, GC3Denum t if (offset < 0) return false; - if (type == GraphicsContext3D::UNSIGNED_SHORT) { + if (type == GraphicsContext3D::UNSIGNED_INT) { + // For an unsigned int array, offset must be divisible by 4 for alignment reasons. + if (offset % 4) + return false; + + // Make uoffset an element offset. + offset /= 4; + + GC3Dsizeiptr n = elementArrayBuffer->byteLength() / 4; + if (offset > n || count > n - offset) + return false; + } else if (type == GraphicsContext3D::UNSIGNED_SHORT) { // For an unsigned short array, offset must be divisible by 2 for alignment reasons. if (offset % 2) return false; @@ -1709,7 +1721,7 @@ bool WebGLRenderingContext::validateElementArraySize(GC3Dsizei count, GC3Denum t return true; } -bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, int& numElementsRequired) +bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, unsigned& numElementsRequired) { // Performs conservative validation by caching a maximum index of // the given type per element array buffer. If all of the bound @@ -1746,6 +1758,15 @@ bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, int& n maxIndex = max(maxIndex, static_cast<int>(p[i])); break; } + case GraphicsContext3D::UNSIGNED_INT: { + if (!m_oesElementIndexUint) + return false; + numElements /= sizeof(GC3Duint); + const GC3Duint* p = static_cast<const GC3Duint*>(buffer->data()); + for (GC3Dsizeiptr i = 0; i < numElements; i++) + maxIndex = max(maxIndex, static_cast<int>(p[i])); + break; + } default: return false; } @@ -1762,10 +1783,10 @@ bool WebGLRenderingContext::validateIndexArrayConservative(GC3Denum type, int& n return false; } -bool WebGLRenderingContext::validateIndexArrayPrecise(GC3Dsizei count, GC3Denum type, GC3Dintptr offset, int& numElementsRequired) +bool WebGLRenderingContext::validateIndexArrayPrecise(GC3Dsizei count, GC3Denum type, GC3Dintptr offset, unsigned& numElementsRequired) { ASSERT(count >= 0 && offset >= 0); - int lastIndex = -1; + unsigned lastIndex = 0; RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer(); @@ -1783,7 +1804,16 @@ bool WebGLRenderingContext::validateIndexArrayPrecise(GC3Dsizei count, GC3Denum unsigned long uoffset = offset; unsigned long n = count; - if (type == GraphicsContext3D::UNSIGNED_SHORT) { + if (type == GraphicsContext3D::UNSIGNED_INT) { + // Make uoffset an element offset. + uoffset /= sizeof(GC3Duint); + const GC3Duint* p = static_cast<const GC3Duint*>(elementArrayBuffer->elementArrayBuffer()->data()) + uoffset; + while (n-- > 0) { + if (*p > lastIndex) + lastIndex = *p; + ++p; + } + } else if (type == GraphicsContext3D::UNSIGNED_SHORT) { // Make uoffset an element offset. uoffset /= sizeof(GC3Dushort); const GC3Dushort* p = static_cast<const GC3Dushort*>(elementArrayBuffer->elementArrayBuffer()->data()) + uoffset; @@ -1806,7 +1836,7 @@ bool WebGLRenderingContext::validateIndexArrayPrecise(GC3Dsizei count, GC3Denum return numElementsRequired > 0; } -bool WebGLRenderingContext::validateRenderingState(int numElementsRequired) +bool WebGLRenderingContext::validateRenderingState(unsigned numElementsRequired) { if (!m_currentProgram) return false; @@ -1823,7 +1853,7 @@ bool WebGLRenderingContext::validateRenderingState(int numElementsRequired) return true; // Look in each consumed vertex attrib (by the current program) and find the smallest buffer size - int smallestNumElements = INT_MAX; + unsigned smallestNumElements = UINT_MAX; int numActiveAttribLocations = m_currentProgram->numActiveAttribLocations(); for (int i = 0; i < numActiveAttribLocations; ++i) { int loc = m_currentProgram->getActiveAttribLocation(i); @@ -1834,7 +1864,7 @@ bool WebGLRenderingContext::validateRenderingState(int numElementsRequired) // For the last element, we will only touch the data for the // element and nothing beyond it. int bytesRemaining = static_cast<int>(state.bufferBinding->byteLength() - state.offset); - int numElements = 0; + unsigned numElements = 0; ASSERT(state.stride > 0); if (bytesRemaining >= state.bytesPerElement) numElements = 1 + (bytesRemaining - state.bytesPerElement) / state.stride; @@ -1934,6 +1964,11 @@ void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denu case GraphicsContext3D::UNSIGNED_BYTE: case GraphicsContext3D::UNSIGNED_SHORT: break; + case GraphicsContext3D::UNSIGNED_INT: + if (m_oesElementIndexUint) + break; + synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "drawElements", "invalid type"); + return; default: synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "drawElements", "invalid type"); return; @@ -1954,7 +1989,7 @@ void WebGLRenderingContext::drawElements(GC3Denum mode, GC3Dsizei count, GC3Denu return; } - int numElements = 0; + unsigned numElements = 0; if (!isErrorGeneratedOnOutOfBoundsAccesses()) { // Ensure we have a valid rendering state if (!validateElementArraySize(count, type, static_cast<GC3Dintptr>(offset))) { @@ -2315,6 +2350,14 @@ WebGLExtension* WebGLRenderingContext::getExtension(const String& name) } return m_oesVertexArrayObject.get(); } + if (equalIgnoringCase(name, "OES_element_index_uint") + && m_context->getExtensions()->supports("GL_OES_element_index_uint")) { + if (!m_oesElementIndexUint) { + m_context->getExtensions()->ensureEnabled("GL_OES_element_index_uint"); + m_oesElementIndexUint = OESElementIndexUint::create(this); + } + return m_oesElementIndexUint.get(); + } if (equalIgnoringCase(name, "WEBKIT_WEBGL_lose_context") // FIXME: remove this after a certain grace period. || equalIgnoringCase(name, "WEBKIT_lose_context")) { @@ -2816,6 +2859,8 @@ Vector<String> WebGLRenderingContext::getSupportedExtensions() result.append("WEBKIT_EXT_texture_filter_anisotropic"); if (m_context->getExtensions()->supports("GL_OES_vertex_array_object")) result.append("OES_vertex_array_object"); + if (m_context->getExtensions()->supports("GL_OES_element_index_uint")) + result.append("OES_element_index_uint"); result.append("WEBKIT_WEBGL_lose_context"); if (WebGLCompressedTextureS3TC::supported(this)) result.append("WEBKIT_WEBGL_compressed_texture_s3tc"); diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.h b/Source/WebCore/html/canvas/WebGLRenderingContext.h index 26fc66c5b..86eb829f2 100644 --- a/Source/WebCore/html/canvas/WebGLRenderingContext.h +++ b/Source/WebCore/html/canvas/WebGLRenderingContext.h @@ -49,6 +49,7 @@ class IntSize; class OESStandardDerivatives; class OESTextureFloat; class OESVertexArrayObject; +class OESElementIndexUint; class WebGLActiveInfo; class WebGLBuffer; class WebGLContextGroup; @@ -358,12 +359,12 @@ public: bool validateElementArraySize(GC3Dsizei count, GC3Denum type, GC3Dintptr offset); // Conservative but quick index validation - bool validateIndexArrayConservative(GC3Denum type, int& numElementsRequired); + bool validateIndexArrayConservative(GC3Denum type, unsigned& numElementsRequired); // Precise but slow index validation -- only done if conservative checks fail - bool validateIndexArrayPrecise(GC3Dsizei count, GC3Denum type, GC3Dintptr offset, int& numElementsRequired); + bool validateIndexArrayPrecise(GC3Dsizei count, GC3Denum type, GC3Dintptr offset, unsigned& numElementsRequired); // If numElements <= 0, we only check if each enabled vertex attribute is bound to a buffer. - bool validateRenderingState(int numElements); + bool validateRenderingState(unsigned numElements); bool validateWebGLObject(const char*, WebGLObject*); @@ -505,6 +506,7 @@ public: OwnPtr<OESTextureFloat> m_oesTextureFloat; OwnPtr<OESStandardDerivatives> m_oesStandardDerivatives; OwnPtr<OESVertexArrayObject> m_oesVertexArrayObject; + OwnPtr<OESElementIndexUint> m_oesElementIndexUint; OwnPtr<WebGLLoseContext> m_webglLoseContext; OwnPtr<WebGLDebugRendererInfo> m_webglDebugRendererInfo; OwnPtr<WebGLDebugShaders> m_webglDebugShaders; diff --git a/Source/WebCore/html/shadow/ContentDistributor.cpp b/Source/WebCore/html/shadow/ContentDistributor.cpp index ec367ef2c..6929fdc50 100644 --- a/Source/WebCore/html/shadow/ContentDistributor.cpp +++ b/Source/WebCore/html/shadow/ContentDistributor.cpp @@ -58,7 +58,7 @@ void ContentDistributor::distribute(Element* host) ContentDistribution pool; for (Node* node = host->firstChild(); node; node = node->nextSibling()) { - if (!isInsertionPoint(node)) { + if (!isHTMLContentElement(node)) { pool.append(node); continue; } @@ -72,6 +72,7 @@ void ContentDistributor::distribute(Element* host) pool.append(fallbackNode); } } + Vector<bool> distributed(pool.size()); distributed.fill(false); diff --git a/Source/WebCore/html/shadow/DateTimeEditElement.cpp b/Source/WebCore/html/shadow/DateTimeEditElement.cpp index 338c8633a..1b644d4c9 100644 --- a/Source/WebCore/html/shadow/DateTimeEditElement.cpp +++ b/Source/WebCore/html/shadow/DateTimeEditElement.cpp @@ -90,8 +90,10 @@ bool DateTimeEditBuilder::needMillisecondField() const || !stepRange().step().remainder(static_cast<int>(msPerSecond)).isZero(); } -void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int) +void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int count) { + // In LDML, M and MM are numeric, and MMM, MMMM, and MMMMM are symbolic. + const int symbolicMonthThreshold = 3; Document* const document = m_editElement.document(); switch (fieldType) { @@ -124,8 +126,19 @@ void DateTimeEditBuilder::visitField(DateTimeFormat::FieldType fieldType, int) } case DateTimeFormat::FieldTypeMonth: - // We always use "MM", two digits month, even if "M", "MMM", "MMMM", or "MMMMM". - m_editElement.addField(DateTimeMonthFieldElement::create(document, m_editElement, m_parameters.placeholderForMonth)); + if (count >= symbolicMonthThreshold) { + // We always use abbreviations. + m_editElement.addField(DateTimeSymbolicMonthFieldElement::create(document, m_editElement, m_parameters.localizer.shortMonthLabels())); + } else + m_editElement.addField(DateTimeMonthFieldElement::create(document, m_editElement, m_parameters.placeholderForMonth)); + return; + + case DateTimeFormat::FieldTypeMonthStandAlone: + if (count >= symbolicMonthThreshold) { + // We always use abbreviations. + m_editElement.addField(DateTimeSymbolicMonthFieldElement::create(document, m_editElement, m_parameters.localizer.shortStandAloneMonthLabels())); + } else + m_editElement.addField(DateTimeMonthFieldElement::create(document, m_editElement, m_parameters.placeholderForMonth)); return; case DateTimeFormat::FieldTypePeriod: diff --git a/Source/WebCore/html/shadow/DateTimeFieldElements.cpp b/Source/WebCore/html/shadow/DateTimeFieldElements.cpp index adcc7227a..b5c9ef1e6 100644 --- a/Source/WebCore/html/shadow/DateTimeFieldElements.cpp +++ b/Source/WebCore/html/shadow/DateTimeFieldElements.cpp @@ -381,6 +381,50 @@ void DateTimeSecondFieldElement::setValueAsDateTimeFieldsState(const DateTimeFie // ---------------------------- +DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement(Document* document, FieldOwner& fieldOwner, const Vector<String>& labels) + : DateTimeSymbolicFieldElement(document, fieldOwner, labels) +{ +} + +PassRefPtr<DateTimeSymbolicMonthFieldElement> DateTimeSymbolicMonthFieldElement::create(Document* document, FieldOwner& fieldOwner, const Vector<String>& labels) +{ + DEFINE_STATIC_LOCAL(AtomicString, monthPsuedoId, ("-webkit-datetime-edit-month-field")); + RefPtr<DateTimeSymbolicMonthFieldElement> field = adoptRef(new DateTimeSymbolicMonthFieldElement(document, fieldOwner, labels)); + field->initialize(monthPsuedoId, AXMonthFieldText()); + return field.release(); +} + +void DateTimeSymbolicMonthFieldElement::populateDateTimeFieldsState(DateTimeFieldsState& dateTimeFieldsState) +{ + if (!hasValue()) + dateTimeFieldsState.setMonth(DateTimeFieldsState::emptyValue); + ASSERT(valueAsInteger() < static_cast<int>(symbolsSize())); + dateTimeFieldsState.setMonth(valueAsInteger() + 1); +} + +void DateTimeSymbolicMonthFieldElement::setValueAsDate(const DateComponents& date) +{ + setValueAsInteger(date.month()); +} + +void DateTimeSymbolicMonthFieldElement::setValueAsDateTimeFieldsState(const DateTimeFieldsState& dateTimeFieldsState, const DateComponents& dateForReadOnlyField) +{ + if (!dateTimeFieldsState.hasMonth()) { + setEmptyValue(dateForReadOnlyField); + return; + } + + const unsigned value = dateTimeFieldsState.month() - 1; + if (value >= symbolsSize()) { + setEmptyValue(dateForReadOnlyField); + return; + } + + setValueAsInteger(value); +} + +// ---------------------------- + DateTimeWeekFieldElement::DateTimeWeekFieldElement(Document* document, FieldOwner& fieldOwner) : DateTimeNumericFieldElement(document, fieldOwner, DateComponents::minimumWeekNumber, DateComponents::maximumWeekNumber, "--") { diff --git a/Source/WebCore/html/shadow/DateTimeFieldElements.h b/Source/WebCore/html/shadow/DateTimeFieldElements.h index 46d51a786..c5b124113 100644 --- a/Source/WebCore/html/shadow/DateTimeFieldElements.h +++ b/Source/WebCore/html/shadow/DateTimeFieldElements.h @@ -147,6 +147,21 @@ private: virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL; }; +class DateTimeSymbolicMonthFieldElement : public DateTimeSymbolicFieldElement { + WTF_MAKE_NONCOPYABLE(DateTimeSymbolicMonthFieldElement); + +public: + static PassRefPtr<DateTimeSymbolicMonthFieldElement> create(Document*, FieldOwner&, const Vector<String>&); + +private: + DateTimeSymbolicMonthFieldElement(Document*, FieldOwner&, const Vector<String>&); + + // DateTimeFieldElement functions. + virtual void populateDateTimeFieldsState(DateTimeFieldsState&) OVERRIDE FINAL; + virtual void setValueAsDate(const DateComponents&) OVERRIDE FINAL; + virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&, const DateComponents& dateForReadOnlyField) OVERRIDE FINAL; +}; + class DateTimeWeekFieldElement : public DateTimeNumericFieldElement { WTF_MAKE_NONCOPYABLE(DateTimeWeekFieldElement); diff --git a/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h b/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h index f1eab8eb4..4d926ec02 100644 --- a/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h +++ b/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h @@ -38,6 +38,7 @@ class DateTimeSymbolicFieldElement : public DateTimeFieldElement { protected: DateTimeSymbolicFieldElement(Document*, FieldOwner&, const Vector<String>&); + size_t symbolsSize() const { return m_symbols.size(); } virtual bool hasValue() const OVERRIDE FINAL; virtual void setEmptyValue(const DateComponents& dateForReadOnlyField, EventBehavior = DispatchNoEvent) OVERRIDE FINAL; virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) OVERRIDE FINAL; diff --git a/Source/WebCore/html/shadow/HTMLContentElement.h b/Source/WebCore/html/shadow/HTMLContentElement.h index c0452a006..6be48669d 100644 --- a/Source/WebCore/html/shadow/HTMLContentElement.h +++ b/Source/WebCore/html/shadow/HTMLContentElement.h @@ -56,6 +56,12 @@ private: virtual void parseAttribute(const Attribute&) OVERRIDE; }; +inline bool isHTMLContentElement(const Node* node) +{ + ASSERT(node); + return node->hasTagName(HTMLNames::contentTag); +} + } #endif diff --git a/Source/WebCore/html/shadow/MediaControlElements.cpp b/Source/WebCore/html/shadow/MediaControlElements.cpp index 7cccd690e..ae3b18b0a 100644 --- a/Source/WebCore/html/shadow/MediaControlElements.cpp +++ b/Source/WebCore/html/shadow/MediaControlElements.cpp @@ -156,7 +156,7 @@ void MediaControlPanelElement::startDrag(const LayoutPoint& eventLocation) if (!frame) return; - m_dragStartEventLocation = eventLocation; + m_lastDragEventLocation = eventLocation; frame->eventHandler()->setCapturingMouseEventsNode(this); @@ -168,8 +168,10 @@ void MediaControlPanelElement::continueDrag(const LayoutPoint& eventLocation) if (!m_isBeingDragged) return; - LayoutSize distanceDragged = eventLocation - m_dragStartEventLocation; - setPosition(LayoutPoint(distanceDragged.width(), distanceDragged.height())); + LayoutSize distanceDragged = eventLocation - m_lastDragEventLocation; + m_cumulativeDragOffset.move(distanceDragged); + m_lastDragEventLocation = eventLocation; + setPosition(m_cumulativeDragOffset); } void MediaControlPanelElement::endDrag() @@ -237,6 +239,9 @@ void MediaControlPanelElement::resetPosition() ExceptionCode ignored; classList()->remove("dragged", ignored); + + m_cumulativeDragOffset.setX(0); + m_cumulativeDragOffset.setY(0); } void MediaControlPanelElement::makeOpaque() diff --git a/Source/WebCore/html/shadow/MediaControlElements.h b/Source/WebCore/html/shadow/MediaControlElements.h index effdcee7f..66cb2da6b 100644 --- a/Source/WebCore/html/shadow/MediaControlElements.h +++ b/Source/WebCore/html/shadow/MediaControlElements.h @@ -139,7 +139,8 @@ private: bool m_isBeingDragged; bool m_isDisplayed; bool m_opaque; - LayoutPoint m_dragStartEventLocation; + LayoutPoint m_lastDragEventLocation; + LayoutPoint m_cumulativeDragOffset; Timer<MediaControlPanelElement> m_transitionTimer; }; diff --git a/Source/WebCore/inspector/InspectorClient.h b/Source/WebCore/inspector/InspectorClient.h index 2d4fb3f26..2a4745a81 100644 --- a/Source/WebCore/inspector/InspectorClient.h +++ b/Source/WebCore/inspector/InspectorClient.h @@ -29,6 +29,7 @@ #include "InspectorStateClient.h" #include <wtf/Forward.h> +#include <wtf/HashMap.h> #include <wtf/HashSet.h> namespace WebCore { @@ -73,6 +74,7 @@ public: virtual bool supportsFrameInstrumentation() { return false; } virtual void getAllocatedObjects(HashSet<const void*>&) { } + virtual void dumpUncountedAllocatedObjects(const HashMap<const void*, size_t>&) { } static bool doDispatchMessageOnFrontendPage(Page* frontendPage, const String& message); }; diff --git a/Source/WebCore/inspector/InspectorFrontendClient.h b/Source/WebCore/inspector/InspectorFrontendClient.h index c461fd99c..f7fd85c81 100644 --- a/Source/WebCore/inspector/InspectorFrontendClient.h +++ b/Source/WebCore/inspector/InspectorFrontendClient.h @@ -41,6 +41,12 @@ class Event; class InspectorFrontendClient { public: + enum DockSide { + UNDOCKED = 0, + DOCKED_TO_RIGHT, + DOCKED_TO_BOTTOM + }; + virtual ~InspectorFrontendClient() { } virtual void windowObjectCleared() = 0; @@ -54,9 +60,7 @@ public: virtual void bringToFront() = 0; virtual void closeWindow() = 0; - virtual void requestAttachWindow() = 0; - virtual void requestDetachWindow() = 0; - virtual void requestSetDockSide(const String&) = 0; + virtual void requestSetDockSide(DockSide) = 0; virtual void changeAttachedWindowHeight(unsigned) = 0; virtual void openInNewTab(const String& url) = 0; virtual bool canSave() = 0; diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp index 530827353..dbee707c5 100644 --- a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp +++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp @@ -148,18 +148,15 @@ void InspectorFrontendClientLocal::frontendLoaded() m_evaluateOnLoad.clear(); } -void InspectorFrontendClientLocal::requestAttachWindow() +void InspectorFrontendClientLocal::requestSetDockSide(DockSide dockSide) { - if (!canAttachWindow()) - return; - attachWindow(); - setAttachedWindow(true); -} - -void InspectorFrontendClientLocal::requestDetachWindow() -{ - detachWindow(); - setAttachedWindow(false); + if (dockSide == UNDOCKED) { + detachWindow(); + setAttachedWindow(false); + } else if (canAttachWindow()) { + attachWindow(); + setAttachedWindow(true); + } } bool InspectorFrontendClientLocal::canAttachWindow() @@ -214,7 +211,7 @@ void InspectorFrontendClientLocal::moveWindowBy(float x, float y) void InspectorFrontendClientLocal::setAttachedWindow(bool attached) { - evaluateOnLoad(String::format("[\"setAttachedWindow\", %s]", attached ? "true" : "false")); + evaluateOnLoad(String::format("[\"setDockSide\", %s]", attached ? "bottom" : "undocked")); } void InspectorFrontendClientLocal::restoreAttachedWindowHeight() diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.h b/Source/WebCore/inspector/InspectorFrontendClientLocal.h index af8493b99..ce36287b1 100644 --- a/Source/WebCore/inspector/InspectorFrontendClientLocal.h +++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.h @@ -63,9 +63,7 @@ public: virtual void moveWindowBy(float x, float y); - virtual void requestAttachWindow(); - virtual void requestDetachWindow(); - virtual void requestSetDockSide(const String&) { } + virtual void requestSetDockSide(DockSide); virtual void changeAttachedWindowHeight(unsigned); virtual void openInNewTab(const String& url); virtual bool canSave() { return false; } diff --git a/Source/WebCore/inspector/InspectorFrontendHost.cpp b/Source/WebCore/inspector/InspectorFrontendHost.cpp index e7b02200e..82db0bbfe 100644 --- a/Source/WebCore/inspector/InspectorFrontendHost.cpp +++ b/Source/WebCore/inspector/InspectorFrontendHost.cpp @@ -149,22 +149,16 @@ void InspectorFrontendHost::loaded() m_client->frontendLoaded(); } -void InspectorFrontendHost::requestAttachWindow() -{ - if (m_client) - m_client->requestAttachWindow(); -} - -void InspectorFrontendHost::requestDetachWindow() -{ - if (m_client) - m_client->requestDetachWindow(); -} - void InspectorFrontendHost::requestSetDockSide(const String& side) { - if (m_client) - m_client->requestSetDockSide(side); + if (!m_client) + return; + if (side == "undocked") + m_client->requestSetDockSide(InspectorFrontendClient::UNDOCKED); + else if (side == "right") + m_client->requestSetDockSide(InspectorFrontendClient::DOCKED_TO_RIGHT); + else if (side == "bottom") + m_client->requestSetDockSide(InspectorFrontendClient::DOCKED_TO_BOTTOM); } void InspectorFrontendHost::closeWindow() @@ -250,6 +244,10 @@ void InspectorFrontendHost::append(const String& url, const String& content) m_client->append(url, content); } +void InspectorFrontendHost::close(const String&) +{ +} + bool InspectorFrontendHost::canInspectWorkers() { #if ENABLE(WORKERS) diff --git a/Source/WebCore/inspector/InspectorFrontendHost.h b/Source/WebCore/inspector/InspectorFrontendHost.h index d5ae51d80..ea6d10198 100644 --- a/Source/WebCore/inspector/InspectorFrontendHost.h +++ b/Source/WebCore/inspector/InspectorFrontendHost.h @@ -57,8 +57,6 @@ public: void disconnectClient(); void loaded(); - void requestAttachWindow(); - void requestDetachWindow(); void requestSetDockSide(const String&); void closeWindow(); void bringToFront(); @@ -77,6 +75,7 @@ public: bool canSave(); void save(const String& url, const String& content, bool forceSaveAs); void append(const String& url, const String& content); + void close(const String& url); bool canInspectWorkers(); diff --git a/Source/WebCore/inspector/InspectorFrontendHost.idl b/Source/WebCore/inspector/InspectorFrontendHost.idl index 8ddc9a6fd..728aa0c0e 100644 --- a/Source/WebCore/inspector/InspectorFrontendHost.idl +++ b/Source/WebCore/inspector/InspectorFrontendHost.idl @@ -39,8 +39,6 @@ void setZoomFactor(in float zoom); void inspectedURLChanged(in DOMString newURL); - void requestAttachWindow(); - void requestDetachWindow(); void requestSetDockSide(in DOMString side); void setAttachedWindowHeight(in unsigned long height); void moveWindowBy(in float x, in float y); @@ -54,6 +52,7 @@ boolean canSave(); void save(in DOMString url, in DOMString content, in boolean forceSaveAs); void append(in DOMString url, in DOMString content); + void close(in DOMString url); boolean canInspectWorkers(); diff --git a/Source/WebCore/inspector/InspectorMemoryAgent.cpp b/Source/WebCore/inspector/InspectorMemoryAgent.cpp index badcb795b..fdc72afeb 100644 --- a/Source/WebCore/inspector/InspectorMemoryAgent.cpp +++ b/Source/WebCore/inspector/InspectorMemoryAgent.cpp @@ -436,16 +436,16 @@ static void reportJSHeapInfo(WTF::MemoryInstrumentationClient& memoryInstrumenta HeapInfo info; ScriptGCEvent::getHeapSize(info); - memoryInstrumentationClient.countObjectSize(WebCoreMemoryTypes::JSHeapUsed, info.usedJSHeapSize); - memoryInstrumentationClient.countObjectSize(WebCoreMemoryTypes::JSHeapUnused, info.totalJSHeapSize - info.usedJSHeapSize); + memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::JSHeapUsed, info.usedJSHeapSize); + memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::JSHeapUnused, info.totalJSHeapSize - info.usedJSHeapSize); } static void reportRenderTreeInfo(WTF::MemoryInstrumentationClient& memoryInstrumentationClient, Page* page) { ArenaSize arenaSize = page->renderTreeSize(); - memoryInstrumentationClient.countObjectSize(WebCoreMemoryTypes::RenderTreeUsed, arenaSize.treeSize); - memoryInstrumentationClient.countObjectSize(WebCoreMemoryTypes::RenderTreeUnused, arenaSize.allocated - arenaSize.treeSize); + memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::RenderTreeUsed, arenaSize.treeSize); + memoryInstrumentationClient.countObjectSize(0, WebCoreMemoryTypes::RenderTreeUnused, arenaSize.allocated - arenaSize.treeSize); } namespace { @@ -541,6 +541,8 @@ void InspectorMemoryAgent::getProcessMemoryDistribution(ErrorString*, RefPtr<Ins memoryInstrumentation.addRootObject(memoryInstrumentation); memoryInstrumentation.addRootObject(memoryInstrumentationClient); + m_inspectorClient->dumpUncountedAllocatedObjects(memoryInstrumentationClient.countedObjects()); + MemoryUsageStatsGenerator statsGenerator(&memoryInstrumentationClient); statsGenerator.dump(children.get()); diff --git a/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp b/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp index e93d66f4f..20d16cb1e 100644 --- a/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp +++ b/Source/WebCore/inspector/MemoryInstrumentationImpl.cpp @@ -58,13 +58,22 @@ TypeNameToSizeMap MemoryInstrumentationClientImpl::sizesMap() const return sizesMap; } -void MemoryInstrumentationClientImpl::countObjectSize(MemoryObjectType objectType, size_t size) +void MemoryInstrumentationClientImpl::countObjectSize(const void* object, MemoryObjectType objectType, size_t size) { ASSERT(objectType); + TypeToSizeMap::AddResult result = m_totalSizes.add(objectType, size); if (!result.isNewEntry) result.iterator->value += size; ++m_totalCountedObjects; + + if (!checkInstrumentedObjects()) + return; + + if (object) { + m_countedObjects.add(object, size); + checkCountedObject(object); + } } bool MemoryInstrumentationClientImpl::visited(const void* object) @@ -91,6 +100,7 @@ void MemoryInstrumentationClientImpl::reportMemoryUsage(MemoryObjectInfo* memory info.addMember(m_totalSizes); info.addMember(m_visitedObjects); info.addMember(m_allocatedObjects); + info.addMember(m_countedObjects); } void MemoryInstrumentationImpl::processDeferredInstrumentedPointers() diff --git a/Source/WebCore/inspector/MemoryInstrumentationImpl.h b/Source/WebCore/inspector/MemoryInstrumentationImpl.h index 8af8d60c5..508f2efe9 100644 --- a/Source/WebCore/inspector/MemoryInstrumentationImpl.h +++ b/Source/WebCore/inspector/MemoryInstrumentationImpl.h @@ -48,6 +48,8 @@ typedef HashMap<String, size_t> TypeNameToSizeMap; class MemoryInstrumentationClientImpl : public WTF::MemoryInstrumentationClient { public: + typedef HashMap<const void*, size_t> ObjectToSizeMap; + MemoryInstrumentationClientImpl() : m_totalCountedObjects(0) , m_totalObjectsNotInAllocatedSet(0) @@ -69,13 +71,14 @@ public: TypeNameToSizeMap sizesMap() const; VisitedObjects& allocatedObjects() { return m_allocatedObjects; } + const ObjectToSizeMap& countedObjects() { return m_countedObjects; } bool checkInstrumentedObjects() const { return !m_allocatedObjects.isEmpty(); } size_t visitedObjects() const { return m_visitedObjects.size(); } size_t totalCountedObjects() const { return m_totalCountedObjects; } size_t totalObjectsNotInAllocatedSet() const { return m_totalObjectsNotInAllocatedSet; } - virtual void countObjectSize(MemoryObjectType, size_t) OVERRIDE; + virtual void countObjectSize(const void*, MemoryObjectType, size_t) OVERRIDE; virtual bool visited(const void*) OVERRIDE; virtual void checkCountedObject(const void*) OVERRIDE; @@ -86,6 +89,7 @@ private: TypeToSizeMap m_totalSizes; VisitedObjects m_visitedObjects; VisitedObjects m_allocatedObjects; + ObjectToSizeMap m_countedObjects; size_t m_totalCountedObjects; size_t m_totalObjectsNotInAllocatedSet; }; diff --git a/Source/WebCore/inspector/front-end/CSSCompletions.js b/Source/WebCore/inspector/front-end/CSSCompletions.js index 8c606bed3..941e939df 100644 --- a/Source/WebCore/inspector/front-end/CSSCompletions.js +++ b/Source/WebCore/inspector/front-end/CSSCompletions.js @@ -34,7 +34,7 @@ * @constructor * @param {Array.<CSSAgent.CSSPropertyInfo|string>} properties */ -WebInspector.CSSCompletions = function(properties, acceptEmptyPrefix) +WebInspector.CSSCompletions = function(properties) { this._values = []; this._longhands = {}; @@ -64,7 +64,6 @@ WebInspector.CSSCompletions = function(properties, acceptEmptyPrefix) } } this._values.sort(); - this._acceptEmptyPrefix = acceptEmptyPrefix; } @@ -78,7 +77,7 @@ WebInspector.CSSCompletions.requestCSSNameCompletions = function() function propertyNamesCallback(error, properties) { if (!error) - WebInspector.CSSCompletions.cssPropertiesMetainfo = new WebInspector.CSSCompletions(properties, false); + WebInspector.CSSCompletions.cssPropertiesMetainfo = new WebInspector.CSSCompletions(properties); } CSSAgent.getSupportedCSSProperties(propertyNamesCallback); } @@ -246,7 +245,7 @@ WebInspector.CSSCompletions.prototype = { if (!this._values.length) return -1; if (!prefix) - return this._acceptEmptyPrefix ? 0 : -1; + return 0; var maxIndex = this._values.length - 1; var minIndex = 0; diff --git a/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js b/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js index 9e64dc698..ca04d985f 100644 --- a/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js +++ b/Source/WebCore/inspector/front-end/CSSKeywordCompletions.js @@ -39,7 +39,7 @@ WebInspector.CSSKeywordCompletions.forProperty = function(propertyName) acceptedKeywords = acceptedKeywords.concat(WebInspector.CSSKeywordCompletions._colors); if (propertyName in WebInspector.CSSKeywordCompletions.InheritedProperties) acceptedKeywords.push("inherit"); - return new WebInspector.CSSCompletions(acceptedKeywords, true); + return new WebInspector.CSSCompletions(acceptedKeywords); } WebInspector.CSSKeywordCompletions.isColorAwareProperty = function(propertyName) diff --git a/Source/WebCore/inspector/front-end/DockController.js b/Source/WebCore/inspector/front-end/DockController.js index 56694686f..5c48cabfe 100644 --- a/Source/WebCore/inspector/front-end/DockController.js +++ b/Source/WebCore/inspector/front-end/DockController.js @@ -40,8 +40,7 @@ WebInspector.DockController = function() if (Preferences.showDockToRight) this._dockToggleButton.makeLongClickEnabled(this._createDockOptions.bind(this)); - this._dockSide = WebInspector.queryParamsObject["dockSide"]; - this._innerSetDocked(WebInspector.queryParamsObject["docked"] === "true"); + this.setDockSide(WebInspector.queryParamsObject["dockSide"]); } WebInspector.DockController.State = { @@ -60,33 +59,18 @@ WebInspector.DockController.prototype = { }, /** - * @param {boolean} docked + * @param {string} dockSide */ - setDocked: function(docked) + setDockSide: function(dockSide) { - var isDocked = this._state !== WebInspector.DockController.State.Undocked; - if (docked !== isDocked) - this._innerSetDocked(docked); - }, - - /** - * @param {boolean} docked - */ - _innerSetDocked: function(docked) - { - if (this._state) - WebInspector.settings.lastDockState.set(this._state); + if (this._dockSide) + WebInspector.settings.lastDockState.set(this._dockSide); - if (!docked) { - this._state = WebInspector.DockController.State.Undocked; + this._dockSide = dockSide; + if (dockSide === WebInspector.DockController.State.Undocked) WebInspector.userMetrics.WindowDocked.record(); - } else if (this._dockSide === "right") { - this._state = WebInspector.DockController.State.DockedToRight; - WebInspector.userMetrics.WindowUndocked.record(); - } else { - this._state = WebInspector.DockController.State.DockedToBottom; + else WebInspector.userMetrics.WindowUndocked.record(); - } this._updateUI(); }, @@ -102,7 +86,7 @@ WebInspector.DockController.prototype = { _updateUI: function() { var body = document.body; - switch (this._state) { + switch (this._dockSide) { case WebInspector.DockController.State.DockedToBottom: body.removeStyleClass("undocked"); body.removeStyleClass("dock-to-right"); @@ -129,17 +113,17 @@ WebInspector.DockController.prototype = { this._dockToggleButton.disabled = false; // Choose different last state based on the current one if missing or if is the same. - var states = [WebInspector.DockController.State.DockedToBottom, WebInspector.DockController.State.Undocked, WebInspector.DockController.State.DockedToRight]; - states.remove(this._state); + var sides = [WebInspector.DockController.State.DockedToBottom, WebInspector.DockController.State.Undocked, WebInspector.DockController.State.DockedToRight]; + sides.remove(this._dockSide); var lastState = WebInspector.settings.lastDockState.get(); - states.remove(lastState); - if (states.length === 2) { // last state was not from the list of potential values - lastState = states[0]; - states.remove(lastState); + sides.remove(lastState); + if (sides.length === 2) { // last state was not from the list of potential values + lastState = sides[0]; + sides.remove(lastState); } this._decorateButtonForTargetState(this._dockToggleButton, lastState); - this._decorateButtonForTargetState(this._dockToggleButtonOption, states[0]); + this._decorateButtonForTargetState(this._dockToggleButtonOption, sides[0]); }, /** @@ -174,22 +158,13 @@ WebInspector.DockController.prototype = { */ _toggleDockState: function(e) { - var state = e.target.state; - switch (state) { - case "undock": - InspectorFrontendHost.requestDetachWindow(); - WebInspector.userMetrics.WindowUndocked.record(); - break; - case "right": - case "bottom": - this._dockSide = state; - InspectorFrontendHost.requestSetDockSide(this._dockSide); - if (this._state === WebInspector.DockController.State.Undocked) - InspectorFrontendHost.requestAttachWindow(); - else - this._innerSetDocked(true); - break; + var action; + switch (e.target.state) { + case "bottom": action = "bottom"; break; + case "right": action = "right"; break; + case "undock": action = "undocked"; break; } + InspectorFrontendHost.requestSetDockSide(action); }, /** diff --git a/Source/WebCore/inspector/front-end/FileManager.js b/Source/WebCore/inspector/front-end/FileManager.js index 6b108d3f0..bb88734e6 100644 --- a/Source/WebCore/inspector/front-end/FileManager.js +++ b/Source/WebCore/inspector/front-end/FileManager.js @@ -51,14 +51,6 @@ WebInspector.FileManager.prototype = { }, /** - * @return {boolean} - */ - canAppend: function() - { - return InspectorFrontendHost.canSave() && ("append" in InspectorFrontendHost); - }, - - /** * @param {string} url * @param {string} content * @param {boolean} forceSaveAs @@ -105,6 +97,14 @@ WebInspector.FileManager.prototype = { /** * @param {string} url */ + close: function(url) + { + InspectorFrontendHost.close(url); + }, + + /** + * @param {string} url + */ appendedToURL: function(url) { this.dispatchEventToListeners(WebInspector.FileManager.EventTypes.AppendedToURL, url); diff --git a/Source/WebCore/inspector/front-end/FileUtils.js b/Source/WebCore/inspector/front-end/FileUtils.js index 7e95bdfc8..d6a1dec6c 100644 --- a/Source/WebCore/inspector/front-end/FileUtils.js +++ b/Source/WebCore/inspector/front-end/FileUtils.js @@ -385,6 +385,7 @@ WebInspector.FileOutputStream.prototype = { if (this._writeCallbacks.length) return; WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._onAppendDone, this); + WebInspector.fileManager.close(this._fileName); }, /** @@ -395,8 +396,10 @@ WebInspector.FileOutputStream.prototype = { if (event.data !== this._fileName) return; if (!this._writeCallbacks.length) { - if (this._closed) + if (this._closed) { WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._onAppendDone, this); + WebInspector.fileManager.close(this._fileName); + } return; } var callback = this._writeCallbacks.shift(); diff --git a/Source/WebCore/inspector/front-end/HandlerRegistry.js b/Source/WebCore/inspector/front-end/HandlerRegistry.js index 379eb435e..99d1bbfa7 100644 --- a/Source/WebCore/inspector/front-end/HandlerRegistry.js +++ b/Source/WebCore/inspector/front-end/HandlerRegistry.js @@ -132,7 +132,9 @@ WebInspector.HandlerRegistry.prototype = { function doSave(forceSaveAs, content) { - WebInspector.fileManager.save(contentProvider.contentURL(), content, forceSaveAs); + var url = contentProvider.contentURL(); + WebInspector.fileManager.save(url, content, forceSaveAs); + WebInspector.fileManager.close(url); } function save(forceSaveAs) diff --git a/Source/WebCore/inspector/front-end/HeapSnapshotView.js b/Source/WebCore/inspector/front-end/HeapSnapshotView.js index a094b458a..ccd3630a6 100644 --- a/Source/WebCore/inspector/front-end/HeapSnapshotView.js +++ b/Source/WebCore/inspector/front-end/HeapSnapshotView.js @@ -953,7 +953,7 @@ WebInspector.HeapProfileHeader.prototype = { */ canSaveToFile: function() { - return !this.fromFile() && this._snapshotProxy && !this._receiver && WebInspector.fileManager.canAppend(); + return !this.fromFile() && !!this._snapshotProxy && !this._receiver; }, /** diff --git a/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js b/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js index 70b7cfdd7..f1bb82bea 100644 --- a/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js +++ b/Source/WebCore/inspector/front-end/InspectorFrontendAPI.js @@ -74,10 +74,15 @@ var InspectorFrontendAPI = { WebInspector.CPUProfileType.instance.stopRecordingProfile(); }, - setAttachedWindow: function(attached) + setAttachedWindow: function(side) + { + + }, + + setDockSide: function(side) { if (WebInspector.dockController) - WebInspector.dockController.setDocked(attached); + WebInspector.dockController.setDockSide(side); }, showConsole: function() diff --git a/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js index ce3a30aae..e92348a88 100644 --- a/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js +++ b/Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js @@ -38,6 +38,7 @@ WebInspector.InspectorFrontendHostStub = function() { this._attachedWindowHeight = 0; this.isStub = true; + this._fileBuffers = {}; WebInspector.documentCopyEventFired = this.documentCopy.bind(this); } @@ -68,18 +69,9 @@ WebInspector.InspectorFrontendHostStub.prototype = { this._windowVisible = false; }, - requestAttachWindow: function() - { - InspectorFrontendAPI.setAttachedWindow(true); - }, - - requestDetachWindow: function() - { - InspectorFrontendAPI.setAttachedWindow(false); - }, - - requestSetDockSide: function() + requestSetDockSide: function(side) { + InspectorFrontendAPI.setDockSide(side); }, setAttachedWindowHeight: function(height) @@ -143,23 +135,43 @@ WebInspector.InspectorFrontendHostStub.prototype = { save: function(url, content, forceSaveAs) { - var blob = new Blob([content], { type: "application/octet-stream" }); + if (this._fileBuffers[url]) + throw new Error("Concurrent file modification denied."); - var fr = new FileReader(); - fr.onload = function(e) { - // Force download - window.location = this.result; - } - fr.readAsDataURL(blob); + this._fileBuffers[url] = [content]; + setTimeout(WebInspector.fileManager.savedURL.bind(WebInspector.fileManager, url), 0); }, - canAppend: function() + append: function(url, content) { - return false; + var buffer = this._fileBuffers[url]; + if (!buffer) + throw new Error("File is not open for write yet."); + + buffer.push(content); + setTimeout(WebInspector.fileManager.appendedToURL.bind(WebInspector.fileManager, url), 0); }, - append: function(url, content) + close: function(url) { + var content = this._fileBuffers[url]; + delete this._fileBuffers[url]; + + if (!content) + return; + + var lastSlashIndex = url.lastIndexOf("/"); + var fileNameSuffix = (lastSlashIndex === -1) ? url : url.substring(lastSlashIndex + 1); + + var blob = new Blob(content, { type: "application/octet-stream" }); + var objectUrl = window.URL.createObjectURL(blob); + window.location = objectUrl + "#" + fileNameSuffix; + + function cleanup() + { + window.URL.revokeObjectURL(objectUrl); + } + setTimeout(cleanup, 0); }, sendMessageToBackend: function(message) diff --git a/Source/WebCore/inspector/front-end/ResourceScriptMapping.js b/Source/WebCore/inspector/front-end/ResourceScriptMapping.js index 0e627e69f..db3c2a72f 100644 --- a/Source/WebCore/inspector/front-end/ResourceScriptMapping.js +++ b/Source/WebCore/inspector/front-end/ResourceScriptMapping.js @@ -209,7 +209,6 @@ WebInspector.ResourceScriptMapping.prototype = { var isDynamicScript = this._isDynamicScript(script); var url = isDynamicScript ? "" : script.sourceURL; temporaryUISourceCode = new WebInspector.UISourceCode(url, contentProvider, false); - temporaryUISourceCode.isTemporary = true; for (var i = 0; i < scripts.length; ++i) this._temporaryUISourceCodeForScriptId[scripts[i].scriptId] = temporaryUISourceCode; this._bindUISourceCodeToScripts(temporaryUISourceCode, scripts); diff --git a/Source/WebCore/inspector/front-end/SASSSourceMapping.js b/Source/WebCore/inspector/front-end/SASSSourceMapping.js index 9c7cab4e7..a114df901 100644 --- a/Source/WebCore/inspector/front-end/SASSSourceMapping.js +++ b/Source/WebCore/inspector/front-end/SASSSourceMapping.js @@ -77,13 +77,13 @@ WebInspector.SASSSourceMapping.prototype = { if (!content) return; var lines = content.split(/\r?\n/); - var debugInfoRegex = /@media\s\-sass\-debug\-info{filename{font-family:([^}]+)}line{font-family:\\[0]+([^}]*)}}/i; + var debugInfoRegex = /@media\s\-sass\-debug\-info{filename{font-family:([^}]+)}line{font-family:\\0000(\d\d)([^}]*)}}/i; var lineNumbersRegex = /\/\*\s+line\s+([0-9]+),\s+([^*\/]+)/; for (var lineNumber = 0; lineNumber < lines.length; ++lineNumber) { var match = debugInfoRegex.exec(lines[lineNumber]); if (match) { var url = match[1].replace(/\\(.)/g, "$1"); - var line = parseInt(decodeURI(match[2].replace(/(..)/g, "%$1")), 10); + var line = parseInt(decodeURI("%" + match[2]) + match[3], 10); this._bindUISourceCode(url, line, resource.url, lineNumber); continue; } diff --git a/Source/WebCore/inspector/front-end/ScriptSnippetModel.js b/Source/WebCore/inspector/front-end/ScriptSnippetModel.js index 10e9a7bc0..a6707c693 100644 --- a/Source/WebCore/inspector/front-end/ScriptSnippetModel.js +++ b/Source/WebCore/inspector/front-end/ScriptSnippetModel.js @@ -289,7 +289,7 @@ WebInspector.ScriptSnippetModel.prototype = { var result = []; for (var scriptId in this._uiSourceCodeForScriptId) { var uiSourceCode = this._uiSourceCodeForScriptId[scriptId]; - if (!uiSourceCode.isSnippet) + if (uiSourceCode.isTemporary) result.push(uiSourceCode); } return result; @@ -322,10 +322,9 @@ WebInspector.ScriptSnippetModel.prototype = { _createUISourceCodeForScript: function(script) { var uiSourceCode = new WebInspector.UISourceCode(script.sourceURL, script, false); + uiSourceCode.isSnippet = true; + this._workspace.project().addTemporaryUISourceCode(uiSourceCode); uiSourceCode.setSourceMapping(this._snippetScriptMapping); - // FIXME: Should be added to workspace as temporary. - uiSourceCode.isTemporary = true; - uiSourceCode.isSnippetEvaluation = true; this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode; this._scriptForUISourceCode.put(uiSourceCode, script); script.setSourceMapping(this._snippetScriptMapping); diff --git a/Source/WebCore/inspector/front-end/ScriptsNavigator.js b/Source/WebCore/inspector/front-end/ScriptsNavigator.js index 662f90217..8477230dd 100644 --- a/Source/WebCore/inspector/front-end/ScriptsNavigator.js +++ b/Source/WebCore/inspector/front-end/ScriptsNavigator.js @@ -84,7 +84,7 @@ WebInspector.ScriptsNavigator.prototype = { { if (uiSourceCode.isContentScript) return this._contentScriptsView; - else if (uiSourceCode.isSnippet || uiSourceCode.isSnippetEvaluation) + else if (uiSourceCode.isSnippet) return this._snippetsView; else return this._scriptsView; @@ -123,7 +123,7 @@ WebInspector.ScriptsNavigator.prototype = { this._snippetsNavigatorViewForUISourceCode(uiSourceCode).revealUISourceCode(uiSourceCode); if (uiSourceCode.isContentScript) this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ContentScriptsTab); - else if (uiSourceCode.isSnippet || uiSourceCode.isSnippetEvaluation) + else if (uiSourceCode.isSnippet) this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.SnippetsTab); else this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ScriptsTab); diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js index 1e944181d..a27a45bb1 100644 --- a/Source/WebCore/inspector/front-end/ScriptsPanel.js +++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js @@ -442,7 +442,7 @@ WebInspector.ScriptsPanel.prototype = { var sourceFrame; switch (uiSourceCode.contentType()) { case WebInspector.resourceTypes.Script: - if (uiSourceCode.isSnippet) + if (uiSourceCode.isSnippet && !uiSourceCode.isTemporary) sourceFrame = new WebInspector.SnippetJavaScriptSourceFrame(this, uiSourceCode); else sourceFrame = new WebInspector.JavaScriptSourceFrame(this, uiSourceCode); diff --git a/Source/WebCore/inspector/front-end/SettingsScreen.js b/Source/WebCore/inspector/front-end/SettingsScreen.js index f57e3e802..fe5aab03c 100644 --- a/Source/WebCore/inspector/front-end/SettingsScreen.js +++ b/Source/WebCore/inspector/front-end/SettingsScreen.js @@ -365,7 +365,7 @@ WebInspector.UserAgentSettingsTab.prototype = { var checkboxElement = labelElement.createChild("input"); checkboxElement.type = "checkbox"; checkboxElement.checked = !!userAgent; - labelElement.appendChild(document.createTextNode("User Agent")); + labelElement.appendChild(document.createTextNode(WebInspector.UIString("User Agent"))); p.appendChild(this._createUserAgentSelectRowElement(checkboxElement)); return p; }, diff --git a/Source/WebCore/inspector/front-end/StylesSidebarPane.js b/Source/WebCore/inspector/front-end/StylesSidebarPane.js index af07068fb..f6d356e97 100644 --- a/Source/WebCore/inspector/front-end/StylesSidebarPane.js +++ b/Source/WebCore/inspector/front-end/StylesSidebarPane.js @@ -400,7 +400,7 @@ WebInspector.StylesSidebarPane.prototype = { continue; if (section.computedStyle) section.styleRule.style = nodeComputedStyle; - var styleRule = { section: section, style: section.styleRule.style, computedStyle: section.computedStyle, rule: section.rule, editable: !!(section.styleRule.style && section.styleRule.style.id), isAttribute: section.styleRule.isAttribute }; + var styleRule = { section: section, style: section.styleRule.style, computedStyle: section.computedStyle, rule: section.rule, editable: !!(section.styleRule.style && section.styleRule.style.id), isAttribute: section.styleRule.isAttribute, isInherited: section.styleRule.isInherited }; styleRules.push(styleRule); } return styleRules; @@ -511,7 +511,11 @@ WebInspector.StylesSidebarPane.prototype = { var property = allProperties[j]; if (!property.isLive || !property.parsedOk) continue; + var canonicalName = WebInspector.StylesSidebarPane.canonicalPropertyName(property.name); + // Do not pick non-inherited properties from inherited styles. + if (styleRule.isInherited && !WebInspector.CSSKeywordCompletions.InheritedProperties[canonicalName]) + continue; if (foundImportantProperties.hasOwnProperty(canonicalName)) continue; diff --git a/Source/WebCore/inspector/front-end/StylesSourceMapping.js b/Source/WebCore/inspector/front-end/StylesSourceMapping.js index 8b7d052a1..4de7509dc 100644 --- a/Source/WebCore/inspector/front-end/StylesSourceMapping.js +++ b/Source/WebCore/inspector/front-end/StylesSourceMapping.js @@ -136,17 +136,17 @@ WebInspector.StyleFile.prototype = { */ _commitIncrementalEdit: function(majorChange) { - /** - * @param {?string} error - */ - function callback(error) - { - if (error) - WebInspector.showErrorMessage(error); - } - this._clearIncrementalUpdateTimer(); - WebInspector.styleContentBinding.setStyleContent(this._uiSourceCode, this._uiSourceCode.workingCopy(), majorChange, callback); + WebInspector.styleContentBinding.setStyleContent(this._uiSourceCode, this._uiSourceCode.workingCopy(), majorChange, this._styleContentSet.bind(this)); + }, + + /** + * @param {?string} error + */ + _styleContentSet: function(error) + { + if (error) + WebInspector.showErrorMessage(error); }, _clearIncrementalUpdateTimer: function() diff --git a/Source/WebCore/inspector/front-end/UISourceCode.js b/Source/WebCore/inspector/front-end/UISourceCode.js index 9bfd340d1..8613dff82 100644 --- a/Source/WebCore/inspector/front-end/UISourceCode.js +++ b/Source/WebCore/inspector/front-end/UISourceCode.js @@ -192,8 +192,10 @@ WebInspector.UISourceCode.prototype = { delete this._workingCopy; this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyCommitted, {oldWorkingCopy: oldWorkingCopy, workingCopy: this.workingCopy()}); WebInspector.workspace.dispatchEventToListeners(WebInspector.Workspace.Events.UISourceCodeContentCommitted, { uiSourceCode: this, content: this._content }); - if (this._url && WebInspector.fileManager.isURLSaved(this._url)) + if (this._url && WebInspector.fileManager.isURLSaved(this._url)) { WebInspector.fileManager.save(this._url, this._content, false); + WebInspector.fileManager.close(this._url); + } }, /** diff --git a/Source/WebCore/inspector/front-end/Workspace.js b/Source/WebCore/inspector/front-end/Workspace.js index 6fcca5a1a..c5515e82b 100644 --- a/Source/WebCore/inspector/front-end/Workspace.js +++ b/Source/WebCore/inspector/front-end/Workspace.js @@ -89,6 +89,7 @@ WebInspector.Project.prototype = { */ addTemporaryUISourceCode: function(uiSourceCode) { + uiSourceCode.isTemporary = true; this._workspace.dispatchEventToListeners(WebInspector.UISourceCodeProvider.Events.TemporaryUISourceCodeAdded, uiSourceCode); }, diff --git a/Source/WebCore/inspector/front-end/externs.js b/Source/WebCore/inspector/front-end/externs.js index ba5bbc9fe..a06ce9e26 100644 --- a/Source/WebCore/inspector/front-end/externs.js +++ b/Source/WebCore/inspector/front-end/externs.js @@ -123,8 +123,6 @@ 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(dockSide) {} InspectorFrontendHostAPI.prototype.setAttachedWindowHeight = function(height) {} InspectorFrontendHostAPI.prototype.moveWindowBy = function(x, y) {} @@ -138,7 +136,7 @@ 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.close = function(url) {} InspectorFrontendHostAPI.prototype.append = function(url, content) {} InspectorFrontendHostAPI.prototype.sendMessageToBackend = function(message) {} InspectorFrontendHostAPI.prototype.recordActionTaken = function(actionCode) {} diff --git a/Source/WebCore/inspector/front-end/inspector.html b/Source/WebCore/inspector/front-end/inspector.html index d1961b9e3..eda8ddf0c 100644 --- a/Source/WebCore/inspector/front-end/inspector.html +++ b/Source/WebCore/inspector/front-end/inspector.html @@ -29,6 +29,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <meta http-equiv="X-WebKit-CSP" content="object-src 'none'; script-src 'self' 'unsafe-eval'"> <link rel="stylesheet" type="text/css" href="dialog.css"> <link rel="stylesheet" type="text/css" href="inspector.css"> <link rel="stylesheet" type="text/css" href="inspectorCommon.css"> diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp index a84c508eb..9c3966cab 100644 --- a/Source/WebCore/loader/FrameLoader.cpp +++ b/Source/WebCore/loader/FrameLoader.cpp @@ -70,6 +70,7 @@ #include "HTMLFormElement.h" #include "HTMLNames.h" #include "HTMLObjectElement.h" +#include "HTMLParserIdioms.h" #include "HTTPParsers.h" #include "HistoryItem.h" #include "InspectorController.h" @@ -666,6 +667,15 @@ void FrameLoader::didBeginDocument(bool dispatch) String reportOnlyContentSecurityPolicy = m_documentLoader->response().httpHeaderField("X-WebKit-CSP-Report-Only"); if (!reportOnlyContentSecurityPolicy.isEmpty()) m_frame->document()->contentSecurityPolicy()->didReceiveHeader(reportOnlyContentSecurityPolicy, ContentSecurityPolicy::ReportOnly); + + String headerContentLanguage = m_documentLoader->response().httpHeaderField("Content-Language"); + if (!headerContentLanguage.isEmpty()) { + size_t commaIndex = headerContentLanguage.find(','); + headerContentLanguage.truncate(commaIndex); // notFound == -1 == don't truncate + headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTMLSpace); + if (!headerContentLanguage.isEmpty()) + m_frame->document()->setContentLanguage(headerContentLanguage); + } } history()->restoreDocumentState(); @@ -1689,6 +1699,9 @@ void FrameLoader::commitProvisionalLoad() prepareForCachedPageRestore(); cachedPage->restore(m_frame->page()); + // The page should be removed from the cache immediately after a restoration in order for the PageCache to be consistent. + pageCache()->remove(history()->currentItem()); + dispatchDidCommitLoad(); // If we have a title let the WebView know about it. @@ -1697,8 +1710,11 @@ void FrameLoader::commitProvisionalLoad() m_client->dispatchDidReceiveTitle(title); checkCompleted(); - } else + } else { + if (cachedPage) + pageCache()->remove(history()->currentItem()); didOpenURL(); + } LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame->tree()->uniqueName().string().utf8().data(), m_frame->document() ? m_frame->document()->url().string().utf8().data() : ""); @@ -1726,8 +1742,6 @@ void FrameLoader::commitProvisionalLoad() // Could be an issue with a giant local file. notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, 0, static_cast<int>(response.expectedContentLength()), 0, error); } - - pageCache()->remove(history()->currentItem()); // FIXME: Why only this frame and not parent frames? checkLoadCompleteForThisFrame(); @@ -3192,8 +3206,10 @@ void FrameLoader::dispatchDidCommitLoad() m_client->dispatchDidCommitLoad(); - if (isLoadingMainFrame()) + if (isLoadingMainFrame()) { m_frame->page()->resetSeenPlugins(); + m_frame->page()->resetSeenMediaEngines(); + } InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get()); } diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp index 8551a52d9..fb6d0e35c 100644 --- a/Source/WebCore/loader/HistoryController.cpp +++ b/Source/WebCore/loader/HistoryController.cpp @@ -60,7 +60,7 @@ namespace WebCore { static inline void addVisitedLink(Page* page, const KURL& url) { #if USE(PLATFORM_STRATEGIES) - platformStrategies()->visitedLinkStrategy()->addVisitedLink(page, visitedLinkHash(url.string().characters(), url.string().length())); + platformStrategies()->visitedLinkStrategy()->addVisitedLink(page, visitedLinkHash(url.string())); #else page->group().addVisitedLink(url); #endif diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp index 50975794e..e57017126 100644 --- a/Source/WebCore/loader/SubresourceLoader.cpp +++ b/Source/WebCore/loader/SubresourceLoader.cpp @@ -128,17 +128,24 @@ void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou { // Store the previous URL because the call to ResourceLoader::willSendRequest will modify it. KURL previousURL = request().url(); - - ResourceLoader::willSendRequest(newRequest, redirectResponse); - if (!previousURL.isNull() && !newRequest.isNull() && previousURL != newRequest.url()) { - if (m_documentLoader->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) { - if (m_resource->type() != CachedResource::ImageResource || !m_documentLoader->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) { - m_resource->willSendRequest(newRequest, redirectResponse); - return; - } + + ASSERT(!newRequest.isNull()); + if (!previousURL.isNull() && previousURL != newRequest.url()) { + if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url())) { + cancel(); + return; + } + if (m_resource->type() == CachedResource::ImageResource && m_documentLoader->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) { + cancel(); + return; } - cancel(); + m_resource->willSendRequest(newRequest, redirectResponse); } + + if (newRequest.isNull() || reachedTerminalState()) + return; + + ResourceLoader::willSendRequest(newRequest, redirectResponse); } void SubresourceLoader::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) @@ -207,12 +214,11 @@ void SubresourceLoader::didReceiveData(const char* data, int length, long long e // Reference the object in this method since the additional processing can do // anything including removing the last reference to this object; one example of this is 3266216. RefPtr<SubresourceLoader> protect(this); - ResourceLoader::didReceiveData(data, length, encodedDataLength, allAtOnce); - - if (m_loadingMultipartContent) - return; - - sendDataToResource(data, length); + addData(data, length, allAtOnce); + if (!m_loadingMultipartContent) + sendDataToResource(data, length); + if (shouldSendResourceLoadCallbacks() && m_frame) + frameLoader()->notifier()->didReceiveData(this, data, length, static_cast<int>(encodedDataLength)); } bool SubresourceLoader::checkForHTTPStatusCodeError() diff --git a/Source/WebCore/loader/cache/CachedResource.cpp b/Source/WebCore/loader/cache/CachedResource.cpp index 703c42836..703c42836 100755..100644 --- a/Source/WebCore/loader/cache/CachedResource.cpp +++ b/Source/WebCore/loader/cache/CachedResource.cpp diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp index 7c420c066..1ffca4fc1 100644 --- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp +++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp @@ -229,7 +229,7 @@ CachedResourceHandle<CachedXSLStyleSheet> CachedResourceLoader::requestXSLStyleS #if ENABLE(SVG) CachedResourceHandle<CachedSVGDocument> CachedResourceLoader::requestSVGDocument(ResourceRequest& request) { - return static_cast<CachedSVGDocument*>(requestResource(CachedResource::SVGDocumentResource, request, request.url(), defaultCachedResourceOptions()).get()); + return static_cast<CachedSVGDocument*>(requestResource(CachedResource::SVGDocumentResource, request, String(), defaultCachedResourceOptions()).get()); } #endif diff --git a/Source/WebCore/page/DOMWindowPagePopup.cpp b/Source/WebCore/page/DOMWindowPagePopup.cpp index 09e3c16c0..62ba2c396 100644 --- a/Source/WebCore/page/DOMWindowPagePopup.cpp +++ b/Source/WebCore/page/DOMWindowPagePopup.cpp @@ -67,5 +67,11 @@ void DOMWindowPagePopup::install(DOMWindow* window, PagePopupClient* popupClient provideTo(window, supplementName(), adoptPtr(new DOMWindowPagePopup(popupClient))); } +void DOMWindowPagePopup::uninstall(DOMWindow* window) +{ + ASSERT(window); + window->removeSupplement(supplementName()); +} + } #endif diff --git a/Source/WebCore/page/DOMWindowPagePopup.h b/Source/WebCore/page/DOMWindowPagePopup.h index 4f806d981..855997475 100644 --- a/Source/WebCore/page/DOMWindowPagePopup.h +++ b/Source/WebCore/page/DOMWindowPagePopup.h @@ -44,6 +44,7 @@ class DOMWindowPagePopup : public Supplement<DOMWindow> { public: static PagePopupController* pagePopupController(DOMWindow*); static void install(DOMWindow*, PagePopupClient*); + static void uninstall(DOMWindow*); ~DOMWindowPagePopup(); private: diff --git a/Source/WebCore/page/DiagnosticLoggingKeys.cpp b/Source/WebCore/page/DiagnosticLoggingKeys.cpp index ca54547b0..8f3b4d603 100644 --- a/Source/WebCore/page/DiagnosticLoggingKeys.cpp +++ b/Source/WebCore/page/DiagnosticLoggingKeys.cpp @@ -64,6 +64,18 @@ const String& DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey() return key; } +const String& DiagnosticLoggingKeys::pageContainsMediaEngineKey() +{ + DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsMediaEngine"))); + return key; +} + +const String& DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey() +{ + DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsAtLeastOneMediaEngine"))); + return key; +} + const String& DiagnosticLoggingKeys::passKey() { DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pass"))); diff --git a/Source/WebCore/page/DiagnosticLoggingKeys.h b/Source/WebCore/page/DiagnosticLoggingKeys.h index 951806e57..52e8964c9 100644 --- a/Source/WebCore/page/DiagnosticLoggingKeys.h +++ b/Source/WebCore/page/DiagnosticLoggingKeys.h @@ -39,7 +39,9 @@ public: static const String& pluginLoadingFailedKey(); static const String& pageContainsPluginKey(); static const String& pageContainsAtLeastOnePluginKey(); - + static const String& pageContainsMediaEngineKey(); + static const String& pageContainsAtLeastOneMediaEngineKey(); + // Success keys static const String& passKey(); static const String& failKey(); diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp index 19254c8c4..ed25477ed 100644 --- a/Source/WebCore/page/Frame.cpp +++ b/Source/WebCore/page/Frame.cpp @@ -777,11 +777,10 @@ PassRefPtr<Range> Frame::rangeForPoint(const IntPoint& framePoint) return 0; } -void Frame::createView(const IntSize& viewportSize, - const Color& backgroundColor, bool transparent, - const IntSize& fixedLayoutSize, bool useFixedLayout, - ScrollbarMode horizontalScrollbarMode, bool horizontalLock, - ScrollbarMode verticalScrollbarMode, bool verticalLock) +void Frame::createView(const IntSize& viewportSize, const Color& backgroundColor, bool transparent, + const IntSize& fixedLayoutSize, const IntRect& fixedVisibleContentRect , + bool useFixedLayout, ScrollbarMode horizontalScrollbarMode, bool horizontalLock, + ScrollbarMode verticalScrollbarMode, bool verticalLock) { ASSERT(this); ASSERT(m_page); @@ -797,6 +796,7 @@ void Frame::createView(const IntSize& viewportSize, if (isMainFrame) { frameView = FrameView::create(this, viewportSize); frameView->setFixedLayoutSize(fixedLayoutSize); + frameView->setFixedVisibleContentRect(fixedVisibleContentRect); frameView->setUseFixedLayout(useFixedLayout); } else frameView = FrameView::create(this); diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h index 0a07c4220..23a59ebdc 100644 --- a/Source/WebCore/page/Frame.h +++ b/Source/WebCore/page/Frame.h @@ -88,8 +88,9 @@ namespace WebCore { void init(); void setView(PassRefPtr<FrameView>); - void createView(const IntSize&, const Color&, bool, const IntSize&, bool, - ScrollbarMode = ScrollbarAuto, bool horizontalLock = false, + void createView(const IntSize&, const Color&, bool, + const IntSize& fixedLayoutSize = IntSize(), const IntRect& fixedVisibleContentRect = IntRect(), + bool useFixedLayout = false, ScrollbarMode = ScrollbarAuto, bool horizontalLock = false, ScrollbarMode = ScrollbarAuto, bool verticalLock = false); ~Frame(); diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp index 1be0c54c2..2d312a31a 100644 --- a/Source/WebCore/page/FrameView.cpp +++ b/Source/WebCore/page/FrameView.cpp @@ -2500,8 +2500,14 @@ void FrameView::performPostLayoutTasks() } #if USE(ACCELERATED_COMPOSITING) - if (TiledBacking* tiledBacking = this->tiledBacking()) - tiledBacking->setTileCoverage(canHaveScrollbars() ? TiledBacking::CoverageForScrolling : TiledBacking::CoverageForVisibleArea); + if (TiledBacking* tiledBacking = this->tiledBacking()) { + if (page) { + if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) { + bool shouldLimitTileCoverage = !canHaveScrollbars() || scrollingCoordinator->shouldUpdateScrollLayerPositionOnMainThread(); + tiledBacking->setTileCoverage(shouldLimitTileCoverage ? TiledBacking::CoverageForVisibleArea : TiledBacking::CoverageForScrolling); + } + } + } #endif scrollToAnchor(); diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp index 484a1eb99..7009ab566 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp @@ -147,7 +147,6 @@ Page::Page(PageClients& pageClients) , m_pageScaleFactor(1) , m_deviceScaleFactor(1) , m_suppressScrollbarAnimations(false) - , m_javaScriptURLsAreAllowed(true) , m_didLoadUserStyleSheet(false) , m_userStyleSheetModificationTime(0) , m_group(0) @@ -1002,16 +1001,6 @@ void Page::setMemoryCacheClientCallsEnabled(bool enabled) frame->loader()->tellClientAboutPastMemoryCacheLoads(); } -void Page::setJavaScriptURLsAreAllowed(bool areAllowed) -{ - m_javaScriptURLsAreAllowed = areAllowed; -} - -bool Page::javaScriptURLsAreAllowed() const -{ - return m_javaScriptURLsAreAllowed; -} - void Page::setMinimumTimerInterval(double minimumTimerInterval) { double oldTimerInterval = m_minimumTimerInterval; @@ -1260,6 +1249,26 @@ void Page::resetSeenPlugins() m_seenPlugins.clear(); } +bool Page::hasSeenAnyMediaEngine() const +{ + return !m_seenMediaEngines.isEmpty(); +} + +bool Page::hasSeenMediaEngine(const String& engineDescription) const +{ + return m_seenMediaEngines.contains(engineDescription); +} + +void Page::sawMediaEngine(const String& engineDescription) +{ + m_seenMediaEngines.add(engineDescription); +} + +void Page::resetSeenMediaEngines() +{ + m_seenMediaEngines.clear(); +} + void Page::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const { MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Page); diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h index 062c74c7e..c16b57bc5 100644 --- a/Source/WebCore/page/Page.h +++ b/Source/WebCore/page/Page.h @@ -308,9 +308,6 @@ namespace WebCore { void setMemoryCacheClientCallsEnabled(bool); bool areMemoryCacheClientCallsEnabled() const { return m_areMemoryCacheClientCallsEnabled; } - void setJavaScriptURLsAreAllowed(bool); - bool javaScriptURLsAreAllowed() const; - // Don't allow more than a certain number of frames in a page. // This seems like a reasonable upper bound, and otherwise mutually // recursive frameset pages can quickly bring the program to its knees @@ -352,6 +349,11 @@ namespace WebCore { void sawPlugin(const String& serviceType); void resetSeenPlugins(); + bool hasSeenMediaEngine(const String& engineName) const; + bool hasSeenAnyMediaEngine() const; + void sawMediaEngine(const String& engineName); + void resetSeenMediaEngines(); + void reportMemoryUsage(MemoryObjectInfo*) const; private: @@ -426,8 +428,6 @@ namespace WebCore { Pagination m_pagination; - bool m_javaScriptURLsAreAllowed; - String m_userStyleSheetPath; mutable String m_userStyleSheet; mutable bool m_didLoadUserStyleSheet; @@ -473,6 +473,7 @@ namespace WebCore { bool m_scriptedAnimationsSuspended; HashSet<String> m_seenPlugins; + HashSet<String> m_seenMediaEngines; }; } // namespace WebCore diff --git a/Source/WebCore/page/PageGroup.cpp b/Source/WebCore/page/PageGroup.cpp index 314ed1419..77928ce64 100644 --- a/Source/WebCore/page/PageGroup.cpp +++ b/Source/WebCore/page/PageGroup.cpp @@ -210,7 +210,7 @@ void PageGroup::addVisitedLink(const KURL& url) if (!shouldTrackVisitedLinks) return; ASSERT(!url.isEmpty()); - addVisitedLink(visitedLinkHash(url.string().characters(), url.string().length())); + addVisitedLink(visitedLinkHash(url.string())); } void PageGroup::addVisitedLink(const UChar* characters, size_t length) diff --git a/Source/WebCore/page/Performance.cpp b/Source/WebCore/page/Performance.cpp index 149175ca6..24987ced8 100644 --- a/Source/WebCore/page/Performance.cpp +++ b/Source/WebCore/page/Performance.cpp @@ -49,8 +49,15 @@ namespace WebCore { +#if ENABLE(RESOURCE_TIMING) +static const size_t defaultResourceTimingBufferSize = 150; +#endif + Performance::Performance(Frame* frame) : DOMWindowProperty(frame) +#if ENABLE(RESOURCE_TIMING) + , m_resourceTimingBufferSize(defaultResourceTimingBufferSize) +#endif { } @@ -143,19 +150,29 @@ void Performance::webkitClearResourceTimings() m_resourceTimingBuffer.clear(); } -void Performance::webkitSetResourceTimingBufferSize(unsigned int) +void Performance::webkitSetResourceTimingBufferSize(unsigned size) { - // FIXME: Implement this. + m_resourceTimingBufferSize = size; + if (isResourceTimingBufferFull()) + dispatchEvent(Event::create(eventNames().webkitresourcetimingbufferfullEvent, false, false)); } void Performance::addResourceTiming(const ResourceRequest& request, const ResourceResponse& response, double finishTime, Document* requestingDocument) { - if (!response.resourceLoadTiming()) + if (!response.resourceLoadTiming() || isResourceTimingBufferFull()) return; RefPtr<PerformanceEntry> entry = PerformanceResourceTiming::create(request, response, finishTime, requestingDocument); - // FIXME: Need to enforce buffer limits. + m_resourceTimingBuffer.append(entry); + + if (isResourceTimingBufferFull()) + dispatchEvent(Event::create(eventNames().webkitresourcetimingbufferfullEvent, false, false)); +} + +bool Performance::isResourceTimingBufferFull() +{ + return m_resourceTimingBuffer.size() >= m_resourceTimingBufferSize; } #endif // ENABLE(RESOURCE_TIMING) diff --git a/Source/WebCore/page/Performance.h b/Source/WebCore/page/Performance.h index fe09d902c..8d949f24c 100644 --- a/Source/WebCore/page/Performance.h +++ b/Source/WebCore/page/Performance.h @@ -100,6 +100,7 @@ private: virtual void derefEventTarget() { deref(); } virtual EventTargetData* eventTargetData(); virtual EventTargetData* ensureEventTargetData(); + bool isResourceTimingBufferFull(); EventTargetData m_eventTargetData; @@ -108,6 +109,7 @@ private: #if ENABLE(RESOURCE_TIMING) Vector<RefPtr<PerformanceEntry> > m_resourceTimingBuffer; + unsigned m_resourceTimingBufferSize; #endif #if ENABLE(USER_TIMING) diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp index c2fd8b386..382cfd07f 100644 --- a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp +++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp @@ -258,7 +258,7 @@ void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase) } #endif -bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView) +bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView) const { const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView->viewportConstrainedObjects(); if (!viewportConstrainedObjects) @@ -279,7 +279,7 @@ bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView) #endif } -void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread() +MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() const { FrameView* frameView = m_page->mainFrame()->view(); @@ -296,7 +296,12 @@ void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread() if (m_page->mainFrame()->document()->isImageDocument()) mainThreadScrollingReasons |= IsImageDocument; - setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReasons); + return mainThreadScrollingReasons; +} + +void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread() +{ + setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReasons()); } void ScrollingCoordinator::setForceMainThreadScrollLayerPositionUpdates(bool forceMainThreadScrollLayerPositionUpdates) diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h index 2396da881..2fa15fe2f 100644 --- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h +++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h @@ -109,7 +109,7 @@ public: virtual bool requestScrollPositionUpdate(FrameView*, const IntPoint&) { return false; } virtual bool handleWheelEvent(FrameView*, const PlatformWheelEvent&) { return true; } virtual void updateMainFrameScrollPositionAndScrollLayerPosition() { } - virtual ScrollingNodeID attachToStateTree(ScrollingNodeID nodeID) { return nodeID; } + virtual ScrollingNodeID attachToStateTree(ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/) { return newNodeID; } virtual void detachFromStateTree(ScrollingNodeID) { } virtual void clearStateTree() { } @@ -127,6 +127,9 @@ public: IsImageDocument = 1 << 4 }; + MainThreadScrollingReasons mainThreadScrollingReasons() const; + bool shouldUpdateScrollLayerPositionOnMainThread() const { return mainThreadScrollingReasons() != 0; } + // These virtual functions are currently unique to Chromium's WebLayer approach. Their meaningful // implementations are in ScrollingCoordinatorChromium. virtual void frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer*) { } @@ -148,7 +151,7 @@ private: virtual void recomputeWheelEventHandlerCountForFrameView(FrameView*) { } virtual void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons) { } - bool hasNonLayerFixedObjects(FrameView*); + bool hasNonLayerFixedObjects(FrameView*) const; void updateShouldUpdateScrollLayerPositionOnMainThread(); bool m_forceMainThreadScrollLayerPositionUpdates; diff --git a/Source/WebCore/page/scrolling/ScrollingStateNode.h b/Source/WebCore/page/scrolling/ScrollingStateNode.h index 5a801d23a..eb8c389c6 100644 --- a/Source/WebCore/page/scrolling/ScrollingStateNode.h +++ b/Source/WebCore/page/scrolling/ScrollingStateNode.h @@ -71,6 +71,7 @@ public: void setScrollingStateTree(ScrollingStateTree* tree) { m_scrollingStateTree = tree; } ScrollingNodeID scrollingNodeID() const { return m_nodeID; } + void setScrollingNodeID(ScrollingNodeID nodeID) { m_nodeID = nodeID; } ScrollingStateNode* parent() const { return m_parent; } void setParent(ScrollingStateNode* parent) { m_parent = parent; } diff --git a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp index 06ea4730f..ba3583075 100644 --- a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp +++ b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp @@ -77,12 +77,6 @@ ScrollingStateScrollingNode::~ScrollingStateScrollingNode() { } -void ScrollingStateScrollingNode::setHasChangedProperties() -{ - m_changedProperties = All; - ScrollingStateNode::setHasChangedProperties(); -} - PassOwnPtr<ScrollingStateNode> ScrollingStateScrollingNode::cloneAndResetNode() { OwnPtr<ScrollingStateScrollingNode> clone = adoptPtr(new ScrollingStateScrollingNode(this)); diff --git a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h index ba9f6475e..714d92683 100644 --- a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h +++ b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h @@ -56,7 +56,6 @@ public: VerticalScrollbarMode = 1 << 10, ScrollOrigin = 1 << 11, RequestedScrollPosition = 1 << 12, - All = (1 << 13) - 1 // This will need to be updated if we add or remove anything the ChangedProperties. }; virtual bool isScrollingStateScrollingNode() OVERRIDE { return true; } @@ -66,7 +65,6 @@ public: virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; } virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; } virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; } - virtual void setHasChangedProperties(); const IntRect& viewportRect() const { return m_viewportRect; } void setViewportRect(const IntRect&); diff --git a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp b/Source/WebCore/page/scrolling/ScrollingStateTree.cpp index 850841e9a..84bc5db05 100644 --- a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp +++ b/Source/WebCore/page/scrolling/ScrollingStateTree.cpp @@ -36,7 +36,8 @@ PassOwnPtr<ScrollingStateTree> ScrollingStateTree::create() } ScrollingStateTree::ScrollingStateTree() - : m_hasChangedProperties(false) + : m_rootStateNode(ScrollingStateScrollingNode::create(this, 0)) + , m_hasChangedProperties(false) { } @@ -63,13 +64,6 @@ PassOwnPtr<ScrollingStateTree> ScrollingStateTree::commit() void ScrollingStateTree::removeNode(ScrollingStateNode* node) { ASSERT(m_rootStateNode); - - if (node == m_rootStateNode) { - didRemoveNode(m_rootStateNode->scrollingNodeID()); - m_rootStateNode = 0; - return; - } - m_rootStateNode->removeChild(node); } @@ -78,16 +72,6 @@ void ScrollingStateTree::didRemoveNode(ScrollingNodeID nodeID) m_nodesRemovedSinceLastCommit.append(nodeID); } -void ScrollingStateTree::rootLayerDidChange() -{ - // If the root layer has changed, then destroyed and re-created the root state node. That means that the - // cached properties in ScrollingStateScrollingNode are no longer reflective of the properties we have - // cached over in the ScrollingTree. To resolve this, we will mark all of the properties as having changed - // so that the ScrollingTree will be in synch with the state tree. - setHasChangedProperties(true); - rootStateNode()->setHasChangedProperties(); -} - } // namespace WebCore #endif // ENABLE(THREADED_SCROLLING) diff --git a/Source/WebCore/page/scrolling/ScrollingStateTree.h b/Source/WebCore/page/scrolling/ScrollingStateTree.h index fc5b73542..98659fcae 100644 --- a/Source/WebCore/page/scrolling/ScrollingStateTree.h +++ b/Source/WebCore/page/scrolling/ScrollingStateTree.h @@ -55,7 +55,6 @@ public: ~ScrollingStateTree(); ScrollingStateScrollingNode* rootStateNode() const { return m_rootStateNode.get(); } - void setRootStateNode(PassOwnPtr<ScrollingStateScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; } // Copies the current tree state and clears the changed properties mask in the original. PassOwnPtr<ScrollingStateTree> commit(); @@ -64,14 +63,14 @@ public: void didRemoveNode(ScrollingNodeID); const Vector<ScrollingNodeID>& removedNodes() const { return m_nodesRemovedSinceLastCommit; } - void rootLayerDidChange(); - void setHasChangedProperties(bool changedProperties) { m_hasChangedProperties = changedProperties; } bool hasChangedProperties() const { return m_hasChangedProperties; } private: ScrollingStateTree(); + void setRootStateNode(PassOwnPtr<ScrollingStateScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; } + PassOwnPtr<ScrollingStateTree> clone(); OwnPtr<ScrollingStateScrollingNode> m_rootStateNode; diff --git a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h index c0d617fa9..de0d9a5c7 100644 --- a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h +++ b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h @@ -66,7 +66,7 @@ public: // These functions are used to indicate that a layer should be (or should not longer be) represented by a node // in the scrolling tree. - virtual ScrollingNodeID attachToStateTree(ScrollingNodeID); + virtual ScrollingNodeID attachToStateTree(ScrollingNodeID newNodeID, ScrollingNodeID parentID); virtual void detachFromStateTree(ScrollingNodeID); // This function wipes out the current tree. diff --git a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm index bb8185120..5a03ef31d 100644 --- a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm +++ b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm @@ -147,7 +147,6 @@ void ScrollingCoordinatorMac::frameViewRootLayerDidChange(FrameView* frameView) // If the root layer does not have a ScrollingStateNode, then we should create one. ensureRootStateNodeForFrameView(frameView); ASSERT(m_scrollingStateTree->rootStateNode()); - m_scrollingStateTree->rootLayerDidChange(); ScrollingCoordinator::frameViewRootLayerDidChange(frameView); @@ -234,22 +233,26 @@ void ScrollingCoordinatorMac::updateMainFrameScrollPositionAndScrollLayerPositio scrollLayer->setPosition(-frameView->scrollPosition()); } -ScrollingNodeID ScrollingCoordinatorMac::attachToStateTree(ScrollingNodeID scrollLayerID) +ScrollingNodeID ScrollingCoordinatorMac::attachToStateTree(ScrollingNodeID newNodeID, ScrollingNodeID parentID) { - ASSERT(scrollLayerID); + ASSERT(newNodeID); - ScrollingStateScrollingNode* existingNode = stateNodeForID(scrollLayerID); + ScrollingStateScrollingNode* existingNode = stateNodeForID(newNodeID); if (existingNode && existingNode == m_scrollingStateTree->rootStateNode()) - return scrollLayerID; + return newNodeID; - clearStateTree(); + // If there is no parent, this is the root node. Right now, we only support the root node. + // FIXME: In the future, we should append child nodes in the appropriate spot in the state + // tree. + if (!parentID) { + // If we're resetting the root node, we should clear the HashMap and destroy the current children. + clearStateTree(); - // FIXME: In the future, this function will have to take a parent ID so that it can - // append the node in the appropriate spot in the state tree. For now we always assume - // this is the root node. - m_scrollingStateTree->setRootStateNode(ScrollingStateScrollingNode::create(m_scrollingStateTree.get(), scrollLayerID)); - m_stateNodeMap.set(scrollLayerID, m_scrollingStateTree->rootStateNode()); - return scrollLayerID; + m_scrollingStateTree->rootStateNode()->setScrollingNodeID(newNodeID); + m_stateNodeMap.set(newNodeID, m_scrollingStateTree->rootStateNode()); + } + + return newNodeID; } void ScrollingCoordinatorMac::detachFromStateTree(ScrollingNodeID scrollLayerID) @@ -275,8 +278,7 @@ void ScrollingCoordinatorMac::detachFromStateTree(ScrollingNodeID scrollLayerID) void ScrollingCoordinatorMac::clearStateTree() { m_stateNodeMap.clear(); - if (ScrollingStateScrollingNode* node = m_scrollingStateTree->rootStateNode()) - m_scrollingStateTree->removeNode(node); + m_scrollingStateTree->removeNode(m_scrollingStateTree->rootStateNode()); } ScrollingStateScrollingNode* ScrollingCoordinatorMac::stateNodeForID(ScrollingNodeID scrollLayerID) @@ -294,7 +296,7 @@ ScrollingStateScrollingNode* ScrollingCoordinatorMac::stateNodeForID(ScrollingNo void ScrollingCoordinatorMac::ensureRootStateNodeForFrameView(FrameView* frameView) { - attachToStateTree(frameView->scrollLayerID()); + attachToStateTree(frameView->scrollLayerID(), 0); } void ScrollingCoordinatorMac::setScrollLayerForNode(GraphicsLayer* scrollLayer, ScrollingStateNode* node) diff --git a/Source/WebCore/platform/CalculationValue.cpp b/Source/WebCore/platform/CalculationValue.cpp index 57413fbfe..57413fbfe 100755..100644 --- a/Source/WebCore/platform/CalculationValue.cpp +++ b/Source/WebCore/platform/CalculationValue.cpp diff --git a/Source/WebCore/platform/DateComponents.cpp b/Source/WebCore/platform/DateComponents.cpp index 320d723cb..c7bc6ca52 100644 --- a/Source/WebCore/platform/DateComponents.cpp +++ b/Source/WebCore/platform/DateComponents.cpp @@ -247,8 +247,8 @@ bool DateComponents::addMinute(int minute) if (minute > 59) { carry = minute / 60; minute = minute % 60; - } else if (m_minute < 0) { - carry = (59 - m_minute) / 60; + } else if (minute < 0) { + carry = (59 - minute) / 60; minute += carry * 60; carry = -carry; ASSERT(minute >= 0 && minute <= 59); diff --git a/Source/WebCore/platform/LinkHash.cpp b/Source/WebCore/platform/LinkHash.cpp index 3615e0eea..a0ea795ea 100644 --- a/Source/WebCore/platform/LinkHash.cpp +++ b/Source/WebCore/platform/LinkHash.cpp @@ -194,11 +194,21 @@ static inline bool needsTrailingSlash(const UChar* characters, unsigned length) return pos == length; } -static ALWAYS_INLINE LinkHash visitedLinkHashInline(const UChar* url, unsigned length) +template <typename CharacterType> +static ALWAYS_INLINE LinkHash visitedLinkHashInline(const CharacterType* url, unsigned length) { return AlreadyHashed::avoidDeletedValue(StringHasher::computeHash(url, length)); } +LinkHash visitedLinkHash(const String& url) +{ + unsigned length = url.length(); + + if (length && url.is8Bit()) + return visitedLinkHashInline(url.characters8(), length); + return visitedLinkHashInline(url.characters(), length); +} + LinkHash visitedLinkHash(const UChar* url, unsigned length) { return visitedLinkHashInline(url, length); diff --git a/Source/WebCore/platform/LinkHash.h b/Source/WebCore/platform/LinkHash.h index dc494d2dd..78eaa3a43 100644 --- a/Source/WebCore/platform/LinkHash.h +++ b/Source/WebCore/platform/LinkHash.h @@ -53,7 +53,8 @@ struct LinkHashHash { } }; -// Returns the has of the string that will be used for visited link coloring. +// Returns the hash of the string that will be used for visited link coloring. +LinkHash visitedLinkHash(const String& url); LinkHash visitedLinkHash(const UChar* url, unsigned length); // Resolves the potentially relative URL "attributeURL" relative to the given diff --git a/Source/WebCore/platform/LocalizedStrings.cpp b/Source/WebCore/platform/LocalizedStrings.cpp index 5a7ddf8ba..abf1bca5e 100644 --- a/Source/WebCore/platform/LocalizedStrings.cpp +++ b/Source/WebCore/platform/LocalizedStrings.cpp @@ -882,6 +882,10 @@ String localizedMediaControlElementHelpText(const String& name) if (name == "HideClosedCaptionsButton") return WEB_UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button"); + // The description of this button is descriptive enough that it doesn't require help text. + if (name == "EnterFullscreenButton") + return String(); + ASSERT_NOT_REACHED(); return String(); } diff --git a/Source/WebCore/platform/LocalizedStrings.h b/Source/WebCore/platform/LocalizedStrings.h index 83432cf79..8c56fe1d5 100644 --- a/Source/WebCore/platform/LocalizedStrings.h +++ b/Source/WebCore/platform/LocalizedStrings.h @@ -192,12 +192,7 @@ namespace WebCore { // "datetime-local" input UI instead "----". String placeholderForYearField(); - // monthFormatInLDML() returns month and year format in LDML, Unicode - // technical standard 35, Locale Data Markup Language, e.g. "MM-yyyyy" - // for "month" input type. - String monthFormatInLDML(); - - // monthFormatInLDML() returns week and year format in LDML, Unicode + // weekFormatInLDML() returns week and year format in LDML, Unicode // technical standard 35, Locale Data Markup Language, e.g. "WW-yyyyy" // for "week" input type. String weekFormatInLDML(); diff --git a/Source/WebCore/platform/MIMETypeRegistry.cpp b/Source/WebCore/platform/MIMETypeRegistry.cpp index 440b4299a..440b4299a 100755..100644 --- a/Source/WebCore/platform/MIMETypeRegistry.cpp +++ b/Source/WebCore/platform/MIMETypeRegistry.cpp diff --git a/Source/WebCore/platform/Supplementable.h b/Source/WebCore/platform/Supplementable.h index 4199ac509..0a278fca3 100644 --- a/Source/WebCore/platform/Supplementable.h +++ b/Source/WebCore/platform/Supplementable.h @@ -64,6 +64,11 @@ public: m_supplements.set(key, supplement); } + void removeSupplement(const AtomicString& key) + { + m_supplements.remove(key); + } + Supplement<T>* requireSupplement(const AtomicString& key) { return m_supplements.get(key); diff --git a/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp index 540c979a5..3eab85b29 100644 --- a/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp +++ b/Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp @@ -74,6 +74,7 @@ private: GRefPtr<GstElement> m_decodebin; GRefPtr<GstElement> m_deInterleave; GRefPtr<GMainLoop> m_loop; + bool m_errorOccurred; }; static GstCaps* getGStreamerAudioCaps(int channels, float sampleRate) @@ -131,6 +132,7 @@ AudioFileReader::AudioFileReader(const char* filePath) , m_dataSize(0) , m_filePath(filePath) , m_channelSize(0) + , m_errorOccurred(false) { } @@ -139,11 +141,34 @@ AudioFileReader::AudioFileReader(const void* data, size_t dataSize) , m_dataSize(dataSize) , m_filePath(0) , m_channelSize(0) + , m_errorOccurred(false) { } AudioFileReader::~AudioFileReader() { + if (m_pipeline) { + GRefPtr<GstBus> bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline)); + g_signal_handlers_disconnect_by_func(bus.get(), reinterpret_cast<gpointer>(messageCallback), this); + gst_element_set_state(m_pipeline, GST_STATE_NULL); + gst_object_unref(GST_OBJECT(m_pipeline)); + } + + if (m_decodebin) { + g_signal_handlers_disconnect_by_func(m_decodebin.get(), reinterpret_cast<gpointer>(onGStreamerDecodebinPadAddedCallback), this); + m_decodebin.clear(); + } + + if (m_deInterleave) { + g_signal_handlers_disconnect_by_func(m_deInterleave.get(), reinterpret_cast<gpointer>(onGStreamerDeinterleavePadAddedCallback), this); + g_signal_handlers_disconnect_by_func(m_deInterleave.get(), reinterpret_cast<gpointer>(onGStreamerDeinterleaveReadyCallback), this); + m_deInterleave.clear(); + } + + gst_buffer_list_iterator_free(m_frontLeftBuffersIterator); + gst_buffer_list_iterator_free(m_frontRightBuffersIterator); + gst_buffer_list_unref(m_frontLeftBuffers); + gst_buffer_list_unref(m_frontRightBuffers); } GstFlowReturn AudioFileReader::handleBuffer(GstAppSink* sink) @@ -211,11 +236,13 @@ gboolean AudioFileReader::handleMessage(GstMessage* message) break; case GST_MESSAGE_WARNING: gst_message_parse_warning(message, &error.outPtr(), &debug.outPtr()); - g_warning("Warning: %d, %s", error->code, error->message); + g_warning("Warning: %d, %s. Debug output: %s", error->code, error->message, debug.get()); break; case GST_MESSAGE_ERROR: gst_message_parse_error(message, &error.outPtr(), &debug.outPtr()); - ASSERT_WITH_MESSAGE(0, "Fatal error: %d, %s", error->code, error->message); + g_warning("Error: %d, %s. Debug output: %s", error->code, error->message, debug.get()); + m_errorOccurred = true; + g_main_loop_quit(m_loop.get()); break; default: break; @@ -351,31 +378,17 @@ PassOwnPtr<AudioBus> AudioFileReader::createBus(float sampleRate, bool mixToMono g_main_loop_run(m_loop.get()); g_main_context_pop_thread_default(context.get()); - GRefPtr<GstBus> bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline)); - g_signal_handlers_disconnect_by_func(bus.get(), reinterpret_cast<gpointer>(messageCallback), this); - - g_signal_handlers_disconnect_by_func(m_decodebin.get(), reinterpret_cast<gpointer>(onGStreamerDecodebinPadAddedCallback), this); - g_signal_handlers_disconnect_by_func(m_deInterleave.get(), reinterpret_cast<gpointer>(onGStreamerDeinterleavePadAddedCallback), this); - g_signal_handlers_disconnect_by_func(m_deInterleave.get(), reinterpret_cast<gpointer>(onGStreamerDeinterleaveReadyCallback), this); - unsigned channels = mixToMono ? 1 : 2; OwnPtr<AudioBus> audioBus = adoptPtr(new AudioBus(channels, m_channelSize, true)); audioBus->setSampleRate(m_sampleRate); + if (m_errorOccurred) + return audioBus.release(); + copyGstreamerBuffersToAudioChannel(m_frontLeftBuffers, audioBus->channel(0)); if (!mixToMono) copyGstreamerBuffersToAudioChannel(m_frontRightBuffers, audioBus->channel(1)); - gst_buffer_list_iterator_free(m_frontLeftBuffersIterator); - gst_buffer_list_iterator_free(m_frontRightBuffersIterator); - gst_buffer_list_unref(m_frontLeftBuffers); - gst_buffer_list_unref(m_frontRightBuffers); - - gst_element_set_state(m_pipeline, GST_STATE_NULL); - gst_object_unref(GST_OBJECT(m_pipeline)); - - m_decodebin.clear(); - m_deInterleave.clear(); return audioBus.release(); } diff --git a/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp b/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp index 310f39c1c..6fc787f50 100644 --- a/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp +++ b/Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp @@ -28,7 +28,6 @@ #include <wtf/gobject/GOwnPtr.h> #include <wtf/text/CString.h> -#include <gio/gio.h> #include <glib.h> namespace WebCore { @@ -36,14 +35,12 @@ namespace WebCore { PassOwnPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, float sampleRate) { GOwnPtr<gchar> filename(g_strdup_printf("%s.wav", name)); - GOwnPtr<gchar> absoluteFilename(g_build_filename(sharedResourcesPath().data(), "resources", "audio", filename.get(), NULL)); - - GFile* file = g_file_new_for_path(filename.get()); - if (!g_file_query_exists(file, 0)) { - // Uninstalled case, assume we're in the WebKit root directory. - const char* environmentPath = getenv("AUDIO_RESOURCES_PATH"); + const char* environmentPath = getenv("AUDIO_RESOURCES_PATH"); + GOwnPtr<gchar> absoluteFilename; + if (environmentPath) absoluteFilename.set(g_build_filename(environmentPath, filename.get(), NULL)); - } + else + absoluteFilename.set(g_build_filename(sharedResourcesPath().data(), "resources", "audio", filename.get(), NULL)); return createBusFromAudioFile(absoluteFilename.get(), false, sampleRate); } diff --git a/Source/WebCore/platform/chromium/LinkHashChromium.cpp b/Source/WebCore/platform/chromium/LinkHashChromium.cpp index b051bf4ba..3dc07abf2 100644 --- a/Source/WebCore/platform/chromium/LinkHashChromium.cpp +++ b/Source/WebCore/platform/chromium/LinkHashChromium.cpp @@ -51,6 +51,11 @@ LinkHash visitedLinkHash(const UChar* url, unsigned length) return WebKit::Platform::current()->visitedLinkHash(buffer.data(), buffer.length()); } +LinkHash visitedLinkHash(const String& url) +{ + return (url.characters(), url.length()); +} + LinkHash visitedLinkHash(const KURL& base, const AtomicString& attributeURL) { // Resolve the relative URL using googleurl and pass the absolute URL up to diff --git a/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp b/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp index 36cce7439..96bad7b1e 100644 --- a/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp +++ b/Source/WebCore/platform/chromium/support/WebMediaStreamDescriptor.cpp @@ -125,20 +125,6 @@ WebMediaStreamDescriptor::operator WebCore::MediaStreamDescriptor*() const return m_private.get(); } -// FIXME: Cleanup when the chromium code has switched to the split sources implementation. -void WebMediaStreamDescriptor::initialize(const WebString& label, const WebVector<WebMediaStreamSource>& sources) -{ - MediaStreamSourceVector audio, video; - for (size_t i = 0; i < sources.size(); ++i) { - MediaStreamSource* curr = sources[i]; - if (curr->type() == MediaStreamSource::TypeAudio) - audio.append(curr); - else if (curr->type() == MediaStreamSource::TypeVideo) - video.append(curr); - } - m_private = MediaStreamDescriptor::create(label, audio, video); -} - void WebMediaStreamDescriptor::initialize(const WebString& label, const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources) { MediaStreamSourceVector audio, video; diff --git a/Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp b/Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp index 8e11209b4..8e11209b4 100755..100644 --- a/Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp +++ b/Source/WebCore/platform/chromium/support/WebThreadSafeData.cpp diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp index 22ffac004..9a034bd91 100644 --- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp +++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp @@ -95,21 +95,32 @@ static bool getSymbolInfo(ShHandle compiler, ShShaderInfo symbolType, Vector<ANG // is a subset of Latin-1 as specified by the OpenGL ES Shading Language, Section 3.1 and // WebGL, Section "Characters Outside the GLSL Source Character Set". - // If the variable is an array, add symbols for each array element - if (symbol.size > 1) { + String name = String(nameBuffer.data()); + String mappedName = String(mappedNameBuffer.data()); + + // ANGLE returns array names in the format "array[0]". + // The only way to know if a symbol is an array is to check if it ends with "[0]". + // We can't check the size because regular symbols and arrays of length 1 both have a size of 1. + symbol.isArray = name.endsWith("[0]") && mappedName.endsWith("[0]"); + if (symbol.isArray) { + // Add a symbol for the array name without the "[0]" suffix. + name.truncate(name.length() - 3); + mappedName.truncate(mappedName.length() - 3); + } + + symbol.name = name; + symbol.mappedName = mappedName; + symbols.append(symbol); + + if (symbol.isArray) { + // Add symbols for each array element. + symbol.isArray = false; for (int i = 0; i < symbol.size; i++) { - String name = nameBuffer.data(); - String mappedName = mappedNameBuffer.data(); - name.replace(name.length() - 2, 1, String::number(i)); - mappedName.replace(mappedName.length() - 2, 1, String::number(i)); - symbol.name = name; - symbol.mappedName = mappedName; + String arrayBrackets = "[" + String::number(i) + "]"; + symbol.name = name + arrayBrackets; + symbol.mappedName = mappedName + arrayBrackets; symbols.append(symbol); } - } else { - symbol.name = String(nameBuffer.data()); - symbol.mappedName = String(mappedNameBuffer.data()); - symbols.append(symbol); } } return true; @@ -173,6 +184,12 @@ bool ANGLEWebKitBridge::compileShaderSource(const char* shaderSource, ANGLEShade const char* const shaderSourceStrings[] = { shaderSource }; +#if !PLATFORM(CHROMIUM) + // Chromium does not use the ANGLE bundled in WebKit source, and thus + // does not yet have the symbol SH_CLAMP_INDIRECT_ARRAY_BOUNDS. + extraCompileOptions |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS; +#endif + bool validateSuccess = ShCompile(compiler, shaderSourceStrings, 1, SH_OBJECT_CODE | SH_ATTRIBUTES_UNIFORMS | extraCompileOptions); if (!validateSuccess) { int logSize = getValidationResultValue(compiler, SH_INFO_LOG_LENGTH); diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h index 178d3bddc..52f71dd3f 100644 --- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h +++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h @@ -53,8 +53,9 @@ struct ANGLEShaderSymbol { String mappedName; ShDataType dataType; int size; + bool isArray; - bool isSampler() + bool isSampler() const { return symbolType == SHADER_SYMBOL_TYPE_UNIFORM && (dataType == SH_SAMPLER_2D diff --git a/Source/WebCore/platform/graphics/Extensions3D.h b/Source/WebCore/platform/graphics/Extensions3D.h index 48b26ce12..2f4c12c03 100644 --- a/Source/WebCore/platform/graphics/Extensions3D.h +++ b/Source/WebCore/platform/graphics/Extensions3D.h @@ -56,6 +56,7 @@ public: // GL_OES_standard_derivatives // GL_OES_rgb8_rgba8 // GL_OES_vertex_array_object + // GL_OES_element_index_uint // GL_ANGLE_translated_shader_source // GL_ARB_texture_rectangle (only the subset required to // implement IOSurface binding; it's recommended to support diff --git a/Source/WebCore/platform/graphics/FloatRect.cpp b/Source/WebCore/platform/graphics/FloatRect.cpp index f31c6ccdf..7ced95afd 100644 --- a/Source/WebCore/platform/graphics/FloatRect.cpp +++ b/Source/WebCore/platform/graphics/FloatRect.cpp @@ -134,6 +134,16 @@ void FloatRect::uniteIfNonZero(const FloatRect& other) uniteEvenIfEmpty(other); } +void FloatRect::extend(const FloatPoint& p) +{ + float minX = min(x(), p.x()); + float minY = min(y(), p.y()); + float maxX = max(this->maxX(), p.x()); + float maxY = max(this->maxY(), p.y()); + + setLocationAndSizeFromEdges(minX, minY, maxX, maxY); +} + void FloatRect::scale(float sx, float sy) { m_location.setX(x() * sx); diff --git a/Source/WebCore/platform/graphics/FloatRect.h b/Source/WebCore/platform/graphics/FloatRect.h index 161e2780f..9e09ac922 100644 --- a/Source/WebCore/platform/graphics/FloatRect.h +++ b/Source/WebCore/platform/graphics/FloatRect.h @@ -164,6 +164,7 @@ public: void unite(const FloatRect&); void uniteEvenIfEmpty(const FloatRect&); void uniteIfNonZero(const FloatRect&); + void extend(const FloatPoint&); // Note, this doesn't match what IntRect::contains(IntPoint&) does; the int version // is really checking for containment of 1x1 rect, but that doesn't make sense with floats. diff --git a/Source/WebCore/platform/graphics/ImageSource.cpp b/Source/WebCore/platform/graphics/ImageSource.cpp index 82dfde1c9..abfa5988b 100644 --- a/Source/WebCore/platform/graphics/ImageSource.cpp +++ b/Source/WebCore/platform/graphics/ImageSource.cpp @@ -35,6 +35,10 @@ #include "NotImplemented.h" #include "PlatformMemoryInstrumentation.h" +#if PLATFORM(CHROMIUM) +#include "DeferredImageDecoder.h" +#endif + namespace WebCore { #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) @@ -79,7 +83,7 @@ void ImageSource::setData(SharedBuffer* data, bool allDataReceived) // If insufficient bytes are available to determine the image type, no decoder plugin will be // made. if (!m_decoder) { - m_decoder = static_cast<NativeImageSourcePtr>(ImageDecoder::create(*data, m_alphaOption, m_gammaAndColorProfileOption)); + m_decoder = static_cast<NativeImageDecoderPtr>(NativeImageDecoder::create(*data, m_alphaOption, m_gammaAndColorProfileOption)); #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) if (m_decoder && s_maxPixelsPerDecodedImage) m_decoder->setMaxNumPixels(s_maxPixelsPerDecodedImage); diff --git a/Source/WebCore/platform/graphics/ImageSource.h b/Source/WebCore/platform/graphics/ImageSource.h index 0d8a01e26..66a8a0a51 100644 --- a/Source/WebCore/platform/graphics/ImageSource.h +++ b/Source/WebCore/platform/graphics/ImageSource.h @@ -47,10 +47,20 @@ class IntSize; class SharedBuffer; #if USE(CG) -typedef CGImageSourceRef NativeImageSourcePtr; -#else +typedef CGImageSourceRef NativeImageDecoderPtr; +#elif !PLATFORM(CHROMIUM) class ImageDecoder; -typedef ImageDecoder* NativeImageSourcePtr; +typedef ImageDecoder* NativeImageDecoderPtr; +#endif + +#if PLATFORM(CHROMIUM) +class DeferredImageDecoder; +typedef DeferredImageDecoder NativeImageDecoder; +typedef DeferredImageDecoder* NativeImageDecoderPtr; +#elif USE(CG) +#define NativeImageDecoder ImageDecoder +#else +typedef ImageDecoder NativeImageDecoder; #endif // Right now GIFs are the only recognized image format that supports animation. @@ -158,7 +168,7 @@ public: void reportMemoryUsage(MemoryObjectInfo*) const; private: - NativeImageSourcePtr m_decoder; + NativeImageDecoderPtr m_decoder; #if !USE(CG) AlphaOption m_alphaOption; diff --git a/Source/WebCore/platform/graphics/TiledBacking.h b/Source/WebCore/platform/graphics/TiledBacking.h index 1c74f09a2..4108f122b 100644 --- a/Source/WebCore/platform/graphics/TiledBacking.h +++ b/Source/WebCore/platform/graphics/TiledBacking.h @@ -34,7 +34,9 @@ class TiledBacking { public: virtual ~TiledBacking() { } - virtual void visibleRectChanged(const IntRect&) = 0; + virtual void setVisibleRect(const IntRect&) = 0; + virtual IntRect visibleRect() const = 0; + virtual void setIsInWindow(bool) = 0; enum { diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp index d3df7fe0f..a74bb1cd0 100644 --- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp +++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp @@ -38,6 +38,7 @@ #include "ScaleTransformOperation.h" #include "SystemTime.h" #include "TextStream.h" +#include "TiledBacking.h" #include "TransformState.h" #include "TranslateTransformOperation.h" #include <QuartzCore/CATransform3D.h> @@ -905,7 +906,7 @@ void GraphicsLayerCA::flushCompositingStateForThisLayerOnly() { float pageScaleFactor; FloatPoint offset = computePositionRelativeToBase(pageScaleFactor); - commitLayerChangesBeforeSublayers(pageScaleFactor, offset); + commitLayerChangesBeforeSublayers(pageScaleFactor, offset, m_visibleRect); commitLayerChangesAfterSublayers(); } @@ -914,7 +915,7 @@ TiledBacking* GraphicsLayerCA::tiledBacking() return m_layer->tiledBacking(); } -void GraphicsLayerCA::computeVisibleRect(TransformState& state) +FloatRect GraphicsLayerCA::computeVisibleRect(TransformState& state) const { bool preserve3D = preserves3D() || (parent() ? parent()->preserves3D() : false); TransformState::TransformAccumulation accumulation = preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform; @@ -954,13 +955,19 @@ void GraphicsLayerCA::computeVisibleRect(TransformState& state) state.setQuad(clipRectForSelf); } - m_visibleRect = clipRectForSelf; + return clipRectForSelf; } void GraphicsLayerCA::recursiveCommitChanges(const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale) { TransformState localState = state; - computeVisibleRect(localState); + + FloatRect visibleRect = computeVisibleRect(localState); + FloatRect oldVisibleRect = m_visibleRect; + if (visibleRect != m_visibleRect) { + m_uncommittedChanges |= VisibleRectChanged; + m_visibleRect = visibleRect; + } #ifdef VISIBLE_TILE_WASH // Use having a transform as a key to making the tile wash layer. If every layer gets a wash, @@ -995,10 +1002,12 @@ void GraphicsLayerCA::recursiveCommitChanges(const TransformState& state, float if (affectedByPageScale) baseRelativePosition += m_position; - commitLayerChangesBeforeSublayers(pageScaleFactor, baseRelativePosition); + commitLayerChangesBeforeSublayers(pageScaleFactor, baseRelativePosition, oldVisibleRect); - if (m_maskLayer) - static_cast<GraphicsLayerCA*>(m_maskLayer)->commitLayerChangesBeforeSublayers(pageScaleFactor, baseRelativePosition); + if (m_maskLayer) { + GraphicsLayerCA* maskLayerCA = static_cast<GraphicsLayerCA*>(m_maskLayer); + maskLayerCA->commitLayerChangesBeforeSublayers(pageScaleFactor, baseRelativePosition, maskLayerCA->visibleRect()); + } const Vector<GraphicsLayer*>& childLayers = children(); size_t numChildren = childLayers.size(); @@ -1055,7 +1064,7 @@ float GraphicsLayerCA::platformCALayerDeviceScaleFactor() return deviceScaleFactor(); } -void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase) +void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect) { if (!m_uncommittedChanges) return; @@ -1064,6 +1073,12 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c if (m_uncommittedChanges & (Preserves3DChanged | ReplicatedLayerChanged)) updateStructuralLayer(pageScaleFactor, positionRelativeToBase); + if (m_uncommittedChanges & GeometryChanged) + updateGeometry(pageScaleFactor, positionRelativeToBase); + + if (m_uncommittedChanges & DrawsContentChanged) + updateLayerDrawsContent(pageScaleFactor, positionRelativeToBase); + if (m_uncommittedChanges & NameChanged) updateLayerNames(); @@ -1079,12 +1094,6 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c if (m_uncommittedChanges & BackgroundColorChanged) // Needs to happen before ChildrenChanged, and after updating image or video updateLayerBackgroundColor(); - if (m_uncommittedChanges & ChildrenChanged) - updateSublayerList(); - - if (m_uncommittedChanges & GeometryChanged) - updateGeometry(pageScaleFactor, positionRelativeToBase); - if (m_uncommittedChanges & TransformChanged) updateTransform(); @@ -1094,9 +1103,6 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c if (m_uncommittedChanges & MasksToBoundsChanged) updateMasksToBounds(); - if (m_uncommittedChanges & DrawsContentChanged) - updateLayerDrawsContent(pageScaleFactor, positionRelativeToBase); - if (m_uncommittedChanges & ContentsVisibilityChanged) updateContentsVisibility(); @@ -1122,6 +1128,9 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c if (m_uncommittedChanges & ContentsScaleChanged) updateContentsScale(pageScaleFactor, positionRelativeToBase); + if (m_uncommittedChanges & VisibleRectChanged) + updateVisibleRect(oldVisibleRect); + if (m_uncommittedChanges & DirtyRectsChanged) repaintLayerDirtyRects(); @@ -1136,6 +1145,12 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(float pageScaleFactor, c if (m_uncommittedChanges & AcceleratesDrawingChanged) updateAcceleratesDrawing(); + + if (m_uncommittedChanges & ChildrenChanged) { + updateSublayerList(); + // Sublayers may set this flag again, so clear it to avoid always updating sublayers in commitLayerChangesAfterSublayers(). + m_uncommittedChanges &= ~ChildrenChanged; + } } void GraphicsLayerCA::commitLayerChangesAfterSublayers() @@ -1143,6 +1158,9 @@ void GraphicsLayerCA::commitLayerChangesAfterSublayers() if (!m_uncommittedChanges) return; + if (m_uncommittedChanges & ChildrenChanged) + updateSublayerList(); + if (m_uncommittedChanges & ReplicatedLayerChanged) updateReplicatedLayers(); @@ -1402,8 +1420,19 @@ void GraphicsLayerCA::updateStructuralLayer(float pageScaleFactor, const FloatPo ensureStructuralLayer(structuralLayerPurpose(), pageScaleFactor, positionRelativeToBase); } -void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, float pageScaleFactor, const FloatPoint& positionRelativeToBase) +void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, float /*pageScaleFactor*/, const FloatPoint& /*positionRelativeToBase*/) { + const LayerChangeFlags structuralLayerChangeFlags = NameChanged + | GeometryChanged + | TransformChanged + | ChildrenTransformChanged + | ChildrenChanged + | BackfaceVisibilityChanged +#if ENABLE(CSS_FILTERS) + | FiltersChanged +#endif + | OpacityChanged; + if (purpose == NoStructuralLayer) { if (m_structuralLayer) { // Replace the transformLayer in the parent with this layer. @@ -1419,17 +1448,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, floa // Release the structural layer. m_structuralLayer = 0; - // Update the properties of m_layer now that we no longer have a structural layer. - updateGeometry(pageScaleFactor, positionRelativeToBase); - updateTransform(); - updateChildrenTransform(); - -#if ENABLE(CSS_FILTERS) - updateFilters(); -#endif - - updateSublayerList(); - updateOpacityOnLayer(); + m_uncommittedChanges |= structuralLayerChangeFlags; } return; } @@ -1457,19 +1476,12 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, floa if (!structuralLayerChanged) return; - updateLayerNames(); + m_uncommittedChanges |= structuralLayerChangeFlags; + + // We've changed the layer that our parent added to its sublayer list, so tell it to update + // sublayers again in its commitLayerChangesAfterSublayers(). + static_cast<GraphicsLayerCA*>(parent())->noteSublayersChanged(); - // Update the properties of the structural layer. - updateGeometry(pageScaleFactor, positionRelativeToBase); - updateTransform(); - updateChildrenTransform(); - updateBackfaceVisibility(); -#if ENABLE(CSS_FILTERS) - // Filters cause flattening, so we should never have a layer for preserve-3d. - if (purpose != StructuralLayerForPreserves3D) - updateFilters(); -#endif - // Set properties of m_layer to their default values, since these are expressed on on the structural layer. FloatPoint point(m_size.width() / 2.0f, m_size.height() / 2.0f); FloatPoint3D anchorPoint(0.5f, 0.5f, 0); @@ -1488,17 +1500,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose, floa } } - // Move this layer to be a child of the transform layer. - // If m_layer doesn't have a parent, it means it's the root layer and - // is likely hosted by something that is not expecting to be changed - ASSERT(m_layer->superlayer()); - m_layer->superlayer()->replaceSublayer(m_layer.get(), m_structuralLayer.get()); - m_structuralLayer->appendSublayer(m_layer.get()); - moveOrCopyAnimations(Move, m_layer.get(), m_structuralLayer.get()); - - updateSublayerList(); - updateOpacityOnLayer(); } GraphicsLayerCA::StructuralLayerPurpose GraphicsLayerCA::structuralLayerPurpose() const @@ -1535,7 +1537,78 @@ void GraphicsLayerCA::updateAcceleratesDrawing() { m_layer->setAcceleratesDrawing(m_acceleratesDrawing); } + +FloatRect GraphicsLayerCA::adjustTiledLayerVisibleRect(TiledBacking* tiledBacking, const FloatRect& oldVisibleRect, const FloatSize& oldSize) const +{ + // If the old visible rect is empty, we have no information about how the visible area is changing + // (maybe the layer was just created), so don't attempt to expand. Also don't attempt to expand + // if the size changed. + if (oldVisibleRect.isEmpty() || m_size != oldSize) + return m_visibleRect; + + const float paddingMultiplier = 2; + + float leftEdgeDelta = paddingMultiplier * (m_visibleRect.x() - oldVisibleRect.x()); + float rightEdgeDelta = paddingMultiplier * (m_visibleRect.maxX() - oldVisibleRect.maxX()); + + float topEdgeDelta = paddingMultiplier * (m_visibleRect.y() - oldVisibleRect.y()); + float bottomEdgeDelta = paddingMultiplier * (m_visibleRect.maxY() - oldVisibleRect.maxY()); + FloatRect existingTileBackingRect = tiledBacking->visibleRect(); + FloatRect expandedRect = m_visibleRect; + + // More exposed on left side. + if (leftEdgeDelta < 0) { + float newLeft = expandedRect.x() + leftEdgeDelta; + // Pad to the left, but don't reduce padding that's already in the backing store (since we're still exposing to the left). + if (newLeft < existingTileBackingRect.x()) + expandedRect.shiftXEdgeTo(newLeft); + else + expandedRect.shiftXEdgeTo(existingTileBackingRect.x()); + } + + // More exposed on right. + if (rightEdgeDelta > 0) { + float newRight = expandedRect.maxX() + rightEdgeDelta; + // Pad to the right, but don't reduce padding that's already in the backing store (since we're still exposing to the right). + if (newRight > existingTileBackingRect.maxX()) + expandedRect.setWidth(newRight - expandedRect.x()); + else + expandedRect.setWidth(existingTileBackingRect.maxX() - expandedRect.x()); + } + + // More exposed at top. + if (topEdgeDelta < 0) { + float newTop = expandedRect.y() + topEdgeDelta; + if (newTop < existingTileBackingRect.y()) + expandedRect.shiftYEdgeTo(newTop); + else + expandedRect.shiftYEdgeTo(existingTileBackingRect.y()); + } + + // More exposed on bottom. + if (bottomEdgeDelta > 0) { + float newBottom = expandedRect.maxY() + bottomEdgeDelta; + if (newBottom > existingTileBackingRect.maxY()) + expandedRect.setHeight(newBottom - expandedRect.y()); + else + expandedRect.setHeight(existingTileBackingRect.maxY() - expandedRect.y()); + } + + return expandedRect; +} + +void GraphicsLayerCA::updateVisibleRect(const FloatRect& oldVisibleRect) +{ + if (m_layer->layerType() != PlatformCALayer::LayerTypeTileCacheLayer) + return; + + FloatRect tileArea = adjustTiledLayerVisibleRect(tiledBacking(), oldVisibleRect, m_sizeAtLastVisibleRectUpdate); + tiledBacking()->setVisibleRect(enclosingIntRect(tileArea)); + + m_sizeAtLastVisibleRectUpdate = m_size; +} + void GraphicsLayerCA::updateLayerBackgroundColor() { if (m_isPageTileCacheLayer) { @@ -2495,13 +2568,13 @@ bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const return m_size.width() * pageScaleFactor > cMaxPixelDimension || m_size.height() * pageScaleFactor > cMaxPixelDimension; } -void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float pageScaleFactor, const FloatPoint& positionRelativeToBase) +void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float /*pageScaleFactor*/, const FloatPoint& /*positionRelativeToBase*/) { ASSERT(m_layer->layerType() != PlatformCALayer::LayerTypePageTileCacheLayer); ASSERT(useTiledLayer != m_usingTiledLayer); RefPtr<PlatformCALayer> oldLayer = m_layer; - m_layer = PlatformCALayer::create(useTiledLayer ? PlatformCALayer::LayerTypeWebTiledLayer : PlatformCALayer::LayerTypeWebLayer, this); + m_layer = PlatformCALayer::create(useTiledLayer ? PlatformCALayer::LayerTypeTileCacheLayer : PlatformCALayer::LayerTypeWebLayer, this); m_usingTiledLayer = useTiledLayer; m_layer->adoptSublayers(oldLayer.get()); @@ -2517,19 +2590,20 @@ void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float pageScale if (oldLayer->superlayer()) oldLayer->superlayer()->replaceSublayer(oldLayer.get(), m_layer.get()); - updateGeometry(pageScaleFactor, positionRelativeToBase); - updateTransform(); - updateChildrenTransform(); - updateMasksToBounds(); + m_uncommittedChanges |= ChildrenChanged + | GeometryChanged + | TransformChanged + | ChildrenTransformChanged + | MasksToBoundsChanged + | ContentsOpaqueChanged + | BackfaceVisibilityChanged + | BackgroundColorChanged + | ContentsScaleChanged + | AcceleratesDrawingChanged #if ENABLE(CSS_FILTERS) - updateFilters(); + | FiltersChanged #endif - updateContentsOpaque(); - updateBackfaceVisibility(); - updateLayerBackgroundColor(); - updateContentsScale(pageScaleFactor, positionRelativeToBase); - updateAcceleratesDrawing(); - updateOpacityOnLayer(); + | OpacityChanged; #ifndef NDEBUG String name = String::format("%sCALayer(%p) GraphicsLayer(%p) ", (m_layer->layerType() == PlatformCALayer::LayerTypeWebTiledLayer) ? "Tiled " : "", m_layer->platformLayer(), this) + m_name; diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h index b8da5776a..c6b210e5b 100644 --- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h +++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h @@ -211,7 +211,7 @@ private: return m_runningAnimations.find(animationName) != m_runningAnimations.end(); } - void commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase); + void commitLayerChangesBeforeSublayers(float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect); void commitLayerChangesAfterSublayers(); FloatPoint computePositionRelativeToBase(float& pageScale) const; @@ -233,7 +233,10 @@ private: void computePixelAlignment(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase, FloatPoint& position, FloatSize&, FloatPoint3D& anchorPoint, FloatSize& alignmentOffset) const; - void computeVisibleRect(TransformState&); + FloatRect computeVisibleRect(TransformState&) const; + const FloatRect& visibleRect() const { return m_visibleRect; } + + FloatRect adjustTiledLayerVisibleRect(TiledBacking*, const FloatRect& oldVisibleRect, const FloatSize& oldSize) const; // Used to track the path down the tree for replica layers. struct ReplicaState { @@ -323,6 +326,7 @@ private: void updateLayerAnimations(); void updateContentsNeedsDisplay(); void updateAcceleratesDrawing(); + void updateVisibleRect(const FloatRect& oldVisibleRect); void updateContentsScale(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase); enum StructuralLayerPurpose { @@ -372,8 +376,9 @@ private: AcceleratesDrawingChanged = 1 << 22, ContentsScaleChanged = 1 << 23, ContentsVisibilityChanged = 1 << 24, + VisibleRectChanged = 1 << 25, #if ENABLE(CSS_FILTERS) - FiltersChanged = 1 << 25, + FiltersChanged = 1 << 26, #endif }; typedef unsigned LayerChangeFlags; @@ -396,6 +401,7 @@ private: RefPtr<PlatformCALayer> m_visibleTileWashLayer; #endif FloatRect m_visibleRect; + FloatSize m_sizeAtLastVisibleRectUpdate; enum ContentsLayerPurpose { NoContentsLayer = 0, diff --git a/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm b/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm index 915a60be6..1659c4dca 100644 --- a/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm +++ b/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm @@ -330,6 +330,7 @@ void PlatformCALayer::removeAllSublayers() void PlatformCALayer::appendSublayer(PlatformCALayer* layer) { BEGIN_BLOCK_OBJC_EXCEPTIONS + ASSERT(m_layer != layer->m_layer); [m_layer.get() addSublayer:layer->m_layer.get()]; END_BLOCK_OBJC_EXCEPTIONS } @@ -337,6 +338,7 @@ void PlatformCALayer::appendSublayer(PlatformCALayer* layer) void PlatformCALayer::insertSublayer(PlatformCALayer* layer, size_t index) { BEGIN_BLOCK_OBJC_EXCEPTIONS + ASSERT(m_layer != layer->m_layer); [m_layer.get() insertSublayer:layer->m_layer.get() atIndex:index]; END_BLOCK_OBJC_EXCEPTIONS } @@ -344,6 +346,7 @@ void PlatformCALayer::insertSublayer(PlatformCALayer* layer, size_t index) void PlatformCALayer::replaceSublayer(PlatformCALayer* reference, PlatformCALayer* layer) { BEGIN_BLOCK_OBJC_EXCEPTIONS + ASSERT(m_layer != layer->m_layer); [m_layer.get() replaceSublayer:reference->m_layer.get() with:layer->m_layer.get()]; END_BLOCK_OBJC_EXCEPTIONS } diff --git a/Source/WebCore/platform/graphics/ca/mac/TileCache.h b/Source/WebCore/platform/graphics/ca/mac/TileCache.h index 76387e8aa..17e98ee3c 100644 --- a/Source/WebCore/platform/graphics/ca/mac/TileCache.h +++ b/Source/WebCore/platform/graphics/ca/mac/TileCache.h @@ -73,7 +73,7 @@ public: void setTileDebugBorderWidth(float); void setTileDebugBorderColor(CGColorRef); - IntRect visibleRect() const { return m_visibleRect; } + virtual IntRect visibleRect() const OVERRIDE { return m_visibleRect; } unsigned blankPixelCount() const; static unsigned blankPixelCountForTiles(const WebTileLayerList&, IntRect, IntPoint); @@ -82,7 +82,7 @@ private: TileCache(WebTileCacheLayer*, const IntSize& tileSize); // TiledBacking member functions. - virtual void visibleRectChanged(const IntRect&) OVERRIDE; + virtual void setVisibleRect(const IntRect&) OVERRIDE; virtual void setIsInWindow(bool) OVERRIDE; virtual void setTileCoverage(TileCoverage) OVERRIDE; virtual TileCoverage tileCoverage() const OVERRIDE { return m_tileCoverage; } diff --git a/Source/WebCore/platform/graphics/ca/mac/TileCache.mm b/Source/WebCore/platform/graphics/ca/mac/TileCache.mm index b12b14d11..619244da9 100644 --- a/Source/WebCore/platform/graphics/ca/mac/TileCache.mm +++ b/Source/WebCore/platform/graphics/ca/mac/TileCache.mm @@ -220,7 +220,7 @@ void TileCache::setTilesOpaque(bool opaque) } } -void TileCache::visibleRectChanged(const IntRect& visibleRect) +void TileCache::setVisibleRect(const IntRect& visibleRect) { if (m_visibleRect == visibleRect) return; @@ -315,10 +315,10 @@ IntRect TileCache::tileCoverageRect() const // Inflate the coverage rect so that it covers 2x of the visible width and 3x of the visible height. // These values were chosen because it's more common to have tall pages and to scroll vertically, // so we keep more tiles above and below the current area. - if (m_tileCoverage && CoverageForHorizontalScrolling) + if (m_tileCoverage & CoverageForHorizontalScrolling) tileCoverageRect.inflateX(tileCoverageRect.width() / 2); - if (m_tileCoverage && CoverageForVerticalScrolling) + if (m_tileCoverage & CoverageForVerticalScrolling) tileCoverageRect.inflateY(tileCoverageRect.height()); } diff --git a/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp b/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp new file mode 100644 index 000000000..7574196e7 --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp @@ -0,0 +1,154 @@ +/* + * 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 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" +#include "DeferredImageDecoder.h" + +#include "ImageDecodingStore.h" +#include <wtf/PassOwnPtr.h> + +namespace WebCore { + +DeferredImageDecoder::DeferredImageDecoder(ImageDecoder* actualDecoder) + : m_allDataReceived(false) + , m_actualDecoder(adoptPtr(actualDecoder)) +{ +} + +DeferredImageDecoder::~DeferredImageDecoder() +{ + // FIXME: Remove the corresponding entry in ImageDecodingStore if image + // is defer-decoded. +} + +DeferredImageDecoder* DeferredImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorOption) +{ + ImageDecoder* actualDecoder = ImageDecoder::create(data, alphaOption, gammaAndColorOption); + return actualDecoder ? new DeferredImageDecoder(actualDecoder) : 0; +} + +PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(PassOwnPtr<ImageDecoder> decoder) +{ + return adoptPtr(new DeferredImageDecoder(decoder.leakPtr())); +} + +String DeferredImageDecoder::filenameExtension() const +{ + return m_actualDecoder ? m_actualDecoder->filenameExtension() : m_filenameExtension; +} + +ImageFrame* DeferredImageDecoder::frameBufferAtIndex(size_t index) +{ + // Only defer image decoding if this is a single frame image. The reason is + // because a multiframe is usually animated GIF. Animation is handled by + // BitmapImage which uses some metadata functions that do synchronous image + // decoding. + if (ImageDecodingStore::instanceOnMainThread() + && m_actualDecoder + && m_actualDecoder->repetitionCount() == cAnimationNone + && m_actualDecoder->isSizeAvailable()) { + + m_size = m_actualDecoder->size(); + m_filenameExtension = m_actualDecoder->filenameExtension(); + + SkBitmap lazyDecodedSkBitmap = ImageDecodingStore::instanceOnMainThread()->createLazyDecodedSkBitmap(m_actualDecoder.release()); + m_lazyDecodedFrame.setSkBitmap(lazyDecodedSkBitmap); + ImageDecodingStore::instanceOnMainThread()->setData(m_lazyDecodedFrame.getSkBitmap(), m_data.release(), m_allDataReceived); + + // Don't mark the frame as completely decoded until the underlying + // decoder has really decoded it. Until then, our data and metadata may + // be incorrect, so callers can't rely on them. + m_lazyDecodedFrame.setStatus(ImageFrame::FramePartial); + } + + return m_actualDecoder ? m_actualDecoder->frameBufferAtIndex(index) : &m_lazyDecodedFrame; +} + +void DeferredImageDecoder::setData(SharedBuffer* data, bool allDataReceived) +{ + if (m_actualDecoder) { + // Keep a reference to data until image decoding is deferred. + // When image decoding is deferred then ownership of m_data is + // transferred to ImageDecodingStore. + m_data = data; + m_allDataReceived = allDataReceived; + m_actualDecoder->setData(data, allDataReceived); + } else { + ASSERT(!m_data); + ImageDecodingStore::instanceOnMainThread()->setData(m_lazyDecodedFrame.getSkBitmap(), data, allDataReceived); + } +} + +bool DeferredImageDecoder::isSizeAvailable() +{ + // m_actualDecoder is 0 only if image decoding is deferred and that + // means image header decoded successfully and size is available. + return m_actualDecoder ? m_actualDecoder->isSizeAvailable() : true; +} + +IntSize DeferredImageDecoder::size() const +{ + return m_actualDecoder ? m_actualDecoder->size() : m_size; +} + +IntSize DeferredImageDecoder::frameSizeAtIndex(size_t index) const +{ + return m_actualDecoder ? m_actualDecoder->frameSizeAtIndex(index) : m_size; +} + +size_t DeferredImageDecoder::frameCount() +{ + return m_actualDecoder ? m_actualDecoder->frameCount() : 1; +} + +int DeferredImageDecoder::repetitionCount() const +{ + return m_actualDecoder ? m_actualDecoder->repetitionCount() : cAnimationNone; +} + +void DeferredImageDecoder::clearFrameBufferCache(size_t clearBeforeFrame) +{ + // If image decoding is deferred then frame buffer cache is managed by + // the compositor and this call is ignored. + if (m_actualDecoder) + m_actualDecoder->clearFrameBufferCache(clearBeforeFrame); +} + +bool DeferredImageDecoder::frameHasAlphaAtIndex(size_t index) const +{ + // FIXME: Synchronize this state with ImageDecodingStore when image is + // actually decoded. Return true here is correct in terms of rendering but + // may not go through some optimized rendering code path. + return m_actualDecoder ? m_actualDecoder->frameHasAlphaAtIndex(index) : true; +} + +unsigned DeferredImageDecoder::frameBytesAtIndex(size_t index) const +{ + // If frame decoding is deferred then it is not managed by MemoryCache + // so return 0 here. + return m_actualDecoder ? m_actualDecoder->frameBytesAtIndex(index) : 0; +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.h b/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.h new file mode 100644 index 000000000..6b33fe35e --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.h @@ -0,0 +1,75 @@ +/* + * 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 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 DeferredImageDecoder_h +#define DeferredImageDecoder_h + +#include "ImageDecoder.h" +#include "ImageSource.h" +#include "IntSize.h" +#include "SkBitmap.h" + +namespace WebCore { + +class SharedBuffer; + +class DeferredImageDecoder { +public: + ~DeferredImageDecoder(); + static DeferredImageDecoder* create(const SharedBuffer& data, ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption); + + static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDecoder>); + + String filenameExtension() const; + + ImageFrame* frameBufferAtIndex(size_t index); + + void setData(SharedBuffer* data, bool allDataReceived); + + bool isSizeAvailable(); + IntSize size() const; + IntSize frameSizeAtIndex(size_t index) const; + size_t frameCount(); + int repetitionCount() const; + void clearFrameBufferCache(size_t); + bool frameHasAlphaAtIndex(size_t index) const; + unsigned frameBytesAtIndex(size_t index) const; + +private: + explicit DeferredImageDecoder(ImageDecoder* actualDecoder); + + RefPtr<SharedBuffer> m_data; + bool m_allDataReceived; + OwnPtr<ImageDecoder> m_actualDecoder; + + String m_filenameExtension; + IntSize m_size; + + ImageFrame m_lazyDecodedFrame; +}; + +} // namespace WebCore + +#endif diff --git a/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.cpp b/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.cpp new file mode 100644 index 000000000..02790df90 --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.cpp @@ -0,0 +1,225 @@ +/* + * 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 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" +#include "ImageDecodingStore.h" + +#include "ImageDecoder.h" +#include "ImageFrameGenerator.h" +#include "LazyDecodingPixelRef.h" +#include "ScaledImageFragment.h" +#include "SkRect.h" +#include "SkSize.h" + +#include "skia/ext/image_operations.h" + +#include <wtf/MainThread.h> +#include <wtf/PassOwnPtr.h> + +namespace WebCore { + +namespace { + +// URI label for a lazily decoded SkPixelRef. +const char labelLazyDecoded[] = "lazy"; + +ImageDecodingStore* s_instanceOnMainThread = 0; + +static void setInstanceOnMainThread(ImageDecodingStore* imageDecodingStore) +{ + delete s_instanceOnMainThread; + s_instanceOnMainThread = imageDecodingStore; +} +} // namespace + +ImageDecodingStore::ImageDecodingStore() +{ +} + +ImageDecodingStore::~ImageDecodingStore() +{ +} + +ImageDecodingStore* ImageDecodingStore::instanceOnMainThread() +{ + ASSERT(isMainThread()); + return s_instanceOnMainThread; +} + +void ImageDecodingStore::initializeOnMainThread() +{ + ASSERT(isMainThread()); + setInstanceOnMainThread(ImageDecodingStore::create().leakPtr()); +} + +void ImageDecodingStore::shutdown() +{ + ASSERT(isMainThread()); + setInstanceOnMainThread(0); +} + +bool ImageDecodingStore::isLazyDecoded(const SkBitmap& bitmap) +{ + return bitmap.pixelRef() + && bitmap.pixelRef()->getURI() + && !memcmp(bitmap.pixelRef()->getURI(), labelLazyDecoded, sizeof(labelLazyDecoded)); +} + +SkBitmap ImageDecodingStore::createLazyDecodedSkBitmap(PassOwnPtr<ImageDecoder> decoder) +{ + ASSERT(calledOnValidThread()); + + SkISize fullSize = SkISize::Make(decoder->size().width(), decoder->size().height()); + ASSERT(!fullSize.isEmpty()); + + SkIRect fullRect = SkIRect::MakeSize(fullSize); + + // Creates a lazily decoded SkPixelRef that references the entire image without scaling. + SkBitmap bitmap; + bitmap.setConfig(SkBitmap::kARGB_8888_Config, fullSize.width(), fullSize.height()); + bitmap.setPixelRef(new LazyDecodingPixelRef(ImageFrameGenerator::create(decoder), fullSize, fullRect))->unref(); + + // Use URI to identify this is a lazily decoded SkPixelRef of type LazyDecodingPixelRef. + // FIXME: Give the actual URI is more useful. + bitmap.pixelRef()->setURI(labelLazyDecoded); + + // Inform the bitmap that we will never change the pixels. This is a performance hint + // subsystems that may try to cache this bitmap (e.g. pictures, pipes, gpu, pdf, etc.) + bitmap.setImmutable(); + + // FIXME: Setting bitmap.setIsOpaque() is big performance gain if possible. We can + // do so safely if the image is fully loaded and it is a JPEG image, or image was + // decoded before. + + return bitmap; +} + +SkBitmap ImageDecodingStore::resizeLazyDecodedSkBitmap(const SkBitmap& bitmap, const SkISize& scaledSize, const SkIRect& scaledSubset) +{ + ASSERT(calledOnValidThread()); + + LazyDecodingPixelRef* pixelRef = static_cast<LazyDecodingPixelRef*>(bitmap.pixelRef()); + ASSERT(!pixelRef->isScaled(pixelRef->frameGenerator()->fullSize()) && !pixelRef->isClipped()); + + int rowBytes = 0; + rowBytes = SkBitmap::ComputeRowBytes(SkBitmap::kARGB_8888_Config, scaledSize.width()); + + SkBitmap resizedBitmap; + resizedBitmap.setConfig(SkBitmap::kARGB_8888_Config, scaledSubset.width(), scaledSubset.height(), rowBytes); + resizedBitmap.setPixelRef(new LazyDecodingPixelRef(pixelRef->frameGenerator(), scaledSize, scaledSubset))->unref(); + + // See comments in createLazyDecodedSkBitmap(). + resizedBitmap.setImmutable(); + return resizedBitmap; +} + +void ImageDecodingStore::setData(const SkBitmap& bitmap, PassRefPtr<SharedBuffer> data, bool allDataReceived) +{ + ASSERT(calledOnValidThread()); + if (isLazyDecoded(bitmap)) + static_cast<LazyDecodingPixelRef*>(bitmap.pixelRef())->frameGenerator()->setData(data, allDataReceived); +} + +void* ImageDecodingStore::lockPixels(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkISize& scaledSize, const SkIRect& scaledSubset) +{ + ASSERT(calledOnValidThread()); + ASSERT(m_lockedSkBitmap.isNull()); + + SkISize fullSize = frameGenerator->fullSize(); + + // The cache only saves the full size image at the moment. + ScaledImageFragment* frameCache = lookupFrameCache(frameGenerator->imageId(), fullSize); + SkBitmap bitmap; + + if (!frameCache) { + // FIXME: Pixels are owned by the ImageDecoder in the generator. Find + // a way to transfer ownership to our cache. + ImageFrame* frame = frameGenerator->decoder()->frameBufferAtIndex(0); + + // Saves the frame in cache if this is complete. + if (frame->status() == ImageFrame::FrameComplete) { + m_frameCache.append(ScaledImageFragment::create(frameGenerator->imageId(), fullSize, frame->getSkBitmap(), true)); + } else if (frame->status() == ImageFrame::FrameEmpty) { + // FIXME: If this is a decoding error. Report this to BitmapImage. + return 0; + } + + bitmap = frame->getSkBitmap(); + } else { + ASSERT(frameCache->isComplete()); + bitmap = frameCache->bitmap(); + } + + if (fullSize != scaledSize) { + // Image scaling is done on-the-fly and scaled image is destroyed + // after use. + // FIXME: Resize just the requested fragment. + m_lockedSkBitmap = skia::ImageOperations::Resize(bitmap, skia::ImageOperations::RESIZE_LANCZOS3, scaledSize.width(), scaledSize.height()); + } else + m_lockedSkBitmap = bitmap; + m_lockedSkBitmap.lockPixels(); + return m_lockedSkBitmap.getAddr(scaledSubset.x(), scaledSubset.y()); +} + +void ImageDecodingStore::unlockPixels() +{ + ASSERT(calledOnValidThread()); + + m_lockedSkBitmap.unlockPixels(); + m_lockedSkBitmap.reset(); +} + +void ImageDecodingStore::frameGeneratorBeingDestroyed(ImageFrameGenerator* frameGenerator) +{ + ASSERT(calledOnValidThread()); + + deleteFrameCache(frameGenerator->imageId()); +} + +bool ImageDecodingStore::calledOnValidThread() const +{ + return this == instanceOnMainThread() && isMainThread(); +} + +ScaledImageFragment* ImageDecodingStore::lookupFrameCache(int imageId, const SkISize& scaledSize) const +{ + for (size_t i = 0; i < m_frameCache.size(); ++i) { + if (m_frameCache[i]->isEqual(imageId, scaledSize)) + return m_frameCache[i].get(); + } + return 0; +} + +void ImageDecodingStore::deleteFrameCache(int imageId) +{ + for (size_t i = 0; i < m_frameCache.size(); ++i) { + if (m_frameCache[i]->isEqual(imageId)) { + m_frameCache.remove(i); + return; + } + } +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.h b/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.h new file mode 100644 index 000000000..a6a5d9294 --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/ImageDecodingStore.h @@ -0,0 +1,86 @@ +/* + * 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 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 ImageDecodingStore_h +#define ImageDecodingStore_h + +#include "SkBitmap.h" +#include "SkRect.h" +#include "SkSize.h" + +#include <wtf/HashMap.h> +#include <wtf/HashSet.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> +#include <wtf/RefPtr.h> +#include <wtf/Vector.h> + +namespace WebCore { + +class ImageDecoder; +class ImageFrameGenerator; +class ScaledImageFragment; +class SharedBuffer; + +// This class can only be instantiated on main thread. There will be an +// instance on impl thread in the future but that part of implementation +// is incomplete. See bug: https://bugs.webkit.org/show_bug.cgi?id=94240 +// for details. +class ImageDecodingStore { +public: + static PassOwnPtr<ImageDecodingStore> create() { return adoptPtr(new ImageDecodingStore); } + ~ImageDecodingStore(); + + static ImageDecodingStore* instanceOnMainThread(); + static void initializeOnMainThread(); + static void shutdown(); + static bool isLazyDecoded(const SkBitmap&); + + SkBitmap createLazyDecodedSkBitmap(PassOwnPtr<ImageDecoder>); + SkBitmap resizeLazyDecodedSkBitmap(const SkBitmap&, const SkISize& scaledSize, const SkIRect& scaledSubset); + + void setData(const SkBitmap&, PassRefPtr<SharedBuffer>, bool allDataReceived); + + // You may only lock one set of pixels at a time; overlapping lock calls are not allowed. + void* lockPixels(PassRefPtr<ImageFrameGenerator>, const SkISize& scaledSize, const SkIRect& scaledSubset); + void unlockPixels(); + + void frameGeneratorBeingDestroyed(ImageFrameGenerator*); + +private: + ImageDecodingStore(); + bool calledOnValidThread() const; + void createFrameGenerator(PassOwnPtr<ImageDecoder>); + ScaledImageFragment* lookupFrameCache(int imageId, const SkISize& scaledSize) const; + void deleteFrameCache(int imageId); + + Vector<OwnPtr<ScaledImageFragment> > m_frameCache; + + SkBitmap m_lockedSkBitmap; +}; + +} // namespace WebCore + +#endif diff --git a/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp b/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp new file mode 100644 index 000000000..4c2f29915 --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp @@ -0,0 +1,68 @@ +/* + * 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 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" + +#include "ImageFrameGenerator.h" + +#include "ImageDecoder.h" +#include "ImageDecodingStore.h" +#include "SharedBuffer.h" + +namespace { + +// An unique ID for an image file. +int s_nextImageId = 0; + +} // namespace + +namespace WebCore { + +ImageFrameGenerator::ImageFrameGenerator(PassOwnPtr<ImageDecoder> decoder) + : m_decoder(decoder) +{ + m_fullSize = SkISize::Make(m_decoder->size().width(), m_decoder->size().height()); + m_imageId = s_nextImageId++; +} + +ImageFrameGenerator::~ImageFrameGenerator() +{ + if (ImageDecodingStore::instanceOnMainThread()) + ImageDecodingStore::instanceOnMainThread()->frameGeneratorBeingDestroyed(this); +} + +ImageDecoder* ImageFrameGenerator::decoder() +{ + return m_decoder.get(); +} + +void ImageFrameGenerator::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived) +{ + m_data = data; + if (m_decoder) + m_decoder->setData(m_data.get(), allDataReceived); +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.h b/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.h new file mode 100644 index 000000000..67d326b7a --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.h @@ -0,0 +1,67 @@ +/* + * 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 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 ImageFrameGenerator_h +#define ImageFrameGenerator_h + +#include "SkTypes.h" +#include "SkSize.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> +#include <wtf/RefCounted.h> +#include <wtf/RefPtr.h> + +namespace WebCore { + +class ImageDecoder; +class SharedBuffer; + +class ImageFrameGenerator : public RefCounted<ImageFrameGenerator> { +public: + static PassRefPtr<ImageFrameGenerator> create(PassOwnPtr<ImageDecoder> decoder) + { + return adoptRef(new ImageFrameGenerator(decoder)); + } + + explicit ImageFrameGenerator(PassOwnPtr<ImageDecoder>); + ~ImageFrameGenerator(); + + // Creates the image decoder if needed. + ImageDecoder* decoder(); + void setData(PassRefPtr<SharedBuffer>, bool allDataReceived); + + const SkISize& fullSize() const { return m_fullSize; } + int imageId() const { return m_imageId; } + +private: + OwnPtr<ImageDecoder> m_decoder; + RefPtr<SharedBuffer> m_data; + SkISize m_fullSize; + int m_imageId; +}; + +} // namespace WebCore + +#endif diff --git a/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp b/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp new file mode 100644 index 000000000..56dd091e0 --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.cpp @@ -0,0 +1,75 @@ +/* + * 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 "LazyDecodingPixelRef.h" + +#include "ImageDecoder.h" +#include "ImageDecodingStore.h" +#include "ImageFrameGenerator.h" +#include <wtf/MainThread.h> + +namespace WebCore { + +LazyDecodingPixelRef::LazyDecodingPixelRef(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkISize& scaledSize, const SkIRect& scaledSubset) + : SkPixelRef(0) + , m_frameGenerator(frameGenerator) + , m_scaledSize(scaledSize) + , m_scaledSubset(scaledSubset) +{ +} + +LazyDecodingPixelRef::~LazyDecodingPixelRef() +{ +} + +bool LazyDecodingPixelRef::isScaled(const SkISize& fullSize) const +{ + return fullSize != m_scaledSize; +} + +bool LazyDecodingPixelRef::isClipped() const +{ + return m_scaledSize.width() != m_scaledSubset.width() || m_scaledSize.height() != m_scaledSubset.height(); +} + +void* LazyDecodingPixelRef::onLockPixels(SkColorTable**) +{ + ASSERT(isMainThread()); + return ImageDecodingStore::instanceOnMainThread()->lockPixels(m_frameGenerator, m_scaledSize, m_scaledSubset); +} + +void LazyDecodingPixelRef::onUnlockPixels() +{ + ASSERT(isMainThread()); + ImageDecodingStore::instanceOnMainThread()->unlockPixels(); +} + +bool LazyDecodingPixelRef::onLockPixelsAreWritable() const +{ + return false; +} + +} // namespace WebKit diff --git a/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h b/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h new file mode 100644 index 000000000..0ab9ccc4c --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/LazyDecodingPixelRef.h @@ -0,0 +1,65 @@ +/* + * 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. + */ + +#ifndef LazyDecodingPixelRef_h +#define LazyDecodingPixelRef_h + +#include "SkFlattenableBuffers.h" +#include "SkPixelRef.h" +#include "SkRect.h" +#include "SkSize.h" + +#include <wtf/RefPtr.h> + +namespace WebCore { + +class ImageFrameGenerator; + +class LazyDecodingPixelRef : public SkPixelRef { +public: + LazyDecodingPixelRef(PassRefPtr<ImageFrameGenerator>, const SkISize& scaledSize, const SkIRect& scaledSubset); + virtual ~LazyDecodingPixelRef(); + + SK_DECLARE_UNFLATTENABLE_OBJECT() + + PassRefPtr<ImageFrameGenerator> frameGenerator() const { return m_frameGenerator; } + bool isScaled(const SkISize& fullSize) const; + bool isClipped() const; + +protected: + // SkPixelRef implementation. + virtual void* onLockPixels(SkColorTable**); + virtual void onUnlockPixels(); + virtual bool onLockPixelsAreWritable() const; + +private: + RefPtr<ImageFrameGenerator> m_frameGenerator; + SkISize m_scaledSize; + SkIRect m_scaledSubset; +}; + +} // namespace WebCore + +#endif // LazyDecodingPixelRef_h_ diff --git a/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.cpp b/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.cpp new file mode 100644 index 000000000..974e6ff84 --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.cpp @@ -0,0 +1,54 @@ +/* + * 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 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" + +#include "ScaledImageFragment.h" + +namespace WebCore { + +ScaledImageFragment::~ScaledImageFragment() +{ +} + +ScaledImageFragment::ScaledImageFragment(int imageId, const SkISize& scaledSize, const SkBitmap& bitmap, const bool isComplete) + : m_imageId(imageId) + , m_scaledSize(scaledSize) + , m_bitmap(bitmap) + , m_isComplete(isComplete) +{ +} + +bool ScaledImageFragment::isEqual(int imageId, const SkISize& scaledSize) const +{ + return imageId == m_imageId && scaledSize == m_scaledSize; +} + +bool ScaledImageFragment::isEqual(int imageId) const +{ + return imageId == m_imageId; +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.h b/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.h new file mode 100644 index 000000000..5b7ffc960 --- /dev/null +++ b/Source/WebCore/platform/graphics/chromium/ScaledImageFragment.h @@ -0,0 +1,67 @@ +/* + * 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 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 ScaledImageFragment_h +#define ScaledImageFragment_h + +#include "SkBitmap.h" +#include "SkRect.h" +#include "SkSize.h" + +#include <wtf/PassOwnPtr.h> + +namespace WebCore { + +// ScaledImageFragment is a scaled version of a image. It is identified +// by two things: +// 1. Image ID. The original image that this fragment comes from. +// 2. Scaled image size. +class ScaledImageFragment { +public: + static PassOwnPtr<ScaledImageFragment> create(int imageId, const SkISize& scaledSize, const SkBitmap& bitmap, bool isComplete) + { + return adoptPtr(new ScaledImageFragment(imageId, scaledSize, bitmap, isComplete)); + } + + ScaledImageFragment(int imageId, const SkISize&, const SkBitmap&, bool isComplete); + ~ScaledImageFragment(); + + const SkBitmap& bitmap() const { return m_bitmap; } + SkBitmap& bitmap() { return m_bitmap; } + + bool isEqual(int imageId, const SkISize& scaledSize) const; + bool isEqual(int imageId) const; + bool isComplete() const { return m_isComplete; } + +private: + int m_imageId; + SkISize m_scaledSize; + SkBitmap m_bitmap; + bool m_isComplete; +}; + +} // namespace WebCore + +#endif diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp b/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp index 64f3b702a..65f2d63b8 100644 --- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp +++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp @@ -48,6 +48,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi , m_currentHeight(0) , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT) , m_attrs(attrs) + , m_renderStyle(renderStyle) , m_texture(0) , m_compositorTexture(0) , m_fbo(0) diff --git a/Source/WebCore/platform/graphics/filters/CustomFilterOperation.h b/Source/WebCore/platform/graphics/filters/CustomFilterOperation.h index 788b3f016..0d64d2368 100644 --- a/Source/WebCore/platform/graphics/filters/CustomFilterOperation.h +++ b/Source/WebCore/platform/graphics/filters/CustomFilterOperation.h @@ -69,7 +69,7 @@ public: CustomFilterProgram* program() const { return m_program.get(); } - const CustomFilterParameterList& parameters() { return m_parameters; } + const CustomFilterParameterList& parameters() const { return m_parameters; } unsigned meshRows() const { return m_meshRows; } unsigned meshColumns() const { return m_meshColumns; } diff --git a/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp b/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp index 85ddda5a2..26e8b7e5f 100644 --- a/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp +++ b/Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp @@ -37,12 +37,70 @@ #include "CustomFilterGlobalContext.h" #include "CustomFilterProgramInfo.h" #include "NotImplemented.h" +#include <wtf/HashMap.h> #include <wtf/text/StringBuilder.h> +#include <wtf/text/StringHash.h> namespace WebCore { #define SHADER(Src) (#Src) +// FIXME: Reuse this type when we validate the types of built-in uniforms. +// https://bugs.webkit.org/show_bug.cgi?id=98974 +typedef HashMap<String, ShDataType> SymbolNameToTypeMap; + +static SymbolNameToTypeMap* builtInAttributeNameToTypeMap() +{ + static SymbolNameToTypeMap* nameToTypeMap = 0; + if (!nameToTypeMap) { + nameToTypeMap = new SymbolNameToTypeMap; + nameToTypeMap->set("a_meshCoord", SH_FLOAT_VEC2); + nameToTypeMap->set("a_position", SH_FLOAT_VEC4); + nameToTypeMap->set("a_texCoord", SH_FLOAT_VEC2); + nameToTypeMap->set("a_triangleCoord", SH_FLOAT_VEC3); + } + return nameToTypeMap; +} + +static bool validateSymbols(const Vector<ANGLEShaderSymbol>& symbols) +{ + for (size_t i = 0; i < symbols.size(); ++i) { + const ANGLEShaderSymbol& symbol = symbols[i]; + switch (symbol.symbolType) { + case SHADER_SYMBOL_TYPE_ATTRIBUTE: { + SymbolNameToTypeMap* attributeNameToTypeMap = builtInAttributeNameToTypeMap(); + SymbolNameToTypeMap::iterator builtInAttribute = attributeNameToTypeMap->find(symbol.name); + if (builtInAttribute != attributeNameToTypeMap->end() && symbol.dataType != builtInAttribute->value) { + // The author defined one of the built-in attributes with the wrong type. + return false; + } + + // FIXME: Return false when the attribute is not one of the built-in attributes. + // https://bugs.webkit.org/show_bug.cgi?id=98973 + break; + } + case SHADER_SYMBOL_TYPE_UNIFORM: + if (symbol.isSampler()) { + // FIXME: For now, we restrict shaders with any sampler defined. + // When we implement texture parameters, we will allow shaders whose samplers are bound to valid textures. + // We must not allow OpenGL to give unbound samplers a default value of 0 because that references the element texture, + // which should be inaccessible to the author's shader code. + // https://bugs.webkit.org/show_bug.cgi?id=96230 + return false; + } + + // FIXME: Validate the types of built-in uniforms. + // https://bugs.webkit.org/show_bug.cgi?id=98974 + break; + default: + ASSERT_NOT_REACHED(); + break; + } + } + + return true; +} + String CustomFilterValidatedProgram::defaultVertexShaderString() { DEFINE_STATIC_LOCAL(String, vertexShaderString, (ASCIILiteral(SHADER( @@ -95,16 +153,10 @@ CustomFilterValidatedProgram::CustomFilterValidatedProgram(CustomFilterGlobalCon return; } - // Validate the author's samplers. - for (Vector<ANGLEShaderSymbol>::iterator it = symbols.begin(); it != symbols.end(); ++it) { - if (it->isSampler()) { - // FIXME: For now, we restrict shaders with any sampler defined. - // When we implement texture parameters, we will allow shaders whose samplers are bound to valid textures. - // We must not allow OpenGL to give unbound samplers a default value of 0 because that references the DOM element texture, - // which should be inaccessible to the author's shader code. - // https://bugs.webkit.org/show_bug.cgi?id=96230 - return; - } + if (!validateSymbols(symbols)) { + // FIXME: Report validation errors. + // https://bugs.webkit.org/show_bug.cgi?id=74416 + return; } // We need to add texture access, blending, and compositing code to shaders that are referenced from the CSS mix function. diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp index 796b37c95..e0686166d 100644 --- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp +++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp @@ -234,8 +234,8 @@ bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer) return false; m_totalWidth = roundf(m_totalWidth); - if (glyphBuffer) - fillGlyphBuffer(glyphBuffer); + if (glyphBuffer && !fillGlyphBuffer(glyphBuffer)) + return false; return true; } @@ -432,7 +432,7 @@ void HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun(GlyphBuffer* glyphBuffer, Ha } } -void HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer) +bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer) { unsigned numRuns = m_harfbuzzRuns.size(); if (m_run.rtl()) { @@ -450,6 +450,7 @@ void HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer) fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, firstOffsetOfNextRun); } } + return glyphBuffer->size(); } int HarfBuzzShaper::offsetForPosition(float targetX) diff --git a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h index c88ef2465..c3c402ba4 100644 --- a/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h +++ b/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.h @@ -103,7 +103,7 @@ private: bool collectHarfBuzzRuns(); bool shapeHarfBuzzRuns(); - void fillGlyphBuffer(GlyphBuffer*); + bool fillGlyphBuffer(GlyphBuffer*); void fillGlyphBufferFromHarfBuzzRun(GlyphBuffer*, HarfBuzzRun*, FloatPoint& firstOffsetOfNextRun); void setGlyphPositionsForHarfBuzzRun(HarfBuzzRun*, hb_buffer_t*); diff --git a/Source/WebCore/platform/graphics/mac/FontMac.mm b/Source/WebCore/platform/graphics/mac/FontMac.mm index b515f81d5..b7c0861d1 100644 --- a/Source/WebCore/platform/graphics/mac/FontMac.mm +++ b/Source/WebCore/platform/graphics/mac/FontMac.mm @@ -139,6 +139,9 @@ static void showGlyphsWithAdvances(const FloatPoint& point, const SimpleFontData void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point) const { + if (!font->platformData().size()) + return; + CGContextRef cgContext = context->platformContext(); bool shouldSmoothFonts = true; diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp index b560bd48e..6ccf4b26c 100644 --- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp +++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp @@ -157,6 +157,10 @@ bool Extensions3DOpenGL::supportsExtension(const String& name) if (name == "GL_OES_standard_derivatives") return true; + // Desktop GL always supports UNSIGNED_INT indices + if (name == "GL_OES_element_index_uint") + return true; + if (name == "GL_EXT_texture_filter_anisotropic") return m_availableExtensions.contains("GL_EXT_texture_filter_anisotropic"); diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp index 82c367d29..697fde224 100644 --- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp +++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp @@ -104,9 +104,9 @@ static SkCanvas* createAcceleratedCanvas(const IntSize& size, ImageBufferData* d static SkCanvas* createNonPlatformCanvas(const IntSize& size) { - SkCanvas* canvas = new SkCanvas(); - canvas->setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height()))->unref(); - return canvas; + SkAutoTUnref<SkDevice> device(new SkDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height())); + SkPixelRef* pixelRef = device->accessBitmap(false).pixelRef(); + return pixelRef ? new SkCanvas(device) : 0; } ImageBuffer::ImageBuffer(const IntSize& size, float resolutionScale, ColorSpace, RenderingMode renderingMode, DeferralMode deferralMode, bool& success) diff --git a/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp b/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp index 1862a2afc..d084ec8f4 100644 --- a/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp +++ b/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp @@ -40,6 +40,11 @@ #include "SkPixelRef.h" #include "SkiaUtils.h" +#if PLATFORM(CHROMIUM) +#include "ImageDecodingStore.h" +#include "TraceEvent.h" +#endif + namespace WebCore { NativeImageSkia::NativeImageSkia() @@ -73,6 +78,11 @@ bool NativeImageSkia::hasResizedBitmap(const SkISize& scaledImageSize, const SkI SkBitmap NativeImageSkia::resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const { +#if PLATFORM(CHROMIUM) + if (ImageDecodingStore::isLazyDecoded(m_image)) + return ImageDecodingStore::instanceOnMainThread()->resizeLazyDecodedSkBitmap(m_image, scaledImageSize, scaledImageSubset); +#endif + if (!hasResizedBitmap(scaledImageSize, scaledImageSubset)) { bool shouldCache = isDataComplete() && shouldCacheResampling(scaledImageSize, scaledImageSubset); diff --git a/Source/WebCore/platform/graphics/skia/PatternSkia.cpp b/Source/WebCore/platform/graphics/skia/PatternSkia.cpp index 78d1a39da..2ae4dd681 100644 --- a/Source/WebCore/platform/graphics/skia/PatternSkia.cpp +++ b/Source/WebCore/platform/graphics/skia/PatternSkia.cpp @@ -100,6 +100,7 @@ PlatformPatternPtr Pattern::platformPattern(const AffineTransform& patternTransf bm2.eraseARGB(0x00, 0x00, 0x00, 0x00); SkCanvas canvas(bm2); canvas.drawBitmap(image->bitmap(), 0, 0); + bm2.setImmutable(); m_pattern = SkShader::CreateBitmapShader(bm2, tileModeX, tileModeY); // Clamp to int, since that's what the adjust function takes. diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapper.h b/Source/WebCore/platform/graphics/texmap/TextureMapper.h index 86a55df49..282bf2ca4 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapper.h +++ b/Source/WebCore/platform/graphics/texmap/TextureMapper.h @@ -56,6 +56,11 @@ public: SupportsAlpha = 0x01 }; + enum UpdateContentsFlag { + UpdateCanModifyOriginalImageData, + UpdateCannotModifyOriginalImageData + }; + typedef unsigned Flags; BitmapTexture() @@ -67,8 +72,8 @@ public: virtual bool isBackedByOpenGL() const { return false; } virtual IntSize size() const = 0; - virtual void updateContents(Image*, const IntRect&, const IntPoint& offset) = 0; - virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine) = 0; + virtual void updateContents(Image*, const IntRect&, const IntPoint& offset, UpdateContentsFlag) = 0; + virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine, UpdateContentsFlag) = 0; virtual bool isValid() const = 0; inline Flags flags() const { return m_flags; } diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp index 995cc79da..112fb42de 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp @@ -73,7 +73,7 @@ void TextureMapperSurfaceBackingStore::setSurface(PassRefPtr<GraphicsSurface> su } #endif -void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* image, const IntRect& dirtyRect) +void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* image, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag) { IntRect targetRect = enclosingIntRect(m_rect); targetRect.intersect(dirtyRect); @@ -91,7 +91,7 @@ void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* imag m_texture->reset(targetRect.size(), image->currentFrameHasAlpha() ? BitmapTexture::SupportsAlpha : 0); } - m_texture->updateContents(image, targetRect, sourceOffset); + m_texture->updateContents(image, targetRect, sourceOffset, updateContentsFlag); } void TextureMapperTile::paint(TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, BitmapTexture* mask, const unsigned exposedEdges) @@ -110,7 +110,7 @@ void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapp if (!m_image) return; - updateContents(textureMapper, m_image.get()); + updateContents(textureMapper, m_image.get(), BitmapTexture::UpdateCannotModifyOriginalImageData); m_image.clear(); } @@ -204,11 +204,11 @@ void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatSiz m_tiles.remove(tileIndicesToRemove[i]); } -void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect) +void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag) { createOrDestroyTilesIfNeeded(totalSize, textureMapper->maxTextureSize(), image->currentFrameHasAlpha()); for (size_t i = 0; i < m_tiles.size(); ++i) - m_tiles[i].updateContents(textureMapper, image, dirtyRect); + m_tiles[i].updateContents(textureMapper, image, dirtyRect, updateContentsFlag); } PassRefPtr<BitmapTexture> TextureMapperTiledBackingStore::texture() const diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h index 93de3da06..c45430e32 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h @@ -77,7 +77,7 @@ public: inline void setTexture(BitmapTexture* texture) { m_texture = texture; } inline void setRect(const FloatRect& rect) { m_rect = rect; } - void updateContents(TextureMapper*, Image*, const IntRect&); + void updateContents(TextureMapper*, Image*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData); virtual void paint(TextureMapper*, const TransformationMatrix&, float, BitmapTexture*, const unsigned exposedEdges); virtual ~TextureMapperTile() { } @@ -97,8 +97,8 @@ public: virtual ~TextureMapperTiledBackingStore() { } virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float, BitmapTexture*); virtual PassRefPtr<BitmapTexture> texture() const; - void updateContents(TextureMapper*, Image*, const FloatSize&, const IntRect&); - void updateContents(TextureMapper* textureMapper, Image* image) { updateContents(textureMapper, image, image->size(), image->rect()); } + void updateContents(TextureMapper*, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag); + void updateContents(TextureMapper* textureMapper, Image* image, BitmapTexture::UpdateContentsFlag updateContentsFlag) { updateContents(textureMapper, image, image->size(), image->rect(), updateContentsFlag); } inline FloatRect rect() const { return FloatRect(FloatPoint::zero(), m_size); } static PassRefPtr<TextureMapperTiledBackingStore> create() { return adoptRef(new TextureMapperTiledBackingStore); } void setContentsToImage(Image* image) { m_image = image; } diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp index 19feae868..d4015a7c7 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp @@ -342,7 +342,7 @@ void TextureMapperGL::drawRepaintCounter(int value, int pointSize, const FloatPo RefPtr<BitmapTexture> texture = acquireTextureFromPool(size); const uchar* bits = image.bits(); - texture->updateContents(bits, sourceRect, IntPoint::zero(), image.bytesPerLine()); + texture->updateContents(bits, sourceRect, IntPoint::zero(), image.bytesPerLine(), BitmapTexture::UpdateCanModifyOriginalImageData); drawTexture(*texture, targetRect, modelViewMatrix, 1.0f, 0, AllEdges); #else UNUSED_PARAM(value); @@ -636,38 +636,44 @@ void BitmapTextureGL::didReset() m_context3D->texImage2DDirect(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, m_textureSize.width(), m_textureSize.height(), 0, format, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, 0); } - -void BitmapTextureGL::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine) +void BitmapTextureGL::updateContents(const void* srcData, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag updateContentsFlag) { Platform3DObject glFormat = GraphicsContext3D::RGBA; m_context3D->bindTexture(GraphicsContext3D::TEXTURE_2D, m_id); const unsigned bytesPerPixel = 4; + char* data = reinterpret_cast<char*>(const_cast<void*>(srcData)); + Vector<char> temporaryData; + + // prepare temporaryData if necessary + if ((!driverSupportsBGRASwizzling() && updateContentsFlag == UpdateCannotModifyOriginalImageData) + || !driverSupportsSubImage()) { + temporaryData.resize(targetRect.width() * targetRect.height() * bytesPerPixel); + data = temporaryData.data(); + const char* bits = static_cast<const char*>(srcData); + const char* src = bits + sourceOffset.y() * bytesPerLine + sourceOffset.x() * bytesPerPixel; + char* dst = data; + const int targetBytesPerLine = targetRect.width() * bytesPerPixel; + for (int y = 0; y < targetRect.height(); ++y) { + memcpy(dst, src, targetBytesPerLine); + src += bytesPerLine; + dst += targetBytesPerLine; + } + } + if (driverSupportsBGRASwizzling()) glFormat = GraphicsContext3D::BGRA; else - swizzleBGRAToRGBA(reinterpret_cast<uint32_t*>(const_cast<void*>(data)), IntRect(sourceOffset, targetRect.size()), bytesPerLine / bytesPerPixel); + swizzleBGRAToRGBA(reinterpret_cast<uint32_t*>(data), IntRect(sourceOffset, targetRect.size()), bytesPerLine / bytesPerPixel); if (bytesPerLine == targetRect.width() * bytesPerPixel && sourceOffset == IntPoint::zero()) { - m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, (const char*)data); + m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, data); return; } // For ES drivers that don't support sub-images. if (!driverSupportsSubImage()) { - const char* bits = static_cast<const char*>(data); - const char* src = bits + sourceOffset.y() * bytesPerLine + sourceOffset.x() * bytesPerPixel; - Vector<char> temporaryData(targetRect.width() * targetRect.height() * bytesPerPixel); - char* dst = temporaryData.data(); - - const int targetBytesPerLine = targetRect.width() * bytesPerPixel; - for (int y = 0; y < targetRect.height(); ++y) { - memcpy(dst, src, targetBytesPerLine); - src += bytesPerLine; - dst += targetBytesPerLine; - } - - m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, temporaryData.data()); + m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, data); return; } @@ -676,14 +682,14 @@ void BitmapTextureGL::updateContents(const void* data, const IntRect& targetRect m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel); m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, sourceOffset.y()); m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, sourceOffset.x()); - m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, (const char*)data); + m_context3D->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, DEFAULT_TEXTURE_PIXEL_TRANSFER_TYPE, data); m_context3D->pixelStorei(GL_UNPACK_ROW_LENGTH, 0); m_context3D->pixelStorei(GL_UNPACK_SKIP_ROWS, 0); m_context3D->pixelStorei(GL_UNPACK_SKIP_PIXELS, 0); #endif } -void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset) +void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag) { if (!image) return; @@ -704,7 +710,7 @@ void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, co bytesPerLine = cairo_image_surface_get_stride(surface); #endif - updateContents(imageData, targetRect, offset, bytesPerLine); + updateContents(imageData, targetRect, offset, bytesPerLine, updateContentsFlag); } #if ENABLE(CSS_FILTERS) diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h index 64bffafe5..cb59e4fc4 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h @@ -139,8 +139,8 @@ public: virtual uint32_t id() const { return m_id; } uint32_t textureTarget() const { return GraphicsContext3D::TEXTURE_2D; } IntSize textureSize() const { return m_textureSize; } - void updateContents(Image*, const IntRect&, const IntPoint&); - virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine); + void updateContents(Image*, const IntRect&, const IntPoint&, UpdateContentsFlag); + virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag); virtual bool isBackedByOpenGL() const { return true; } #if ENABLE(CSS_FILTERS) diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp index 7802b3f0e..843433253 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp @@ -29,7 +29,7 @@ #if USE(TEXTURE_MAPPER) namespace WebCore { -void BitmapTextureImageBuffer::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine) +void BitmapTextureImageBuffer::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag) { #if PLATFORM(QT) QImage image(reinterpret_cast<const uchar*>(data), targetRect.width(), targetRect.height(), bytesPerLine, NativeImageQt::defaultFormatForAlphaEnabledImages()); @@ -59,7 +59,7 @@ void BitmapTextureImageBuffer::didReset() m_image = ImageBuffer::create(contentSize()); } -void BitmapTextureImageBuffer::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset) +void BitmapTextureImageBuffer::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag) { m_image->context()->drawImage(image, ColorSpaceDeviceRGB, targetRect, IntRect(offset, targetRect.size()), CompositeCopy); } diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h index fe9774a32..2e7e2326b 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h @@ -34,8 +34,8 @@ public: virtual void didReset(); virtual bool isValid() const { return m_image; } inline GraphicsContext* graphicsContext() { return m_image ? m_image->context() : 0; } - virtual void updateContents(Image*, const IntRect&, const IntPoint&); - virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine); + virtual void updateContents(Image*, const IntRect&, const IntPoint&, UpdateContentsFlag); + virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag); #if ENABLE(CSS_FILTERS) PassRefPtr<BitmapTexture> applyFilters(TextureMapper*, const BitmapTexture&, const FilterOperations&); #endif diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp index b9544609e..21bd7b235 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp @@ -136,7 +136,7 @@ void TextureMapperLayer::updateBackingStore(TextureMapper* textureMapper, Graphi RefPtr<Image> image = imageBuffer->copyImage(DontCopyBackingStore); TextureMapperTiledBackingStore* backingStore = static_cast<TextureMapperTiledBackingStore*>(m_backingStore.get()); - backingStore->updateContents(textureMapper, image.get(), m_size, dirtyRect); + backingStore->updateContents(textureMapper, image.get(), m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData); backingStore->setShowDebugBorders(layer->showDebugBorders()); backingStore->setDebugBorder(m_debugBorderColor, m_debugBorderWidth); diff --git a/Source/WebCore/platform/image-decoders/ImageDecoder.h b/Source/WebCore/platform/image-decoders/ImageDecoder.h index fc82a5c25..9f697a84a 100644 --- a/Source/WebCore/platform/image-decoders/ImageDecoder.h +++ b/Source/WebCore/platform/image-decoders/ImageDecoder.h @@ -148,6 +148,18 @@ namespace WebCore { void reportMemoryUsage(MemoryObjectInfo*) const; +#if PLATFORM(CHROMIUM) + void setSkBitmap(const SkBitmap& bitmap) + { + m_bitmap = NativeImageSkia(bitmap, 1); + } + + const SkBitmap& getSkBitmap() const + { + return m_bitmap.bitmap(); + } +#endif + private: int width() const; int height() const; diff --git a/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp b/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp index 14c119fb4..c7f1578ea 100644 --- a/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp +++ b/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp @@ -81,6 +81,7 @@ bool ImageFrame::copyBitmapData(const ImageFrame& other) if (this == &other) return true; + m_hasAlpha = other.m_hasAlpha; m_bitmap.bitmap().reset(); const NativeImageSkia& otherBitmap = other.m_bitmap; return otherBitmap.bitmap().copyTo(&m_bitmap.bitmap(), otherBitmap.bitmap().config()); diff --git a/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp b/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp index f4f9822de..dea2c4796 100644 --- a/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp +++ b/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp @@ -49,25 +49,25 @@ MediaStreamCenter::~MediaStreamCenter() void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescriptor) { - MediaStreamDescriptorOwner* owner = streamDescriptor->owner(); - if (owner) - owner->streamEnded(); + MediaStreamDescriptorClient* client = streamDescriptor->client(); + if (client) + client->streamEnded(); else streamDescriptor->setEnded(); } void MediaStreamCenter::addMediaStreamTrack(MediaStreamDescriptor* streamDescriptor, MediaStreamComponent* component) { - MediaStreamDescriptorOwner* owner = streamDescriptor->owner(); - if (owner) - owner->addTrack(component); + MediaStreamDescriptorClient* client = streamDescriptor->client(); + if (client) + client->addTrack(component); } void MediaStreamCenter::removeMediaStreamTrack(MediaStreamDescriptor* streamDescriptor, MediaStreamComponent* component) { - MediaStreamDescriptorOwner* owner = streamDescriptor->owner(); - if (owner) - owner->removeTrack(component); + MediaStreamDescriptorClient* client = streamDescriptor->client(); + if (client) + client->removeTrack(component); } } // namespace WebCore diff --git a/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h b/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h index c6061052d..1241e3389 100644 --- a/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h +++ b/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h @@ -40,9 +40,9 @@ namespace WebCore { -class MediaStreamDescriptorOwner { +class MediaStreamDescriptorClient { public: - virtual ~MediaStreamDescriptorOwner() { } + virtual ~MediaStreamDescriptorClient() { } virtual void streamEnded() = 0; virtual void addTrack(MediaStreamComponent*) = 0; @@ -61,8 +61,8 @@ public: return adoptRef(new MediaStreamDescriptor(label, audioSources, videoSources)); } - MediaStreamDescriptorOwner* owner() const { return m_owner; } - void setOwner(MediaStreamDescriptorOwner* owner) { m_owner = owner; } + MediaStreamDescriptorClient* client() const { return m_client; } + void setClient(MediaStreamDescriptorClient* client) { m_client = client; } String label() const { return m_label; } @@ -80,7 +80,7 @@ public: private: MediaStreamDescriptor(const String& label, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources) - : m_owner(0) + : m_client(0) , m_label(label) , m_ended(false) { @@ -91,7 +91,7 @@ private: m_videoComponents.append(MediaStreamComponent::create(videoSources[i])); } - MediaStreamDescriptorOwner* m_owner; + MediaStreamDescriptorClient* m_client; String m_label; Vector<RefPtr<MediaStreamComponent> > m_audioComponents; Vector<RefPtr<MediaStreamComponent> > m_videoComponents; diff --git a/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp b/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp index 2c2acbe86..25b2573ac 100644 --- a/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp +++ b/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp @@ -30,6 +30,7 @@ #include "config.h" #include "ResourceHandle.h" +#include "BlobRegistry.h" #include "CachedResourceLoader.h" #include "Frame.h" #include "FrameNetworkingContext.h" @@ -150,6 +151,12 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame) void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data) { +#if ENABLE(BLOB) + if (request.url().protocolIs("blob")) { + blobRegistry().loadResourceSynchronously(request, error, response, data); + return; + } +#endif WebCoreSynchronousLoader syncLoader(error, response, data); RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false)); diff --git a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp index 96e23a98a..62d8696ed 100644 --- a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp +++ b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp @@ -126,6 +126,16 @@ unsigned initializeMaximumHTTPConnectionCountPerHost() String ResourceRequest::urlStringForSoup() const { + // WebKit does not support fragment identifiers in data URLs, but soup does. + // Before passing the URL to soup, we should make sure to urlencode any '#' + // characters, so that soup does not interpret them as fragment identifiers. + // See http://wkbug.com/68089 + if (m_url.protocolIsData()) { + String urlString = m_url.string(); + urlString.replace("#", "%23"); + return urlString; + } + KURL url = m_url; url.removeFragmentIdentifier(); return url.string(); diff --git a/Source/WebCore/platform/text/LocaleICU.cpp b/Source/WebCore/platform/text/LocaleICU.cpp index ce5f0afc4..e1a1eb17b 100644 --- a/Source/WebCore/platform/text/LocaleICU.cpp +++ b/Source/WebCore/platform/text/LocaleICU.cpp @@ -33,6 +33,7 @@ #include "LocalizedStrings.h" #include <limits> +#include <unicode/udatpg.h> #include <unicode/uloc.h> #include <wtf/DateMath.h> #include <wtf/PassOwnPtr.h> @@ -398,6 +399,36 @@ String LocaleICU::dateFormat() return m_dateFormat; } +static String getFormatForSkeleton(const char* locale, const String& skeleton) +{ + String format = ASCIILiteral("yyyy-MM"); + UErrorCode status = U_ZERO_ERROR; + UDateTimePatternGenerator* patternGenerator = udatpg_open(locale, &status); + if (!patternGenerator) + return format; + status = U_ZERO_ERROR; + int32_t length = udatpg_getBestPattern(patternGenerator, skeleton.characters(), skeleton.length(), 0, 0, &status); + if (status == U_BUFFER_OVERFLOW_ERROR && length) { + Vector<UChar> buffer(length); + status = U_ZERO_ERROR; + udatpg_getBestPattern(patternGenerator, skeleton.characters(), skeleton.length(), buffer.data(), length, &status); + if (U_SUCCESS(status)) + format = String::adopt(buffer); + } + udatpg_close(patternGenerator); + return format; +} + +String LocaleICU::monthFormat() +{ + if (!m_monthFormat.isNull()) + return m_monthFormat; + // Gets a format for "MMM", not "MM" because Windows API always provides + // formats for "MMM". + m_monthFormat = getFormatForSkeleton(m_locale.data(), ASCIILiteral("yyyyMMM")); + return m_monthFormat; +} + String LocaleICU::timeFormat() { initializeDateTimeFormat(); @@ -410,6 +441,36 @@ String LocaleICU::shortTimeFormat() return m_localizedShortTimeFormatText; } +const Vector<String>& LocaleICU::shortMonthLabels() +{ + if (!m_shortMonthLabels.isEmpty()) + return m_shortMonthLabels; + if (initializeShortDateFormat()) { + if (OwnPtr<Vector<String> > labels = createLabelVector(m_shortDateFormat, UDAT_SHORT_MONTHS, UCAL_JANUARY, 12)) { + m_shortMonthLabels = *labels; + return m_shortMonthLabels; + } + } + m_shortMonthLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthName)); + for (unsigned i = 0; i < WTF_ARRAY_LENGTH(WTF::monthName); ++i) + m_shortMonthLabels.append(WTF::monthName[i]); + return m_shortMonthLabels; +} + +const Vector<String>& LocaleICU::shortStandAloneMonthLabels() +{ + if (!m_shortStandAloneMonthLabels.isEmpty()) + return m_shortStandAloneMonthLabels; + if (initializeShortDateFormat()) { + if (OwnPtr<Vector<String> > labels = createLabelVector(m_shortDateFormat, UDAT_STANDALONE_SHORT_MONTHS, UCAL_JANUARY, 12)) { + m_shortStandAloneMonthLabels = *labels; + return m_shortStandAloneMonthLabels; + } + } + m_shortStandAloneMonthLabels = shortMonthLabels(); + return m_shortStandAloneMonthLabels; +} + const Vector<String>& LocaleICU::timeAMPMLabels() { initializeDateTimeFormat(); diff --git a/Source/WebCore/platform/text/LocaleICU.h b/Source/WebCore/platform/text/LocaleICU.h index a4b8122cb..6c62f92fc 100644 --- a/Source/WebCore/platform/text/LocaleICU.h +++ b/Source/WebCore/platform/text/LocaleICU.h @@ -62,8 +62,11 @@ public: #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) virtual String dateFormat() OVERRIDE; + virtual String monthFormat() OVERRIDE; virtual String timeFormat() OVERRIDE; virtual String shortTimeFormat() OVERRIDE; + virtual const Vector<String>& shortMonthLabels() OVERRIDE; + virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE; virtual const Vector<String>& timeAMPMLabels() OVERRIDE; #endif @@ -107,8 +110,11 @@ private: #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) String m_dateFormat; + String m_monthFormat; UDateFormat* m_mediumTimeFormat; UDateFormat* m_shortTimeFormat; + Vector<String> m_shortMonthLabels; + Vector<String> m_shortStandAloneMonthLabels; Vector<String> m_timeAMPMLabels; bool m_didCreateTimeFormat; #endif diff --git a/Source/WebCore/platform/text/LocaleNone.cpp b/Source/WebCore/platform/text/LocaleNone.cpp index 0ddaf3036..2535d896a 100644 --- a/Source/WebCore/platform/text/LocaleNone.cpp +++ b/Source/WebCore/platform/text/LocaleNone.cpp @@ -25,6 +25,7 @@ #include "config.h" #include "Localizer.h" +#include <wtf/DateMath.h> #include <wtf/PassOwnPtr.h> namespace WebCore { @@ -42,7 +43,12 @@ private: #endif #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) virtual String dateFormat() OVERRIDE; + virtual String monthFormat() OVERRIDE; + virtual const Vector<String>& shortMonthLabels() OVERRIDE; + virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE; #endif + + Vector<String> m_shortMonthLabels; }; PassOwnPtr<Localizer> Localizer::create(const AtomicString&) @@ -80,6 +86,26 @@ String LocaleNone::dateFormat() { return ASCIILiteral("dd/MM/yyyyy"); } + +String LocaleNone::monthFormat() +{ + return ASCIILiteral("yyyy-MM"); +} + +const Vector<String>& LocaleNone::shortMonthLabels() +{ + if (!m_shortMonthLabels.isEmpty()) + return m_shortMonthLabels; + m_shortMonthLabels.reserveCapacity(WTF_ARRAY_LENGTH(WTF::monthName)); + for (unsigned i = 0; i < WTF_ARRAY_LENGTH(WTF::monthName); ++i) + m_shortMonthLabels.append(WTF::monthName[i]); + return m_shortMonthLabels; +} + +const Vector<String>& LocaleNone::shortStandAloneMonthLabels() +{ + return shortMonthLabels(); +} #endif } // namespace WebCore diff --git a/Source/WebCore/platform/text/LocaleWin.cpp b/Source/WebCore/platform/text/LocaleWin.cpp index 097b09302..584a6a06f 100644 --- a/Source/WebCore/platform/text/LocaleWin.cpp +++ b/Source/WebCore/platform/text/LocaleWin.cpp @@ -713,6 +713,14 @@ String LocaleWin::dateFormat(const String& windowsFormat) return convertWindowsDateFormatToLDML(parseDateFormat(windowsFormat)); } +String LocaleWin::monthFormat() +{ + if (!m_monthFormat.isNull()) + return m_monthFormat; + m_monthFormat = convertWindowsDateFormatToLDML(parseDateFormat(getLocaleInfoString(LOCALE_SYEARMONTH))); + return m_monthFormat; +} + String LocaleWin::timeFormat() { if (m_localizedTimeFormatText.isEmpty()) @@ -727,6 +735,18 @@ String LocaleWin::shortTimeFormat() return timeFormat(); } +const Vector<String>& LocaleWin::shortMonthLabels() +{ + ensureShortMonthLabels(); + return m_shortMonthLabels; +} + +const Vector<String>& LocaleWin::shortStandAloneMonthLabels() +{ + // Windows doesn't provide a way to get stand-alone month labels. + return shortMonthLabels(); +} + const Vector<String>& LocaleWin::timeAMPMLabels() { if (m_timeAMPMLabels.isEmpty()) { diff --git a/Source/WebCore/platform/text/LocaleWin.h b/Source/WebCore/platform/text/LocaleWin.h index 21ad7bf5f..a2b15d3f0 100644 --- a/Source/WebCore/platform/text/LocaleWin.h +++ b/Source/WebCore/platform/text/LocaleWin.h @@ -57,8 +57,11 @@ public: #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) virtual String dateFormat() OVERRIDE; + virtual String monthFormat() OVERRIDE; virtual String timeFormat() OVERRIDE; virtual String shortTimeFormat() OVERRIDE; + virtual const Vector<String>& shortMonthLabels() OVERRIDE; + virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE; virtual const Vector<String>& timeAMPMLabels() OVERRIDE; #endif @@ -98,6 +101,7 @@ private: Vector<String> m_monthLabels; #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) String m_dateFormat; + String m_monthFormat; #endif #if ENABLE(CALENDAR_PICKER) Vector<String> m_weekDayShortLabels; diff --git a/Source/WebCore/platform/text/Localizer.h b/Source/WebCore/platform/text/Localizer.h index 2ed277c95..6f527195e 100644 --- a/Source/WebCore/platform/text/Localizer.h +++ b/Source/WebCore/platform/text/Localizer.h @@ -62,6 +62,9 @@ public: // [1] LDML http://unicode.org/reports/tr35/#Date_Format_Patterns virtual String dateFormat() = 0; + // Returns a year-month format in Unicode TR35 LDML. + virtual String monthFormat() = 0; + // Returns time format in Unicode TR35 LDML[1] containing hour, minute, and // second with optional period(AM/PM), e.g. "h:mm:ss a" // [1] LDML http://unicode.org/reports/tr35/#Date_Format_Patterns @@ -80,6 +83,14 @@ public: // field. String dateTimeFormatWithoutSeconds(); + // Returns a vector of string of which size is 12. The first item is a + // localized string of Jan and the last item is a localized string of + // Dec. These strings should be short. + virtual const Vector<String>& shortMonthLabels() = 0; + + // Stand-alone month version of shortMonthLabels. + virtual const Vector<String>& shortStandAloneMonthLabels() = 0; + // Returns localized period field(AM/PM) strings. virtual const Vector<String>& timeAMPMLabels(); #endif diff --git a/Source/WebCore/platform/text/cf/StringCF.cpp b/Source/WebCore/platform/text/cf/StringCF.cpp index 8c9774982..d7cda7962 100644 --- a/Source/WebCore/platform/text/cf/StringCF.cpp +++ b/Source/WebCore/platform/text/cf/StringCF.cpp @@ -37,6 +37,14 @@ String::String(CFStringRef str) if (size == 0) m_impl = StringImpl::empty(); else { + Vector<LChar, 1024> lcharBuffer(size); + CFIndex usedBufLen; + CFIndex convertedsize = CFStringGetBytes(str, CFRangeMake(0, size), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), size, &usedBufLen); + if ((convertedsize == size) && (usedBufLen == size)) { + m_impl = StringImpl::create(lcharBuffer.data(), size); + return; + } + Vector<UChar, 1024> buffer(size); CFStringGetCharacters(str, CFRangeMake(0, size), (UniChar*)buffer.data()); m_impl = StringImpl::create(buffer.data(), size); diff --git a/Source/WebCore/platform/text/mac/LocaleMac.h b/Source/WebCore/platform/text/mac/LocaleMac.h index ac029ea03..a3f22beb1 100644 --- a/Source/WebCore/platform/text/mac/LocaleMac.h +++ b/Source/WebCore/platform/text/mac/LocaleMac.h @@ -62,8 +62,11 @@ public: #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) virtual String dateFormat() OVERRIDE; + virtual String monthFormat() OVERRIDE; virtual String timeFormat() OVERRIDE; virtual String shortTimeFormat() OVERRIDE; + virtual const Vector<String>& shortMonthLabels() OVERRIDE; + virtual const Vector<String>& shortStandAloneMonthLabels() OVERRIDE; virtual const Vector<String>& timeAMPMLabels() OVERRIDE; #endif @@ -84,8 +87,11 @@ private: RetainPtr<NSDateFormatter> shortTimeFormatter(); String m_dateFormat; + String m_monthFormat; String m_localizedTimeFormatText; String m_localizedShortTimeFormatText; + Vector<String> m_shortMonthLabels; + Vector<String> m_shortStandAloneMonthLabels; Vector<String> m_timeAMPMLabels; #endif bool m_didInitializeNumberData; diff --git a/Source/WebCore/platform/text/mac/LocaleMac.mm b/Source/WebCore/platform/text/mac/LocaleMac.mm index a20254e12..6c365df26 100644 --- a/Source/WebCore/platform/text/mac/LocaleMac.mm +++ b/Source/WebCore/platform/text/mac/LocaleMac.mm @@ -246,6 +246,16 @@ String LocaleMac::dateFormat() return m_dateFormat; } +String LocaleMac::monthFormat() +{ + if (!m_monthFormat.isNull()) + return m_monthFormat; + // Gets a format for "MMM", not "MM" because Windows API always provides + // formats for "MMM". + m_monthFormat = [NSDateFormatter dateFormatFromTemplate:@"yyyyMMM" options:0 locale:m_locale.get()]; + return m_monthFormat; +} + String LocaleMac::timeFormat() { if (!m_localizedTimeFormatText.isNull()) @@ -262,6 +272,37 @@ String LocaleMac::shortTimeFormat() return m_localizedShortTimeFormatText; } +const Vector<String>& LocaleMac::shortMonthLabels() +{ + if (!m_shortMonthLabels.isEmpty()) + return m_shortMonthLabels; + m_shortMonthLabels.reserveCapacity(12); + NSArray *array = [shortDateFormatter().get() shortMonthSymbols]; + if ([array count] == 12) { + for (unsigned i = 0; i < 12; ++i) + m_shortMonthLabels.append([array objectAtIndex:i]); + return m_shortMonthLabels; + } + for (unsigned i = 0; i < WTF_ARRAY_LENGTH(WTF::monthName); ++i) + m_shortMonthLabels.append(WTF::monthName[i]); + return m_shortMonthLabels; +} + +const Vector<String>& LocaleMac::shortStandAloneMonthLabels() +{ + if (!m_shortStandAloneMonthLabels.isEmpty()) + return m_shortStandAloneMonthLabels; + NSArray *array = [shortDateFormatter().get() shortStandaloneMonthSymbols]; + if ([array count] == 12) { + m_shortStandAloneMonthLabels.reserveCapacity(12); + for (unsigned i = 0; i < 12; ++i) + m_shortStandAloneMonthLabels.append([array objectAtIndex:i]); + return m_shortStandAloneMonthLabels; + } + m_shortStandAloneMonthLabels = shortMonthLabels(); + return m_shortStandAloneMonthLabels; +} + const Vector<String>& LocaleMac::timeAMPMLabels() { if (!m_timeAMPMLabels.isEmpty()) diff --git a/Source/WebCore/rendering/ExclusionPolygon.cpp b/Source/WebCore/rendering/ExclusionPolygon.cpp index e704abfce..ba20dc2e6 100644 --- a/Source/WebCore/rendering/ExclusionPolygon.cpp +++ b/Source/WebCore/rendering/ExclusionPolygon.cpp @@ -57,26 +57,17 @@ ExclusionPolygon::ExclusionPolygon(PassOwnPtr<Vector<FloatPoint> > vertices, Win , m_vertices(vertices) , m_fillRule(fillRule) { - // FIXME: Handle polygons defined with less than 3 non-colinear vertices. - unsigned nVertices = numberOfVertices(); m_edges.resize(nVertices); + m_empty = nVertices < 3; Vector<ExclusionPolygonEdge*> sortedEdgesMinY(nVertices); - const FloatPoint& vertex0 = vertexAt(0); - float minX = vertex0.x(); - float minY = vertex0.y(); - float maxX = minX; - float maxY = minY; + if (nVertices) + m_boundingBox.setLocation(vertexAt(0)); for (unsigned i = 0; i < nVertices; i++) { const FloatPoint& vertex = vertexAt(i); - - minX = std::min(vertex.x(), minX); - maxX = std::max(vertex.x(), maxX); - minY = std::min(vertex.y(), minY); - maxY = std::max(vertex.y(), maxY); - + m_boundingBox.extend(vertex); m_edges[i].polygon = this; m_edges[i].index1 = i; m_edges[i].index2 = (i + 1) % nVertices; @@ -84,11 +75,6 @@ ExclusionPolygon::ExclusionPolygon(PassOwnPtr<Vector<FloatPoint> > vertices, Win sortedEdgesMinY[i] = &m_edges[i]; } - m_boundingBox.setX(minX); - m_boundingBox.setY(minY); - m_boundingBox.setWidth(maxX - minX); - m_boundingBox.setHeight(maxY - minY); - std::sort(sortedEdgesMinY.begin(), sortedEdgesMinY.end(), WebCore::compareEdgeMinY); for (unsigned i = 0; i < m_edges.size(); i++) { @@ -257,6 +243,9 @@ void ExclusionPolygon::computeEdgeIntersections(float y1, float y2, Vector<Exclu void ExclusionPolygon::getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList& result) const { + if (isEmpty()) + return; + float y1 = minYForLogicalLine(logicalTop, logicalBottom); float y2 = maxYForLogicalLine(logicalTop, logicalBottom); @@ -281,6 +270,9 @@ void ExclusionPolygon::getExcludedIntervals(float logicalTop, float logicalBotto void ExclusionPolygon::getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList& result) const { + if (isEmpty()) + return; + float y1 = minYForLogicalLine(logicalTop, logicalBottom); float y2 = maxYForLogicalLine(logicalTop, logicalBottom); diff --git a/Source/WebCore/rendering/ExclusionPolygon.h b/Source/WebCore/rendering/ExclusionPolygon.h index 6397d0ee7..57e35520d 100644 --- a/Source/WebCore/rendering/ExclusionPolygon.h +++ b/Source/WebCore/rendering/ExclusionPolygon.h @@ -62,6 +62,7 @@ public: virtual FloatRect shapeLogicalBoundingBox() const OVERRIDE { return internalToLogicalBoundingBox(m_boundingBox); } virtual void getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const OVERRIDE; virtual void getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const OVERRIDE; + virtual bool isEmpty() const OVERRIDE { return m_empty; } private: float rightVertexY(unsigned) const; @@ -76,6 +77,7 @@ private: FloatRect m_boundingBox; Vector<ExclusionPolygonEdge> m_edges; EdgeIntervalTree m_edgeTree; + bool m_empty; }; // EdgeIntervalTree nodes store minY, maxY, and a ("UserData") pointer to an ExclusionPolygonEdge. Edge vertex diff --git a/Source/WebCore/rendering/ExclusionRectangle.cpp b/Source/WebCore/rendering/ExclusionRectangle.cpp index 3bdde0aee..0ccf6224a 100644 --- a/Source/WebCore/rendering/ExclusionRectangle.cpp +++ b/Source/WebCore/rendering/ExclusionRectangle.cpp @@ -42,6 +42,9 @@ static inline float ellipseXIntercept(float y, float rx, float ry) void ExclusionRectangle::getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList& result) const { + if (isEmpty()) + return; + float y1 = minYForLogicalLine(logicalTop, logicalBottom); float y2 = maxYForLogicalLine(logicalTop, logicalBottom); @@ -70,6 +73,9 @@ void ExclusionRectangle::getExcludedIntervals(float logicalTop, float logicalBot void ExclusionRectangle::getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList& result) const { + if (isEmpty()) + return; + float y1 = minYForLogicalLine(logicalTop, logicalBottom); float y2 = maxYForLogicalLine(logicalTop, logicalBottom); diff --git a/Source/WebCore/rendering/ExclusionRectangle.h b/Source/WebCore/rendering/ExclusionRectangle.h index 5ca289d86..0078264dd 100644 --- a/Source/WebCore/rendering/ExclusionRectangle.h +++ b/Source/WebCore/rendering/ExclusionRectangle.h @@ -53,6 +53,7 @@ public: virtual FloatRect shapeLogicalBoundingBox() const OVERRIDE { return internalToLogicalBoundingBox(FloatRect(m_x, m_y, m_width, m_height)); } virtual void getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const OVERRIDE; virtual void getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const OVERRIDE; + virtual bool isEmpty() const OVERRIDE { return m_width <= 0 || m_height <= 0; } private: float m_x; diff --git a/Source/WebCore/rendering/ExclusionShape.cpp b/Source/WebCore/rendering/ExclusionShape.cpp index c3ec8acaa..f5d85b2ec 100644 --- a/Source/WebCore/rendering/ExclusionShape.cpp +++ b/Source/WebCore/rendering/ExclusionShape.cpp @@ -82,18 +82,21 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape case BasicShape::BASIC_SHAPE_RECTANGLE: { const BasicShapeRectangle* rectangle = static_cast<const BasicShapeRectangle*>(basicShape); - float x = floatValueForLength(rectangle->x(), boxWidth); - float y = floatValueForLength(rectangle->y(), boxHeight); - float width = floatValueForLength(rectangle->width(), boxWidth); - float height = floatValueForLength(rectangle->height(), boxHeight); + FloatRect bounds( + floatValueForLength(rectangle->x(), boxWidth), + floatValueForLength(rectangle->y(), boxHeight), + floatValueForLength(rectangle->width(), boxWidth), + floatValueForLength(rectangle->height(), boxHeight)); Length radiusXLength = rectangle->cornerRadiusX(); Length radiusYLength = rectangle->cornerRadiusY(); - float radiusX = radiusXLength.isUndefined() ? 0 : floatValueForLength(radiusXLength, boxWidth); - float radiusY = radiusYLength.isUndefined() ? 0 : floatValueForLength(radiusYLength, boxHeight); + FloatSize cornerRadii( + radiusXLength.isUndefined() ? 0 : floatValueForLength(radiusXLength, boxWidth), + radiusYLength.isUndefined() ? 0 : floatValueForLength(radiusYLength, boxHeight)); exclusionShape = horizontalWritingMode - ? createExclusionRectangle(FloatRect(x, y, width, height), FloatSize(radiusX, radiusY)) - : createExclusionRectangle(FloatRect(y, x, height, width), FloatSize(radiusY, radiusX)); + ? createExclusionRectangle(bounds, cornerRadii) + : createExclusionRectangle(bounds.transposedRect(), cornerRadii.transposedSize()); + exclusionShape->m_boundingBox = bounds; break; } @@ -106,6 +109,7 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape exclusionShape = horizontalWritingMode ? createExclusionCircle(FloatPoint(centerX, centerY), radius) : createExclusionCircle(FloatPoint(centerY, centerX), radius); + exclusionShape->m_boundingBox = FloatRect(centerX - radius, centerY - radius, radius * 2, radius * 2); break; } @@ -119,6 +123,7 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape exclusionShape = horizontalWritingMode ? createExclusionEllipse(FloatPoint(centerX, centerY), FloatSize(radiusX, radiusY)) : createExclusionEllipse(FloatPoint(centerY, centerX), FloatSize(radiusY, radiusX)); + exclusionShape->m_boundingBox = FloatRect(centerX - radiusX, centerY - radiusY, radiusX * 2, radiusY * 2); break; } @@ -127,14 +132,20 @@ PassOwnPtr<ExclusionShape> ExclusionShape::createExclusionShape(const BasicShape const Vector<Length>& values = polygon->values(); size_t valuesSize = values.size(); ASSERT(!(valuesSize % 2)); + FloatRect boundingBox; Vector<FloatPoint>* vertices = new Vector<FloatPoint>(valuesSize / 2); for (unsigned i = 0; i < valuesSize; i += 2) { FloatPoint vertex( floatValueForLength(values.at(i), boxWidth), floatValueForLength(values.at(i + 1), boxHeight)); (*vertices)[i / 2] = horizontalWritingMode ? vertex : vertex.transposedPoint(); + if (!i) + boundingBox.setLocation(vertex); + else + boundingBox.extend(vertex); } exclusionShape = createExclusionPolygon(adoptPtr(vertices), polygon->windRule()); + exclusionShape->m_boundingBox = boundingBox; break; } diff --git a/Source/WebCore/rendering/ExclusionShape.h b/Source/WebCore/rendering/ExclusionShape.h index bb1edc6d1..a75ab70e8 100644 --- a/Source/WebCore/rendering/ExclusionShape.h +++ b/Source/WebCore/rendering/ExclusionShape.h @@ -64,8 +64,10 @@ public: virtual ~ExclusionShape() { } virtual FloatRect shapeLogicalBoundingBox() const = 0; + virtual FloatRect shapeBoundingBox() const { return m_boundingBox; } virtual void getIncludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const = 0; virtual void getExcludedIntervals(float logicalTop, float logicalBottom, SegmentList&) const = 0; + virtual bool isEmpty() const = 0; protected: float minYForLogicalLine(float logicalTop, float logicalBottom) const { return (m_writingMode == RightToLeftWritingMode) ? m_logicalBoxHeight - logicalBottom : logicalTop; } @@ -76,6 +78,7 @@ private: WritingMode m_writingMode; float m_logicalBoxWidth; float m_logicalBoxHeight; + FloatRect m_boundingBox; }; } // namespace WebCore diff --git a/Source/WebCore/rendering/InlineIterator.h b/Source/WebCore/rendering/InlineIterator.h index bef9a9815..bef9a9815 100755..100644 --- a/Source/WebCore/rendering/InlineIterator.h +++ b/Source/WebCore/rendering/InlineIterator.h diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp index 796156a60..6e1087d35 100755..100644 --- a/Source/WebCore/rendering/RenderBlock.cpp +++ b/Source/WebCore/rendering/RenderBlock.cpp @@ -1373,6 +1373,7 @@ void RenderBlock::updateScrollInfoAfterLayout() void RenderBlock::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; OverflowEventDispatcher dispatcher(this); // Update our first letter info now. @@ -6093,11 +6094,9 @@ void RenderBlock::computeBlockPreferredLogicalWidths() LayoutUnit childMinPreferredLogicalWidth, childMaxPreferredLogicalWidth; if (child->isBox() && child->isHorizontalWritingMode() != isHorizontalWritingMode()) { RenderBox* childBox = toRenderBox(child); - LayoutUnit oldHeight = childBox->logicalHeight(); - childBox->setLogicalHeight(childBox->borderAndPaddingLogicalHeight()); - childBox->updateLogicalHeight(); - childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth = childBox->logicalHeight(); - childBox->setLogicalHeight(oldHeight); + LogicalExtentComputedValues computedValues; + childBox->computeLogicalHeight(childBox->borderAndPaddingLogicalHeight(), 0, computedValues); + childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth = computedValues.m_extent; } else { childMinPreferredLogicalWidth = child->minPreferredLogicalWidth(); childMaxPreferredLogicalWidth = child->maxPreferredLogicalWidth(); diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp index 21fd552f7..1cfd1e098 100755..100644 --- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp +++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp @@ -177,13 +177,15 @@ inline void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(RenderBlock::Floa return; if (newFloat->type() == RenderBlock::FloatingObject::FloatLeft) { - m_left = m_block->pixelSnappedLogicalRightForFloat(newFloat); + float newLeft = m_block->pixelSnappedLogicalRightForFloat(newFloat); if (m_isFirstLine && m_block->style()->isLeftToRightDirection()) - m_left += floorToInt(m_block->textIndentOffset()); + newLeft += floorToInt(m_block->textIndentOffset()); + m_left = max<float>(m_left, newLeft); } else { - m_right = m_block->pixelSnappedLogicalLeftForFloat(newFloat); + float newRight = m_block->pixelSnappedLogicalLeftForFloat(newFloat); if (m_isFirstLine && !m_block->style()->isLeftToRightDirection()) - m_right -= floorToInt(m_block->textIndentOffset()); + newRight -= floorToInt(m_block->textIndentOffset()); + m_right = min<float>(m_right, newRight); } computeAvailableWidthFromLeftAndRight(); @@ -1021,6 +1023,20 @@ static void setStaticPositions(RenderBlock* block, RenderBox* child) child->layer()->setStaticBlockPosition(blockHeight); } +template <typename CharacterType> +static inline int findFirstTrailingSpace(RenderText* lastText, const CharacterType* characters, int start, int stop) +{ + int firstSpace = stop; + while (firstSpace > start) { + UChar current = characters[firstSpace - 1]; + if (!isCollapsibleSpace(current, lastText)) + break; + firstSpace--; + } + + return firstSpace; +} + inline BidiRun* RenderBlock::handleTrailingSpaces(BidiRunList<BidiRun>& bidiRuns, BidiContext* currentContext) { if (!bidiRuns.runCount() @@ -1034,14 +1050,12 @@ inline BidiRun* RenderBlock::handleTrailingSpaces(BidiRunList<BidiRun>& bidiRuns return 0; RenderText* lastText = toRenderText(lastObject); - const UChar* characters = lastText->characters(); - int firstSpace = trailingSpaceRun->stop(); - while (firstSpace > trailingSpaceRun->start()) { - UChar current = characters[firstSpace - 1]; - if (!isCollapsibleSpace(current, lastText)) - break; - firstSpace--; - } + int firstSpace; + if (lastText->is8Bit()) + firstSpace = findFirstTrailingSpace(lastText, lastText->characters8(), trailingSpaceRun->start(), trailingSpaceRun->stop()); + else + firstSpace = findFirstTrailingSpace(lastText, lastText->characters16(), trailingSpaceRun->start(), trailingSpaceRun->stop()); + if (firstSpace == trailingSpaceRun->stop()) return 0; @@ -2390,6 +2404,14 @@ InlineIterator RenderBlock::LineBreaker::nextLineBreak(InlineBidiResolver& resol trailingObjects.clear(); lineInfo.setPreviousLineBrokeCleanly(true); + // A <br> with clearance always needs a linebox in case the lines below it get dirtied later and + // need to check for floats to clear - so if we're ignoring spaces, stop ignoring them and add a + // run for this object. + if (ignoringSpaces && currentStyle->clear() != CNONE) { + addMidpoint(lineMidpointState, InlineIterator(0, current.m_obj, 0)); // Stop ignoring spaces. + addMidpoint(lineMidpointState, InlineIterator(0, current.m_obj, 0)); // Start ignoring again. + } + if (!lineInfo.isEmpty()) m_clear = currentStyle->clear(); } diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp index c56d7a9ea..779277d14 100644 --- a/Source/WebCore/rendering/RenderBox.cpp +++ b/Source/WebCore/rendering/RenderBox.cpp @@ -314,6 +314,7 @@ void RenderBox::updateFromStyle() void RenderBox::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); RenderObject* child = firstChild(); @@ -2212,10 +2213,9 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const } else if (cb->isRenderView() || isOutOfFlowPositionedWithSpecifiedHeight) { // Don't allow this to affect the block' height() member variable, since this // can get called while the block is still laying out its kids. - LayoutUnit oldHeight = cb->logicalHeight(); - cb->updateLogicalHeight(); - availableHeight = cb->contentLogicalHeight(); - cb->setLogicalHeight(oldHeight); + LogicalExtentComputedValues computedValues; + cb->computeLogicalHeight(cb->logicalHeight(), 0, computedValues); + availableHeight = computedValues.m_extent - cb->borderAndPaddingLogicalHeight() - cb->scrollbarLogicalHeight(); } if (availableHeight == -1) @@ -2311,10 +2311,10 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType sizeType, Lengt if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() && !(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) { ASSERT(cb->isRenderBlock()); RenderBlock* block = toRenderBlock(cb); - LayoutUnit oldHeight = block->height(); - block->updateLogicalHeight(); - LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(block->contentHeight()); - block->setHeight(oldHeight); + LogicalExtentComputedValues computedValues; + block->computeLogicalHeight(block->logicalHeight(), 0, computedValues); + LayoutUnit newContentHeight = computedValues.m_extent - block->borderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight(); + LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(newContentHeight); return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, newHeight)); } @@ -2386,11 +2386,10 @@ LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h) const // https://bugs.webkit.org/show_bug.cgi?id=46500 if (isRenderBlock() && isOutOfFlowPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) { RenderBlock* block = const_cast<RenderBlock*>(toRenderBlock(this)); - LayoutUnit oldHeight = block->logicalHeight(); - block->updateLogicalHeight(); - LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSizing(block->contentLogicalHeight()); - block->setLogicalHeight(oldHeight); - return adjustContentBoxLogicalHeightForBoxSizing(newHeight); + LogicalExtentComputedValues computedValues; + block->computeLogicalHeight(block->logicalHeight(), 0, computedValues); + LayoutUnit newContentHeight = computedValues.m_extent - block->borderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight(); + return adjustContentBoxLogicalHeightForBoxSizing(newContentHeight); } // FIXME: This is wrong if the containingBlock has a perpendicular writing mode. diff --git a/Source/WebCore/rendering/RenderDialog.cpp b/Source/WebCore/rendering/RenderDialog.cpp index 4fb940925..b2498ae4c 100644 --- a/Source/WebCore/rendering/RenderDialog.cpp +++ b/Source/WebCore/rendering/RenderDialog.cpp @@ -36,6 +36,7 @@ namespace WebCore { void RenderDialog::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; LayoutRepainter repainter(*this, true); LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode()); diff --git a/Source/WebCore/rendering/RenderEmbeddedObject.cpp b/Source/WebCore/rendering/RenderEmbeddedObject.cpp index 1007dfb39..1e12c7c90 100644 --- a/Source/WebCore/rendering/RenderEmbeddedObject.cpp +++ b/Source/WebCore/rendering/RenderEmbeddedObject.cpp @@ -228,6 +228,7 @@ bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul void RenderEmbeddedObject::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); updateLogicalWidth(); diff --git a/Source/WebCore/rendering/RenderFieldset.cpp b/Source/WebCore/rendering/RenderFieldset.cpp index c180c8536..d663c3b5b 100644 --- a/Source/WebCore/rendering/RenderFieldset.cpp +++ b/Source/WebCore/rendering/RenderFieldset.cpp @@ -123,10 +123,13 @@ RenderObject* RenderFieldset::layoutSpecialExcludedChild(bool relayoutChildren) return legend; } -RenderBox* RenderFieldset::findLegend() const +RenderBox* RenderFieldset::findLegend(FindLegendOption option) const { for (RenderObject* legend = firstChild(); legend; legend = legend->nextSibling()) { - if (!legend->isFloatingOrOutOfFlowPositioned() && legend->node() && (legend->node()->hasTagName(legendTag))) + if (option == IgnoreFloatingOrOutOfFlow && legend->isFloatingOrOutOfFlowPositioned()) + continue; + + if (legend->node() && (legend->node()->hasTagName(legendTag))) return toRenderBox(legend); } return 0; diff --git a/Source/WebCore/rendering/RenderFieldset.h b/Source/WebCore/rendering/RenderFieldset.h index 12dbda502..74ad92b6e 100644 --- a/Source/WebCore/rendering/RenderFieldset.h +++ b/Source/WebCore/rendering/RenderFieldset.h @@ -32,7 +32,8 @@ class RenderFieldset : public RenderBlock { public: explicit RenderFieldset(Node*); - RenderBox* findLegend() const; + enum FindLegendOption { IgnoreFloatingOrOutOfFlow, IncludeFloatingOrOutOfFlow }; + RenderBox* findLegend(FindLegendOption = IgnoreFloatingOrOutOfFlow) const; private: virtual const char* renderName() const { return "RenderFieldSet"; } diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp index baf7747b9..86e655e89 100644 --- a/Source/WebCore/rendering/RenderFlexibleBox.cpp +++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp @@ -664,6 +664,7 @@ LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox* Length flexBasis = flexBasisForChild(child); if (flexBasis.isAuto()) { LayoutUnit mainAxisExtent = hasOrthogonalFlow(child) ? child->logicalHeight() : child->maxPreferredLogicalWidth(); + ASSERT(mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child) >= 0); return mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child); } return std::max(LayoutUnit(0), computeMainAxisExtentForChild(child, MainOrPreferredSize, flexBasis)); diff --git a/Source/WebCore/rendering/RenderFlowThread.cpp b/Source/WebCore/rendering/RenderFlowThread.cpp index 94f8ba694..d054d2457 100644 --- a/Source/WebCore/rendering/RenderFlowThread.cpp +++ b/Source/WebCore/rendering/RenderFlowThread.cpp @@ -132,6 +132,7 @@ private: void RenderFlowThread::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; m_pageLogicalHeightChanged = m_regionsInvalidated && everHadLayout(); if (m_regionsInvalidated) { m_regionsInvalidated = false; diff --git a/Source/WebCore/rendering/RenderFrameSet.cpp b/Source/WebCore/rendering/RenderFrameSet.cpp index 4086cdc67..543c2d353 100644 --- a/Source/WebCore/rendering/RenderFrameSet.cpp +++ b/Source/WebCore/rendering/RenderFrameSet.cpp @@ -459,6 +459,7 @@ FrameEdgeInfo RenderFrameSet::edgeInfo() const void RenderFrameSet::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout(); diff --git a/Source/WebCore/rendering/RenderIFrame.cpp b/Source/WebCore/rendering/RenderIFrame.cpp index 6649d5610..2fcd58a77 100644 --- a/Source/WebCore/rendering/RenderIFrame.cpp +++ b/Source/WebCore/rendering/RenderIFrame.cpp @@ -147,6 +147,7 @@ void RenderIFrame::layoutSeamlessly() void RenderIFrame::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); if (isSeamless()) { diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp index e94fa3ebd..25a62f50b 100644 --- a/Source/WebCore/rendering/RenderImage.cpp +++ b/Source/WebCore/rendering/RenderImage.cpp @@ -533,6 +533,7 @@ void RenderImage::updateAltText() void RenderImage::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; RenderReplaced::layout(); // Propagate container size to image resource. diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index 62606f196..32471d88b 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -619,6 +619,8 @@ TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr makeMatrixRenderable(currTransform, canRender3DTransforms()); return currTransform; } +#else + UNUSED_PARAM(applyOrigin); #endif return *m_transform; diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp index 6e3aa530e..8c147e141 100644 --- a/Source/WebCore/rendering/RenderLayerBacking.cpp +++ b/Source/WebCore/rendering/RenderLayerBacking.cpp @@ -125,7 +125,10 @@ RenderLayerBacking::RenderLayerBacking(RenderLayer* layer) if (TiledBacking* tiledBacking = m_graphicsLayer->tiledBacking()) { Frame* frame = renderer()->frame(); tiledBacking->setIsInWindow(page->isOnscreen()); - tiledBacking->setTileCoverage(frame->view()->canHaveScrollbars() ? TiledBacking::CoverageForScrolling : TiledBacking::CoverageForVisibleArea); + if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) { + bool shouldLimitTileCoverage = !frame->view()->canHaveScrollbars() || scrollingCoordinator->shouldUpdateScrollLayerPositionOnMainThread(); + tiledBacking->setTileCoverage(shouldLimitTileCoverage ? TiledBacking::CoverageForVisibleArea : TiledBacking::CoverageForScrolling); + } tiledBacking->setScrollingPerformanceLoggingEnabled(frame->settings() && frame->settings()->scrollingPerformanceLoggingEnabled()); } } @@ -965,7 +968,7 @@ bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers) return layerChanged; } -void RenderLayerBacking::attachToScrollingCoordinator() +void RenderLayerBacking::attachToScrollingCoordinator(RenderLayerBacking* parent) { // If m_scrollLayerID non-zero, then this backing is already attached to the ScrollingCoordinator. if (m_scrollLayerID) @@ -978,8 +981,9 @@ void RenderLayerBacking::attachToScrollingCoordinator() ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator(); if (!scrollingCoordinator) return; - - m_scrollLayerID = scrollingCoordinator->attachToStateTree(scrollingCoordinator->uniqueScrollLayerID()); + + ScrollingNodeID parentID = parent ? parent->scrollLayerID() : 0; + m_scrollLayerID = scrollingCoordinator->attachToStateTree(scrollingCoordinator->uniqueScrollLayerID(), parentID); } void RenderLayerBacking::detachFromScrollingCoordinator() diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h index 565b308c4..9468fe9d3 100644 --- a/Source/WebCore/rendering/RenderLayerBacking.h +++ b/Source/WebCore/rendering/RenderLayerBacking.h @@ -88,7 +88,7 @@ public: GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLayer.get(); } - void attachToScrollingCoordinator(); + void attachToScrollingCoordinator(RenderLayerBacking* parent); uint64_t scrollLayerID() const { return m_scrollLayerID; } bool hasMaskLayer() const { return m_maskLayer != 0; } diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp index bfc851713..55664c228 100644 --- a/Source/WebCore/rendering/RenderLayerCompositor.cpp +++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp @@ -283,6 +283,9 @@ void RenderLayerCompositor::flushPendingLayerChanges(bool isFlushRoot) if (!isFlushRoot && rootLayerAttachment() == RootLayerAttachedViaEnclosingFrame) return; + if (rootLayerAttachment() == RootLayerUnattached) + return; + AnimationUpdateBlock animationUpdateBlock(m_renderView->frameView()->frame()->animation()); ASSERT(!m_flushingLayers); @@ -510,7 +513,7 @@ bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeR // At this time, the ScrollingCooridnator only supports the top-level frame. if (layer->isRootLayer() && !m_renderView->document()->ownerElement()) { - layer->backing()->attachToScrollingCoordinator(); + layer->backing()->attachToScrollingCoordinator(0); if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) scrollingCoordinator->frameViewRootLayerDidChange(m_renderView->frameView()); } @@ -1097,7 +1100,7 @@ void RenderLayerCompositor::frameViewDidScroll() if (TiledBacking* tiledBacking = frameView->tiledBacking()) { IntRect visibleContentRect = frameView->visibleContentRect(false /* exclude scrollbars */); visibleContentRect.move(toSize(frameView->scrollOrigin())); - tiledBacking->visibleRectChanged(visibleContentRect); + tiledBacking->setVisibleRect(visibleContentRect); } if (!m_scrollLayer) diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp index f67ae82eb..2af9635d4 100644 --- a/Source/WebCore/rendering/RenderListBox.cpp +++ b/Source/WebCore/rendering/RenderListBox.cpp @@ -172,6 +172,7 @@ void RenderListBox::selectionChanged() void RenderListBox::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; RenderBlock::layout(); if (m_vBar) { diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp index 89d99b3e2..84a579460 100644 --- a/Source/WebCore/rendering/RenderListItem.cpp +++ b/Source/WebCore/rendering/RenderListItem.cpp @@ -286,6 +286,7 @@ void RenderListItem::computePreferredLogicalWidths() void RenderListItem::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); updateMarkerLocation(); diff --git a/Source/WebCore/rendering/RenderListMarker.cpp b/Source/WebCore/rendering/RenderListMarker.cpp index a5b0e4cdb..b7cbaa038 100644 --- a/Source/WebCore/rendering/RenderListMarker.cpp +++ b/Source/WebCore/rendering/RenderListMarker.cpp @@ -1302,6 +1302,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse void RenderListMarker::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); if (isImage()) { diff --git a/Source/WebCore/rendering/RenderMedia.cpp b/Source/WebCore/rendering/RenderMedia.cpp index 9af648b02..385fb5068 100644 --- a/Source/WebCore/rendering/RenderMedia.cpp +++ b/Source/WebCore/rendering/RenderMedia.cpp @@ -57,6 +57,7 @@ HTMLMediaElement* RenderMedia::mediaElement() const void RenderMedia::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; LayoutSize oldSize = contentBoxRect().size(); RenderImage::layout(); diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp index e3aa404a1..318a1497e 100755..100644 --- a/Source/WebCore/rendering/RenderObject.cpp +++ b/Source/WebCore/rendering/RenderObject.cpp @@ -2582,6 +2582,7 @@ void RenderObject::scheduleRelayout() void RenderObject::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); RenderObject* child = firstChild(); while (child) { diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h index d1994fca5..1d5e767d4 100644 --- a/Source/WebCore/rendering/RenderObject.h +++ b/Source/WebCore/rendering/RenderObject.h @@ -39,6 +39,7 @@ #include "TextAffinity.h" #include "TransformationMatrix.h" #include <wtf/HashSet.h> +#include <wtf/StackStats.h> #include <wtf/UnusedParam.h> namespace WebCore { diff --git a/Source/WebCore/rendering/RenderRegion.cpp b/Source/WebCore/rendering/RenderRegion.cpp index 11d5aff74..6f3f2e98d 100644 --- a/Source/WebCore/rendering/RenderRegion.cpp +++ b/Source/WebCore/rendering/RenderRegion.cpp @@ -208,6 +208,7 @@ void RenderRegion::styleDidChange(StyleDifference diff, const RenderStyle* oldSt void RenderRegion::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; RenderReplaced::layout(); if (m_flowThread && isValid()) { LayoutRect oldRegionRect(flowThreadPortionRect()); diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp index de87251fb..2cc54930e 100644 --- a/Source/WebCore/rendering/RenderReplaced.cpp +++ b/Source/WebCore/rendering/RenderReplaced.cpp @@ -79,6 +79,7 @@ void RenderReplaced::styleDidChange(StyleDifference diff, const RenderStyle* old void RenderReplaced::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); diff --git a/Source/WebCore/rendering/RenderReplica.cpp b/Source/WebCore/rendering/RenderReplica.cpp index 0879282a6..ad3acf0ba 100644 --- a/Source/WebCore/rendering/RenderReplica.cpp +++ b/Source/WebCore/rendering/RenderReplica.cpp @@ -48,6 +48,7 @@ RenderReplica::~RenderReplica() void RenderReplica::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; setFrameRect(parentBox()->borderBoxRect()); updateLayerTransform(); setNeedsLayout(false); diff --git a/Source/WebCore/rendering/RenderRubyRun.cpp b/Source/WebCore/rendering/RenderRubyRun.cpp index 65d764a9b..8481546f3 100644 --- a/Source/WebCore/rendering/RenderRubyRun.cpp +++ b/Source/WebCore/rendering/RenderRubyRun.cpp @@ -217,6 +217,7 @@ RenderRubyRun* RenderRubyRun::staticCreateRubyRun(const RenderObject* parentRuby RenderObject* RenderRubyRun::layoutSpecialExcludedChild(bool relayoutChildren) { + StackStats::LayoutCheckPoint layoutCheckPoint; // Don't bother positioning the RenderRubyRun yet. RenderRubyText* rt = rubyText(); if (!rt) diff --git a/Source/WebCore/rendering/RenderScrollbarPart.cpp b/Source/WebCore/rendering/RenderScrollbarPart.cpp index f2ca8c640..3eeb1d89f 100644 --- a/Source/WebCore/rendering/RenderScrollbarPart.cpp +++ b/Source/WebCore/rendering/RenderScrollbarPart.cpp @@ -48,6 +48,7 @@ RenderScrollbarPart::~RenderScrollbarPart() void RenderScrollbarPart::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; setLocation(LayoutPoint()); // We don't worry about positioning ourselves. We're just determining our minimum width/height. if (m_scrollbar->orientation() == HorizontalScrollbar) layoutHorizontalPart(); diff --git a/Source/WebCore/rendering/RenderSlider.cpp b/Source/WebCore/rendering/RenderSlider.cpp index 2691106dc..87c4b744c 100644 --- a/Source/WebCore/rendering/RenderSlider.cpp +++ b/Source/WebCore/rendering/RenderSlider.cpp @@ -102,6 +102,7 @@ void RenderSlider::computePreferredLogicalWidths() void RenderSlider::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; // FIXME: Find a way to cascade appearance. // http://webkit.org/b/62535 RenderBox* thumbBox = sliderThumbElementOf(node())->renderBox(); diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp index ee7c8b807..f9bf44609 100644 --- a/Source/WebCore/rendering/RenderTable.cpp +++ b/Source/WebCore/rendering/RenderTable.cpp @@ -341,6 +341,7 @@ void RenderTable::distributeExtraLogicalHeight(int extraLogicalHeight) void RenderTable::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); if (simplifiedLayout()) diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp index b3a0457ea..683321aa7 100644 --- a/Source/WebCore/rendering/RenderTableCell.cpp +++ b/Source/WebCore/rendering/RenderTableCell.cpp @@ -241,6 +241,7 @@ void RenderTableCell::setCellLogicalWidth(int tableLayoutLogicalWidth) void RenderTableCell::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; updateFirstLetter(); layoutBlock(cellWidthChanged()); setCellWidthChanged(false); diff --git a/Source/WebCore/rendering/RenderTableRow.cpp b/Source/WebCore/rendering/RenderTableRow.cpp index c86f14c2c..c3aaf8586 100644 --- a/Source/WebCore/rendering/RenderTableRow.cpp +++ b/Source/WebCore/rendering/RenderTableRow.cpp @@ -151,6 +151,7 @@ void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild) void RenderTableRow::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); // Table rows do not add translation. diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp index 7dce60249..341c90512 100644 --- a/Source/WebCore/rendering/RenderTableSection.cpp +++ b/Source/WebCore/rendering/RenderTableSection.cpp @@ -354,6 +354,7 @@ int RenderTableSection::calcRowLogicalHeight() void RenderTableSection::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); ASSERT(!needsCellRecalc()); ASSERT(!table()->needsSectionRecalc()); diff --git a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp index 1484a2786..967fb2acc 100644 --- a/Source/WebCore/rendering/RenderTextControlSingleLine.cpp +++ b/Source/WebCore/rendering/RenderTextControlSingleLine.cpp @@ -96,6 +96,8 @@ LayoutUnit RenderTextControlSingleLine::computeHeightLimit() const void RenderTextControlSingleLine::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; + // FIXME: We should remove the height-related hacks in layout() and // styleDidChange(). We need them because // - Center the inner elements vertically if the input height is taller than diff --git a/Source/WebCore/rendering/RenderTextTrackCue.cpp b/Source/WebCore/rendering/RenderTextTrackCue.cpp index ef8edda64..4e9dc1552 100644 --- a/Source/WebCore/rendering/RenderTextTrackCue.cpp +++ b/Source/WebCore/rendering/RenderTextTrackCue.cpp @@ -41,6 +41,7 @@ RenderTextTrackCue::RenderTextTrackCue(TextTrackCueBox* node) void RenderTextTrackCue::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; RenderBlock::layout(); LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode()); diff --git a/Source/WebCore/rendering/RenderVideo.cpp b/Source/WebCore/rendering/RenderVideo.cpp index 37f2f0844..02c313ba2 100644 --- a/Source/WebCore/rendering/RenderVideo.cpp +++ b/Source/WebCore/rendering/RenderVideo.cpp @@ -225,6 +225,7 @@ void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf void RenderVideo::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; RenderMedia::layout(); updatePlayer(); } diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp index ef27b370f..d40e53dcf 100644 --- a/Source/WebCore/rendering/RenderView.cpp +++ b/Source/WebCore/rendering/RenderView.cpp @@ -156,6 +156,7 @@ void RenderView::checkLayoutState(const LayoutState& state) void RenderView::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; if (!document()->paginated()) setPageLogicalHeight(0); diff --git a/Source/WebCore/rendering/RenderWidget.cpp b/Source/WebCore/rendering/RenderWidget.cpp index 402bac4fc..977751a73 100644 --- a/Source/WebCore/rendering/RenderWidget.cpp +++ b/Source/WebCore/rendering/RenderWidget.cpp @@ -211,6 +211,7 @@ void RenderWidget::setWidget(PassRefPtr<Widget> widget) void RenderWidget::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); setNeedsLayout(false); diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp index 387fd20cb..6db4bb91c 100644 --- a/Source/WebCore/rendering/style/RenderStyle.cpp +++ b/Source/WebCore/rendering/style/RenderStyle.cpp @@ -664,9 +664,9 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon || rareInheritedData->userSelect != other->rareInheritedData->userSelect || rareNonInheritedData->userDrag != other->rareNonInheritedData->userDrag || rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) || rareNonInheritedData->m_textDecorationStyle != other->rareNonInheritedData->m_textDecorationStyle -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT || rareInheritedData->textFillColor != other->rareInheritedData->textFillColor || rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor || rareInheritedData->textEmphasisColor != other->rareInheritedData->textEmphasisColor diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h index 7715e130d..6a589714e 100644 --- a/Source/WebCore/rendering/style/RenderStyle.h +++ b/Source/WebCore/rendering/style/RenderStyle.h @@ -617,9 +617,9 @@ public: ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); } ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); } ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); } -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); } -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT int wordSpacing() const; int letterSpacing() const; @@ -1148,9 +1148,9 @@ public: void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; } void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; } void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); } -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); } -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT void setDirection(TextDirection v) { inherited_flags._direction = v; } void setLineHeight(Length specifiedLineHeight); bool setZoom(float); @@ -1607,9 +1607,9 @@ public: static Length initialLineHeight() { return Length(-100.0, Percent); } static ETextAlign initialTextAlign() { return TASTART; } static ETextDecoration initialTextDecoration() { return TDNONE; } -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; } -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT static float initialZoom() { return 1.0f; } static int initialOutlineOffset() { return 0; } static float initialOpacity() { return 1.0f; } diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h index a6702253c..c2701f9e7 100644 --- a/Source/WebCore/rendering/style/RenderStyleConstants.h +++ b/Source/WebCore/rendering/style/RenderStyleConstants.h @@ -336,7 +336,7 @@ enum ETextDecoration { inline ETextDecoration operator|(ETextDecoration a, ETextDecoration b) { return ETextDecoration(int(a) | int(b)); } inline ETextDecoration& operator|=(ETextDecoration& a, ETextDecoration b) { return a = a | b; } -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) enum TextDecorationStyle { TextDecorationStyleSolid, TextDecorationStyleDouble, @@ -344,7 +344,7 @@ enum TextDecorationStyle { TextDecorationStyleDashed, TextDecorationStyleWavy }; -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT enum EPageBreak { PBAUTO, PBALWAYS, PBAVOID diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp index 9ddd890dc..6c898960d 100644 --- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp +++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp @@ -76,9 +76,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData() , m_appearance(RenderStyle::initialAppearance()) , m_borderFit(RenderStyle::initialBorderFit()) , m_textCombine(RenderStyle::initialTextCombine()) -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) , m_textDecorationStyle(RenderStyle::initialTextDecorationStyle()) -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT , m_wrapFlow(RenderStyle::initialWrapFlow()) , m_wrapThrough(RenderStyle::initialWrapThrough()) #if USE(ACCELERATED_COMPOSITING) @@ -155,9 +155,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited , m_appearance(o.m_appearance) , m_borderFit(o.m_borderFit) , m_textCombine(o.m_textCombine) -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) , m_textDecorationStyle(o.m_textDecorationStyle) -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT , m_wrapFlow(o.m_wrapFlow) , m_wrapThrough(o.m_wrapThrough) #if USE(ACCELERATED_COMPOSITING) @@ -240,9 +240,9 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c && m_appearance == o.m_appearance && m_borderFit == o.m_borderFit && m_textCombine == o.m_textCombine -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) && m_textDecorationStyle == o.m_textDecorationStyle -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT && m_wrapFlow == o.m_wrapFlow && m_wrapThrough == o.m_wrapThrough #if USE(ACCELERATED_COMPOSITING) diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h index 9a0f44ba6..e3784d4af 100644 --- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h +++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h @@ -178,9 +178,9 @@ public: unsigned m_borderFit : 1; // EBorderFit unsigned m_textCombine : 1; // CSS3 text-combine properties -#if ENABLE(CSS3_TEXT_DECORATION) +#if ENABLE(CSS3_TEXT) unsigned m_textDecorationStyle : 3; // TextDecorationStyle -#endif // CSS3_TEXT_DECORATION +#endif // CSS3_TEXT unsigned m_wrapFlow: 3; // WrapFlow unsigned m_wrapThrough: 1; // WrapThrough diff --git a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp index 380275396..d5e5d0c7a 100644 --- a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp @@ -51,6 +51,7 @@ RenderSVGContainer::~RenderSVGContainer() void RenderSVGContainer::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); // RenderSVGRoot disables layoutState for the SVG rendering tree. diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp index 3b39a8335..2915ede4f 100644 --- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp @@ -123,6 +123,7 @@ void RenderSVGForeignObject::computeLogicalHeight(LayoutUnit, LayoutUnit logical void RenderSVGForeignObject::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree. diff --git a/Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp b/Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp index 46c3e2b64..31d5da5ca 100644 --- a/Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGGradientStop.cpp @@ -64,6 +64,7 @@ void RenderSVGGradientStop::styleDidChange(StyleDifference diff, const RenderSty void RenderSVGGradientStop::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; setNeedsLayout(false); } diff --git a/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp index 895b25449..4d37e13d7 100644 --- a/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp @@ -34,6 +34,7 @@ RenderSVGHiddenContainer::RenderSVGHiddenContainer(SVGStyledElement* element) void RenderSVGHiddenContainer::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); SVGRenderSupport::layoutChildren(this, selfNeedsLayout()); setNeedsLayout(false); diff --git a/Source/WebCore/rendering/svg/RenderSVGImage.cpp b/Source/WebCore/rendering/svg/RenderSVGImage.cpp index 56be5cd41..5487b5e16 100644 --- a/Source/WebCore/rendering/svg/RenderSVGImage.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGImage.cpp @@ -79,6 +79,7 @@ bool RenderSVGImage::updateImageViewport() void RenderSVGImage::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout()); diff --git a/Source/WebCore/rendering/svg/RenderSVGPath.cpp b/Source/WebCore/rendering/svg/RenderSVGPath.cpp index cf658359d..cf658359d 100755..100644 --- a/Source/WebCore/rendering/svg/RenderSVGPath.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGPath.cpp diff --git a/Source/WebCore/rendering/svg/RenderSVGRect.cpp b/Source/WebCore/rendering/svg/RenderSVGRect.cpp index c7f9c5b7b..c7f9c5b7b 100755..100644 --- a/Source/WebCore/rendering/svg/RenderSVGRect.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGRect.cpp diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp index 51858e5bd..310e586b9 100644 --- a/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp @@ -54,6 +54,7 @@ RenderSVGResourceContainer::~RenderSVGResourceContainer() void RenderSVGResourceContainer::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; // Invalidate all resources if our layout changed. if (everHadLayout() && selfNeedsLayout()) RenderSVGRoot::addResourceForClientInvalidation(this); diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp index 784559e21..7aaef0e9e 100644 --- a/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp @@ -48,6 +48,7 @@ RenderSVGResourceMarker::~RenderSVGResourceMarker() void RenderSVGResourceMarker::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; // Invalidate all resources if our layout changed. if (everHadLayout() && selfNeedsLayout()) RenderSVGRoot::addResourceForClientInvalidation(this); diff --git a/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp b/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp index 3a1882acf..b3c0b0bd1 100644 --- a/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp @@ -126,8 +126,9 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle* return false; // Compute pattern space transformation. + const IntSize tileImageSize = tileImage->logicalSize(); patternData->transform.translate(tileBoundaries.x(), tileBoundaries.y()); - patternData->transform.scale(tileBoundaries.width() / clampedAbsoluteTileBoundaries.width(), tileBoundaries.height() / clampedAbsoluteTileBoundaries.height()); + patternData->transform.scale(tileBoundaries.width() / tileImageSize.width(), tileBoundaries.height() / tileImageSize.height()); AffineTransform patternTransform = m_attributes.patternTransform(); if (!patternTransform.isIdentity()) diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp index c47a7bb4e..797b70ea7 100644 --- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp @@ -218,6 +218,7 @@ LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const void RenderSVGRoot::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); m_resourcesNeedingToInvalidateClients.clear(); diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.cpp b/Source/WebCore/rendering/svg/RenderSVGShape.cpp index 62a8c99ba..5dceac3ef 100755..100644 --- a/Source/WebCore/rendering/svg/RenderSVGShape.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGShape.cpp @@ -144,6 +144,7 @@ bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke void RenderSVGShape::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout()); SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node()); diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp index fd8bea043..200cd497c 100644 --- a/Source/WebCore/rendering/svg/RenderSVGText.cpp +++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp @@ -347,6 +347,7 @@ static inline void updateFontInAllDescendants(RenderObject* start, SVGTextLayout void RenderSVGText::layout() { + StackStats::LayoutCheckPoint layoutCheckPoint; ASSERT(needsLayout()); LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); diff --git a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp index 12352ae72..12352ae72 100755..100644 --- a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp +++ b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp diff --git a/Source/WebCore/svg/SVGElement.h b/Source/WebCore/svg/SVGElement.h index c3e6b61f7..bd45f536a 100644 --- a/Source/WebCore/svg/SVGElement.h +++ b/Source/WebCore/svg/SVGElement.h @@ -159,8 +159,10 @@ private: struct SVGAttributeHashTranslator { static unsigned hash(const QualifiedName& key) { - if (key.hasPrefix()) - return DefaultHash<QualifiedName>::Hash::hash(QualifiedName(nullAtom, key.localName(), key.namespaceURI())); + if (key.hasPrefix()) { + QualifiedNameComponents components = { nullAtom.impl(), key.localName().impl(), key.namespaceURI().impl() }; + return hashComponents(components); + } return DefaultHash<QualifiedName>::Hash::hash(key); } static bool equal(const QualifiedName& a, const QualifiedName& b) { return a.matches(b); } diff --git a/Source/WebCore/svg/SVGURIReference.cpp b/Source/WebCore/svg/SVGURIReference.cpp index 1736312fc..1736312fc 100755..100644 --- a/Source/WebCore/svg/SVGURIReference.cpp +++ b/Source/WebCore/svg/SVGURIReference.cpp diff --git a/Source/WebCore/svg/SVGURIReference.h b/Source/WebCore/svg/SVGURIReference.h index 1b6e8e9ec..1b6e8e9ec 100755..100644 --- a/Source/WebCore/svg/SVGURIReference.h +++ b/Source/WebCore/svg/SVGURIReference.h diff --git a/Source/WebCore/svg/SVGUseElement.cpp b/Source/WebCore/svg/SVGUseElement.cpp index d19ea195d..d19ea195d 100755..100644 --- a/Source/WebCore/svg/SVGUseElement.cpp +++ b/Source/WebCore/svg/SVGUseElement.cpp diff --git a/Source/WebCore/svg/SVGUseElement.h b/Source/WebCore/svg/SVGUseElement.h index 46ee8b341..46ee8b341 100755..100644 --- a/Source/WebCore/svg/SVGUseElement.h +++ b/Source/WebCore/svg/SVGUseElement.h diff --git a/Source/WebCore/testing/InternalSettings.cpp b/Source/WebCore/testing/InternalSettings.cpp index 8d8f0cb40..8d8f0cb40 100755..100644 --- a/Source/WebCore/testing/InternalSettings.cpp +++ b/Source/WebCore/testing/InternalSettings.cpp diff --git a/Source/WebCore/testing/InternalSettings.h b/Source/WebCore/testing/InternalSettings.h index 78f36e017..78f36e017 100755..100644 --- a/Source/WebCore/testing/InternalSettings.h +++ b/Source/WebCore/testing/InternalSettings.h diff --git a/Source/WebCore/testing/InternalSettings.idl b/Source/WebCore/testing/InternalSettings.idl index f3464be9a..f3464be9a 100755..100644 --- a/Source/WebCore/testing/InternalSettings.idl +++ b/Source/WebCore/testing/InternalSettings.idl |
