[GTK] Memory leak in webkitwebnavigationaction.cpp
https://bugs.webkit.org/show_bug.cgi?id=90787

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-07-09
Reviewed by Martin Robinson.

Fixed a memory leak in WebKitWebNavigationAction.

* webkit/webkitwebnavigationaction.cpp:
(webkit_web_navigation_action_finalize): Free the g_strdup()'d string.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] Unskip the CSS Regions layout tests
https://bugs.webkit.org/show_bug.cgi?id=90771

Reviewed by Martin Robinson.

Source/WebKit/gtk: 

Add a method to DumpRenderTreeSupportGtk for enabling or disabling
CSS Regions from DumpRenderTree.

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::setCSSRegionsEnabled):
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
(DumpRenderTreeSupportGtk):

Tools: 

Use the DumpRenderTreeSupportGtk method for enabling the CSS Regions,
calling it when resetting the defaults in DumpRenderTree or when the
settings value is overriden through the testRunner.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues):
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::overridePreference):

LayoutTests: 

Unskip CSS Regions tests, updating baselines for the affected tests.

* platform/gtk/TestExpectations:
* platform/gtk/fast/regions/bottom-overflow-out-of-first-region-expected.png: Added.
* platform/gtk/fast/regions/bottom-overflow-out-of-first-region-expected.txt:
* platform/gtk/fast/regions/flow-content-basic-expected.png: Added.
* platform/gtk/fast/regions/flow-content-basic-expected.txt:
* platform/gtk/fast/regions/flow-content-basic-vertical-expected.png: Added.
* platform/gtk/fast/regions/flow-content-basic-vertical-expected.txt:
* platform/gtk/fast/regions/flow-content-basic-vertical-rl-expected.png: Added.
* platform/gtk/fast/regions/flow-content-basic-vertical-rl-expected.txt:
* platform/gtk/fast/regions/flows-dependency-dynamic-remove-expected.png: Added.
* platform/gtk/fast/regions/flows-dependency-dynamic-remove-expected.txt:
* platform/gtk/fast/regions/flows-dependency-same-flow-expected.png: Added.
* platform/gtk/fast/regions/flows-dependency-same-flow-expected.txt:
* platform/gtk/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.png: Added.
* platform/gtk/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/overflow-in-uniform-regions-dynamic-expected.png: Added.
* platform/gtk/fast/regions/overflow-in-uniform-regions-dynamic-expected.txt:
* platform/gtk/fast/regions/overflow-in-variable-width-regions-expected.png: Added.
* platform/gtk/fast/regions/overflow-in-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/overflow-moving-below-floats-in-variable-width-regions-expected.png: Added.
* platform/gtk/fast/regions/overflow-moving-below-floats-in-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/overflow-not-moving-below-floats-in-variable-width-regions-expected.png: Added.
* platform/gtk/fast/regions/overflow-not-moving-below-floats-in-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/overflow-rtl-in-variable-width-regions-expected.png: Added.
* platform/gtk/fast/regions/overflow-rtl-in-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/overflow-size-change-in-variable-width-regions-expected.png: Added.
* platform/gtk/fast/regions/overflow-size-change-in-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/overflow-size-change-with-stacking-context-expected.png: Added.
* platform/gtk/fast/regions/overflow-size-change-with-stacking-context-expected.txt:
* platform/gtk/fast/regions/overflow-size-change-with-stacking-context-rtl-expected.png: Added.
* platform/gtk/fast/regions/overflow-size-change-with-stacking-context-rtl-expected.txt:
* platform/gtk/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.png: Added.
* platform/gtk/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt:
* platform/gtk/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.png: Added.
* platform/gtk/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt:
* platform/gtk/fast/regions/percentage-margins-rtl-variable-width-regions-expected.png: Added.
* platform/gtk/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/percentage-margins-variable-width-regions-expected.png: Added.
* platform/gtk/fast/regions/percentage-margins-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/region-overflow-auto-overflow-hidden-expected.png: Added.
* platform/gtk/fast/regions/region-overflow-auto-overflow-hidden-expected.txt:
* platform/gtk/fast/regions/region-overflow-auto-overflow-visible-expected.png: Added.
* platform/gtk/fast/regions/region-overflow-auto-overflow-visible-expected.txt:
* platform/gtk/fast/regions/region-style-block-background-color-expected.png: Added.
* platform/gtk/fast/regions/region-style-block-background-color-expected.txt:
* platform/gtk/fast/regions/region-style-block-background-color2-expected.png: Added.
* platform/gtk/fast/regions/region-style-block-background-color2-expected.txt:
* platform/gtk/fast/regions/text-region-split-small-pagination-expected.png: Added.
* platform/gtk/fast/regions/text-region-split-small-pagination-expected.txt:
* platform/gtk/fast/regions/top-overflow-out-of-second-region-expected.png: Added.
* platform/gtk/fast/regions/top-overflow-out-of-second-region-expected.txt:
* platform/gtk/fast/regions/webkit-flow-double-pagination-float-push-expected.png: Added.
* platform/gtk/fast/regions/webkit-flow-double-pagination-float-push-expected.txt:
* platform/gtk/fast/regions/webkit-flow-float-pushed-to-last-region-expected.png: Added.
* platform/gtk/fast/regions/webkit-flow-float-pushed-to-last-region-expected.txt:
* platform/gtk/fast/regions/webkit-flow-float-unable-to-push-expected.png: Added.
* platform/gtk/fast/regions/webkit-flow-float-unable-to-push-expected.txt:
* platform/gtk/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.png: Added.
* platform/gtk/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.txt:
* platform/gtk/fast/regions/webkit-flow-inlines-inside-regions-bounds-expected.png: Added.
* platform/gtk/fast/regions/webkit-flow-inlines-inside-regions-bounds-expected.txt:
* platform/gtk/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-expected.png: Added.
* platform/gtk/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-expected.txt:
* platform/gtk/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-rl-expected.png: Added.
* platform/gtk/fast/regions/webkit-flow-inlines-inside-regions-bounds-vertical-rl-expected.txt:
* platform/gtk/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png:
* platform/gtk/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-in-regions-expected.png:
* platform/gtk/fast/repaint/line-flow-with-floats-in-regions-expected.txt:
* platform/gtk/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.png:
* platform/gtk/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt:
* platform/gtk/fast/repaint/region-painting-invalidation-expected.png:
* platform/gtk/fast/repaint/region-painting-invalidation-expected.txt:
* platform/gtk/fast/repaint/region-painting-via-layout-expected.png:
* platform/gtk/fast/repaint/region-painting-via-layout-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add a setting to enable/disable page cache to WebKit2 GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=90773

Reviewed by Martin Robinson.

* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_page_cache):
(webkit_settings_set_enable_page_cache):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
* UIProcess/API/gtk/tests/TestWebKitSettings.cpp:
(testWebKitSettings):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: unindent line ending block upon { hit.
https://bugs.webkit.org/show_bug.cgi?id=90795

Reviewed by Vsevolod Vlasov.

Added block-start / block-end markup into the highlighter.

* inspector/front-end/SourceCSSTokenizer.js:
(WebInspector.SourceCSSTokenizer.prototype.nextToken):
* inspector/front-end/SourceCSSTokenizer.re2js:
* inspector/front-end/SourceJavaScriptTokenizer.js:
(WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
* inspector/front-end/SourceJavaScriptTokenizer.re2js:
* inspector/front-end/TextEditor.js:
(WebInspector.TextEditorMainPanel.prototype._applyDomUpdates):
(WebInspector.TextEditorMainPanel.prototype._unindentAfterBlock):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make HTMLCollection RefCounted
https://bugs.webkit.org/show_bug.cgi?id=90414

Reviewed by Sam Weinig.

Source/WebCore: 

Make HTMLCollection ref counted and stop forwarding ref and deref to its owner (m_base)
so as to align its life time management to that of DynamicNodeList.

After this patch, each HTMLCollection is owned by JSC/V8 and m_cachedCollections in ElementRareData
and m_collection in Document merely hold raw pointers for the caching purpose. These raw pointers
are cleared when each HTMLCollection is destructed via corresponding removeCachedHTMLCollection's.

In the destructor of HTMLCollection, we use the CollectionType to decide whether base() is an element
or an document, and call the appropriate removeCachedHTMLCollection except for WindowNamedItems and
DocumentNamedItems. For those two types, we need to know the atomic string name associated with
the collection just like many DynamicNodeList to remove the cache, so we let HTMLNameCollection
directly call removeWindowNamedItemCache and removeDocumentNamedItemCache. We'll cleanup this mess in
a follow up patch using a nice class hierarchy and virtual destructors.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::getDocumentLinks):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::namedPropertyGetter):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::openSearchDescriptionURL):
(WebCore):
(WebCore::Document::cachedCollection):
(WebCore::Document::removeCachedHTMLCollection):
(WebCore::Document::images):
(WebCore::Document::applets):
(WebCore::Document::embeds):
(WebCore::Document::plugins):
(WebCore::Document::objects):
(WebCore::Document::scripts):
(WebCore::Document::links):
(WebCore::Document::forms):
(WebCore::Document::anchors):
(WebCore::Document::all):
(WebCore::Document::windowNamedItems):
(WebCore::Document::documentNamedItems):
(WebCore::Document::removeWindowNamedItemCache):
(WebCore::Document::removeDocumentNamedItemCache):
* dom/Document.h:
(Document):
* dom/Element.cpp:
(WebCore::Element::ensureCachedHTMLCollection):
(WebCore::ElementRareData::ensureCachedHTMLCollection):
(WebCore::Element::removeCachedHTMLCollection):
(WebCore):
* dom/Element.h:
(Element):
* dom/ElementRareData.h:
(ElementRareData):
(WebCore::ElementRareData::cachedHTMLCollection):
(WebCore::ElementRareData::removeCachedHTMLCollection):
* html/CollectionType.h:
(WebCore): Since WindowNamedItems is not a part of UnnamedDocumentCachedType, we shouldn't addd 1.
(WebCore::isUnnamedDocumentCachedType):
(WebCore::isNodeCollectionType):
* html/HTMLAllCollection.cpp:
(WebCore::HTMLAllCollection::create):
* html/HTMLAllCollection.h:
(HTMLAllCollection):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::create):
(WebCore::HTMLCollection::~HTMLCollection):
(WebCore::HTMLCollection::itemAfter):
* html/HTMLCollection.h:
(WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase):
(HTMLCollection):
(WebCore::HTMLCollection::base):
* html/HTMLDataListElement.cpp:
(WebCore::HTMLDataListElement::options):
* html/HTMLDataListElement.h:
(HTMLDataListElement):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::children):
(WebCore::HTMLElement::properties):
* html/HTMLElement.h:
(HTMLElement):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::elements):
* html/HTMLFieldSetElement.h:
(HTMLFieldSetElement):
* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::create):
* html/HTMLFormCollection.h:
(HTMLFormCollection):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::elements):
* html/HTMLFormElement.h:
(HTMLFormElement):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):
(WebCore::HTMLMapElement::areas):
* html/HTMLMapElement.h:
(HTMLMapElement):
* html/HTMLNameCollection.cpp:
(WebCore::HTMLNameCollection::HTMLNameCollection):
(WebCore::HTMLNameCollection::~HTMLNameCollection):
(WebCore):
* html/HTMLNameCollection.h:
(WebCore::HTMLNameCollection::create):
(HTMLNameCollection):
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::create):
* html/HTMLOptionsCollection.h:
(HTMLOptionsCollection):
* html/HTMLPropertiesCollection.h:
(HTMLPropertiesCollection):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::selectedOptions):
(WebCore::HTMLSelectElement::options):
* html/HTMLSelectElement.h:
(HTMLSelectElement):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::rows):
(WebCore::HTMLTableElement::tBodies):
* html/HTMLTableElement.h:
(HTMLTableElement):
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::insertCell):
(WebCore::HTMLTableRowElement::deleteCell):
(WebCore::HTMLTableRowElement::cells):
* html/HTMLTableRowElement.h:
(HTMLTableRowElement):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::create):
* html/HTMLTableRowsCollection.h:
(HTMLTableRowsCollection):
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::insertRow):
(WebCore::HTMLTableSectionElement::deleteRow):
(WebCore::HTMLTableSectionElement::rows):
* html/HTMLTableSectionElement.h:
(HTMLTableSectionElement):

Source/WebKit/chromium: 

* src/WebPageSerializer.cpp:
(WebCore::retrieveResourcesForFrame):
* src/WebPageSerializerImpl.cpp:
(WebKit::WebPageSerializerImpl::collectTargetFrames):

Source/WebKit/win: 

* DOMHTMLClasses.cpp:
(DOMHTMLDocument::forms):
(DOMHTMLSelectElement::options):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make GC3D and E3D more maintainable for GLES platforms
https://bugs.webkit.org/show_bug.cgi?id=90567

Patch by Joshua Netterfield <jnetterfield@rim.com> on 2012-07-09
Reviewed by Rob Buis.

This patch cleans up code for WebGL on OpenGLES platforms which use
GraphicsContext3DOpenGL* and Extensions3DOpenGL*. Although
GraphicsContext3DOpenGL was already split into GraphicsContext3DOpenGL,
GraphicsContext3DOpenGLCommon, and  GraphicsContext3DOpenGLES, this patch
is an attempt to refactor this code in a way that will help BlackBerry and
other teams support WebGL on mobile platforms with as little use of
"#IF USE(OPENGL_ES_2)" in common code as possible. Also included is the
separation of Extensions3DOpenGL into Extensions3DOpenGLCommon,
Extensions3DOpenGL, and Extensions3DOpenGLES as well as the introduction
of OpenGLESShims.

This patch is created in large part by Jonathan Feldstein.

No new tests: no new behaviour.

* PlatformBlackBerry.cmake: Recognize BlackBerry as OPENGL ES, add new files to build
* Target.pri: Add new Extensions3DOpenGL* to WebGL builds
* platform/graphics/GraphicsContext3D.h: Add validateDepthStencil, make systemAllowsMultisamplingOnATICards a a member function.
(WebCore):
* platform/graphics/OpenGLESShims.h: Added.
* platform/graphics/opengl/Extensions3DOpenGL.cpp: Move code to Extensions3DOpenGLCommon where possible
(WebCore::Extensions3DOpenGL::Extensions3DOpenGL): Reflect that it is now inherits Extensions3DCommon
(WebCore::Extensions3DOpenGL::supportsExtension): Contains OpenGL specific code from supports
(WebCore):
(WebCore::Extensions3DOpenGL::getExtensions): Returns a list of extensions
* platform/graphics/opengl/Extensions3DOpenGL.h: Remove functions now in Extensions3DOpenGLCommon
(WebCore):
(Extensions3DOpenGL):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: Added.
(WebCore):
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
(WebCore::Extensions3DOpenGLCommon::~Extensions3DOpenGLCommon):
(WebCore::Extensions3DOpenGLCommon::supports):
(WebCore::Extensions3DOpenGLCommon::ensureEnabled):
(WebCore::Extensions3DOpenGLCommon::isEnabled):
(WebCore::Extensions3DOpenGLCommon::getGraphicsResetStatusARB):
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): Existed before, but did nothing. Now does what is says it does.
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions): Moved from Extensions3DOpenGL::supports
* platform/graphics/opengl/Extensions3DOpenGLCommon.h: Copied from Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h.
(WebCore):
(Extensions3DOpenGLCommon):
* platform/graphics/opengl/Extensions3DOpenGLES.cpp: Added.
(WebCore):
(WebCore::Extensions3DOpenGLES::Extensions3DOpenGLES):
(WebCore::Extensions3DOpenGLES::~Extensions3DOpenGLES):
(WebCore::Extensions3DOpenGLES::framebufferTexture2DMultisampleIMG):
(WebCore::Extensions3DOpenGLES::renderbufferStorageMultisampleIMG):
(WebCore::Extensions3DOpenGLES::createVertexArrayOES):
(WebCore::Extensions3DOpenGLES::deleteVertexArrayOES):
(WebCore::Extensions3DOpenGLES::isVertexArrayOES):
(WebCore::Extensions3DOpenGLES::bindVertexArrayOES):
(WebCore::Extensions3DOpenGLES::supportsExtension): Contains OpenGLES specific code from supports
(WebCore::Extensions3DOpenGLES::getExtensions):
* platform/graphics/opengl/Extensions3DOpenGLES.h: Copied from Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h.
(WebCore):
(Extensions3DOpenGLES):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::validateAttributes):
(WebCore):
(WebCore::GraphicsContext3D::renderbufferStorage):
(WebCore::GraphicsContext3D::texImage2D):
(WebCore::GraphicsContext3D::systemAllowsMultisamplingOnATICards): Now a member function.
(WebCore::GraphicsContext3D::getExtensions):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::validateDepthStencil):
(WebCore::GraphicsContext3D::clear):
(WebCore::GraphicsContext3D::isTexture):
(WebCore):
(WebCore::GraphicsContext3D::lineWidth):
(WebCore::GraphicsContext3D::linkProgram):
(WebCore::GraphicsContext3D::pixelStorei):
(WebCore::GraphicsContext3D::polygonOffset):
(WebCore::GraphicsContext3D::readPixels):
(WebCore::GraphicsContext3D::deleteBuffer):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::releaseShaderCompiler):
(WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
(WebCore::GraphicsContext3D::validateAttributes):
(WebCore):
(WebCore::GraphicsContext3D::getExtensions):
(WebCore::GraphicsContext3D::systemAllowsMultisamplingOnATICards): Now a member function.
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore):
(WebCore::GraphicsContext3D::releaseShaderCompiler):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed clean builds of the All target in the DumpRenderTree project.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Let Xcode know that the
DumpRenderTree Perl Support target depends on the DumpRenderTree target.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
EFL build fix after r122115.

* html/HTMLPropertiesCollection.cpp:
(WebCore::HTMLPropertiesCollection::create):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac build fix after r122116.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Create render surfaces on main thread only for the current frame
https://bugs.webkit.org/show_bug.cgi?id=89793

Reviewed by Adrienne Walker.

Source/WebCore:

Previously we would create render surfaces for animating layers
in the main thread since these layers might have a surface on impl,
in order to assist culling. This makes it very difficult to estimate
how much texture memory is needed for RenderSurfaces on the main
thread, in order to keep contents+surface memory below our limit.

Here we stop doing this, and create RenderSurfaces on both threads
under the same conditions, so main thread has surfaces only if the
layers in its current frame demand them. While this may reduce
paint culling within an animating subtree, this seems like an edge
case and knowing the amount of surface memory needed for the frame
is important.

Animation tests in CCLayerTreeHostCommonTest used to verify that these
layers got surfaces, so now no longer do. Creation of surfaces under
other conditions is covered by other CCLayerTreeHostCommonTests.

* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::subtreeShouldRenderToSeparateSurface):

Source/WebKit/chromium:

* tests/CCLayerTreeHostCommonTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][NRWT] Enable cascaded TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=89108

Patch by János Badics <jbadics@inf.u-szeged.hu> on 2012-07-09
Reviewed by Dirk Pranke.

* Scripts/webkitpy/layout_tests/port/qt.py:
(QtPort.expectations_files):
* Scripts/webkitpy/layout_tests/port/qt_unittest.py:
(QtPortTest._assert_expectations_files):
(QtPortTest.test_expectations_files):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Empty arrays shouldn't be valid key paths
https://bugs.webkit.org/show_bug.cgi?id=90798

Reviewed by Tony Chang.

Source/WebCore:

Other IDB implementations already enforce this although it is not yet in
the spec (see https://www.w3.org/Bugs/Public/show_bug.cgi?id=17657). If an
empty array is passed as the key path arg to IDBDatabase.createObjectStore()
or IDBObjectStore.createIndex(), a SYNTAX_ERR DOMException is now thrown.

Test: storage/indexeddb/keypath-arrays.html
      storage/indexeddb/keypath-basics.html

* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::isValid): Test for empty array.

LayoutTests:

* storage/indexeddb/keypath-arrays-expected.txt:
* storage/indexeddb/keypath-basics-expected.txt:
* storage/indexeddb/resources/keypath-arrays.js:
(openSuccess.request.onsuccess):
(openSuccess):
* storage/indexeddb/resources/keypath-basics.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Filters] Blur filter is not repainted correctly when applied on a parent of a fixed element
https://bugs.webkit.org/show_bug.cgi?id=90087

Reviewed by Simon Fraser.

Source/WebCore:

Added a new method, RenderLayer::hasAncestorWithFilterOutsets, to check that there's no filter with outsets (ie. blur)
applied on top level fixed positioned elements, nor any of its parent layers. In the event of a blur filter we need to
disable the fast scrolling optimization, otherwise the outsets of the filter will be carried around the page and
repainting will not work correctly.

Tests: css3/filters/blur-filter-page-scroll-parents.html
       css3/filters/blur-filter-page-scroll-self.html

* page/FrameView.cpp:
(WebCore::FrameView::scrollContentsFastPath):
* rendering/RenderLayer.cpp:
(WebCore):
(WebCore::RenderLayer::hasAncestorWithFilterOutsets):
* rendering/RenderLayer.h:
(RenderLayer):

LayoutTests:

Added two new tests to check that we disable fast path scrolling for fixed positioned
elements that have blur applied on them or any of the parent layers.

* css3/filters/blur-filter-page-scroll-parents.html: Added.
* css3/filters/blur-filter-page-scroll-self.html: Added.
* platform/chromium/css3/filters/blur-filter-page-scroll-parents-expected.png: Added.
* platform/chromium/css3/filters/blur-filter-page-scroll-parents-expected.txt: Added.
* platform/chromium/css3/filters/blur-filter-page-scroll-self-expected.png: Added.
* platform/chromium/css3/filters/blur-filter-page-scroll-self-expected.txt: Added.
* platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.png: Added.
* platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.txt: Added.
* platform/mac/css3/filters/blur-filter-page-scroll-self-expected.png: Added.
* platform/mac/css3/filters/blur-filter-page-scroll-self-expected.txt: Added.
* platform/qt/Skipped: Qt needs platform results.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Update TestExpectations after filename change in r122109.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] [WK2] Ecore errors from ecore_evas_screen_geometry_get()
https://bugs.webkit.org/show_bug.cgi?id=90609

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-07-09
Reviewed by Daniel Bates.

Do not call ecore_evas_screen_geometry_get() if ecoreEvas is null.

No new tests. This patch doesn't change behavior.

* platform/efl/PlatformScreenEfl.cpp:
(WebCore::screenRect): Early return if Evas is null.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] meta viewport initial-scale doesn't factor in device pixel ratio
https://bugs.webkit.org/show_bug.cgi?id=90575

Patch by Mike Lattanzio <mlattanzio@rim.com> on 2012-07-09
Reviewed by Rob Buis.

.:

Add a manual test to verify wide content doesn't interfere
with initial-scale calculations.

Internal review from Konrad Piascik.

* ManualTests/blackberry/meta-viewport-initial-scale-wide-content.html: Added.

Source/WebKit/blackberry:

Refactor meta viewport handling to multiply the developer
specified scale properties by the devicePixelRatio. This
required moving the setting of these values until after
the call to computeViewportAttributes.

This fixes an isssue where content wider than the meta viewport
would case a zoom-out-to-fit scenario because we misinterpreted
the specified initial-scale.

New test to verify wide content doesn't affect initial-scale:
ManualTests/blackberry/meta-viewport-initial-scale-wide-content.html

Internal review from Konrad Piascik, Arvid Nilsson.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
(BlackBerry::WebKit::WebPagePrivate::dispatchViewportPropertiesDidChange):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] [WK2] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key)
https://bugs.webkit.org/show_bug.cgi?id=90464

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-07-09
Reviewed by Daniel Bates.

HashMap has the property that 0 is the empty value for integer
keys, so do not use 0 as a key in the HashMap.

* Platform/efl/WorkQueueEfl.cpp:
(WorkQueue::dispatchAfterDelay):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SurroundingText should not advance character iterators if they are at end.
https://bugs.webkit.org/show_bug.cgi?id=90560

Reviewed by Ryosuke Niwa.

Source/WebCore:

CharacterIterator and BackwardsCharacterIterator try to advance their
internal TextIterator without checking if they already are at end.
This can cause crashes in TextIterator::advance.

Test: platform/chromium/editing/surrounding-text/surrounding-text.html

* editing/SurroundingText.cpp:
(WebCore::SurroundingText::SurroundingText):
(WebCore::SurroundingText::rangeFromContentOffsets):

Source/WebKit/chromium:

Moving the check for null visible positions to WebCore as it makes no
sense to be in a platform-specific code.

* src/WebSurroundingText.cpp:
(WebKit::WebSurroundingText::initialize):

LayoutTests:

Add a new test case where character iterators are already at end when
trying to advance. This was caught by Chromium's address sanitizer
here: http://code.google.com/p/chromium/issues/detail?id=135705

* platform/chromium/editing/surrounding-text/surrounding-text-expected.txt:
* platform/chromium/editing/surrounding-text/surrounding-text.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce the amount of flashing when falling into tiled layers
https://bugs.webkit.org/show_bug.cgi?id=90808

Reviewed by Dean Jackson.

Implement +prefetchedTiles so that CATiledLayer renders more
tiles at a time, reducing the appearance of flashing.

* platform/graphics/mac/WebTiledLayer.mm:
(+[WebTiledLayer prefetchedTiles]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] Implement dumpFrameScrollPosition in DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=89356

Reviewed by Martin Robinson.

Source/WebKit/gtk: 

Add a new method for returning the WebKitDOMDocument that is loaded
in a given frame, webkit_web_frame_get_dom_document.

* docs/webkitgtk-sections.txt:
* webkit/webkitwebframe.cpp:
(webkit_web_frame_get_dom_document):
* webkit/webkitwebframe.h:
* webkit/webkitwebview.cpp: State explicitly that the document being returned
when calling webkit_web_view_get_dom_document is loaded in the main frame.
Also call the webkit_web_frame_get_dom_document on WebKitWebView's main frame
to get the document.

Tools: 

Implement dumpFrameScrollPosition, acquiring the scroll position
through WebKitDOMDOMWindow of the WebKitDOMDocument loaded in the frame
whose scroll position is being dumped.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(dumpFrameScrollPosition):

LayoutTests: 

Update baselines for affected tests, removing these tests from the GTK WK2 Skipped list.

* platform/gtk-wk2/Skipped:
* platform/gtk/css2.1/20110323/abspos-containing-block-initial-001-expected.txt:
* platform/gtk/fast/block/positioning/rtl-fixed-positioning-expected.txt:
* platform/gtk/fast/block/positioning/vertical-rl/fixed-positioning-expected.txt:
* platform/gtk/fast/dom/focus-contenteditable-expected.txt:
* platform/gtk/fast/dom/rtl-scroll-to-leftmost-and-resize-expected.txt:
* platform/gtk/fast/dom/scroll-reveal-left-overflow-expected.txt:
* platform/gtk/fast/dom/scroll-reveal-top-overflow-expected.txt:
* platform/gtk/fast/dynamic/anchor-lock-expected.txt:
* platform/gtk/fast/events/autoscroll-expected.txt:
* platform/gtk/fast/events/reveal-link-when-focused-expected.txt:
* platform/gtk/fast/frames/flattening/iframe-flattening-out-of-view-and-scroll-expected.txt:
* platform/gtk/fast/frames/flattening/iframe-flattening-out-of-view-scroll-and-relayout-expected.txt:
* platform/gtk/fast/layers/scroll-rect-to-visible-expected.txt:
* platform/gtk/fast/multicol/scrolling-overflow-expected.txt: Added.
* platform/gtk/fast/overflow/clip-rects-fixed-ancestor-expected.txt: Added.
* platform/gtk/fast/overflow/overflow_hidden-expected.txt:
* platform/gtk/fast/overflow/position-fixed-transform-clipping-expected.txt:
* platform/gtk/fast/overflow/scrollRevealButton-expected.txt:
* platform/gtk/fast/repaint/fixed-child-move-after-scroll-expected.txt:
* platform/gtk/fast/repaint/fixed-child-of-fixed-move-after-scroll-expected.txt:
* platform/gtk/fast/repaint/fixed-child-of-transformed-move-after-scroll-expected.txt:
* platform/gtk/fast/repaint/fixed-expected.txt:
* platform/gtk/fast/repaint/fixed-move-after-scroll-expected.txt:
* platform/gtk/fast/repaint/fixed-tranformed-expected.txt:
* platform/gtk/fast/repaint/repaint-during-scroll-expected.txt:
* platform/gtk/svg/custom/getscreenctm-in-scrollable-svg-area-expected.txt:
* platform/gtk/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt:
* platform/gtk/transforms/2d/transform-fixed-container-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122147 268f45cc-cd09-0410-ab3c-d52691b4dbfc