[chromium] Evict textures through the texture manager instead of the resource provider
https://bugs.webkit.org/show_bug.cgi?id=96463

Patch by Christopher Cameron <ccameron@chromium.org> on 2012-09-12
Reviewed by James Robinson.

Source/WebCore:

When deleting contents textures' resources on the impl thread, do the
deletion through the CCPrioritizedTextureManager instead of the
CCResourceProvider.

This requires traversing the backings list on the impl thread while
the main thread is running, so remove the one remaining traversal of
the backings list by the main thread. This traversal happens when
unlinking textures that were evicted by the impl thread, so explicitly
send the list of evicted backings from the impl thread to the main thread.

Unify all resource deletion paths in the CCPrioritizedTextureManager.
Always perform the sequence of eviction (deleting the GL resource) and
then destruction of evicted backings (deleting the objects).  Also,
use the same function (evictBackingsToReduceMemory) to reduce memory
consumption both during commit and when done by the impl thread in response
to a request by the GPU memory manager.

Note that destroying only some of the resources at a time during texture
eviction (as opposed all resources) is still not supported because the
texture upload queues cannot be only-partially invalidated yet.

Updated tests to take this behavior into account.

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::reduceContentsTexturesMemoryOnImplThread):
(WebCore):
(WebCore::CCLayerTreeHost::getEvictedContentTexturesBackings):
(WebCore::CCLayerTreeHost::unlinkEvictedContentTexturesBackings):
(WebCore::CCLayerTreeHost::deleteEvictedContentTexturesBackings):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::releaseContentsTextures):
(WebCore::CCLayerTreeHostImpl::setContentsTexturesPurged):
(WebCore):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImplClient):
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
(WebCore::CCPrioritizedTextureManager::~CCPrioritizedTextureManager):
(WebCore::CCPrioritizedTextureManager::acquireBackingTextureIfNeeded):
(WebCore::CCPrioritizedTextureManager::evictBackingsToReduceMemory):
(WebCore::CCPrioritizedTextureManager::reduceMemory):
(WebCore::CCPrioritizedTextureManager::clearAllMemory):
(WebCore::CCPrioritizedTextureManager::reduceMemoryOnImplThread):
(WebCore::CCPrioritizedTextureManager::getEvictedBackings):
(WebCore::CCPrioritizedTextureManager::unlinkEvictedBackings):
(WebCore):
(WebCore::CCPrioritizedTextureManager::deleteEvictedBackings):
(WebCore::CCPrioritizedTextureManager::evictBackingResource):
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.h:
(CCPrioritizedTextureManager):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::releaseContentsTexturesOnImplThread):
(WebCore):
(WebCore::CCSingleThreadProxy::commitAndComposite):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::releaseContentsTexturesOnImplThread):
(WebCore):
(WebCore::CCThreadProxy::scheduledActionBeginFrame):
(WebCore::CCThreadProxy::beginFrame):
(WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
(WebCore::CCThreadProxy::layerTreeHostClosedOnImplThread):
(WebCore::CCThreadProxy::recreateContextOnImplThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:
(BeginFrameAndCommitState):
(CCThreadProxy):

Source/WebKit/chromium:

Update layer tree host impl test to include the extra interface functions
added to CCLayerTreeHostImplClient.

* tests/CCLayerTreeHostImplTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fixed for http://trac.webkit.org/changeset/128243

Unreviewed build fix.

Change UnicodeString::extract for gcc based on ICU fix described in
http://bugs.icu-project.org/trac/ticket/8197.

* icu/unicode/unistr.h:
(UnicodeString::extract):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Inline repainting can be off-by-one with sub-pixel enabled
https://bugs.webkit.org/show_bug.cgi?id=95882

Reviewed by Eric Seidel.

Source/WebCore: 

With sub-pixel layout enabled, context accumulated from containing renderers is used to properly
pixel snap. Selection repaint rects are stored outside the affected renderers, and are handed to
the embedder without the context to correctly determine the snapped values. This can result in
repaint areas smaller than what's needed.

This could be fixed three ways:
- by changing selection repaint rects to an IntRect and pixel snapping the values before storing
  them outside the render tree. This is the narrowest solution.
- by adapting layout to store pixel snapping hints along with the size/location of the renderer.
  This is the best possible solution, as it would help solve a lot of pixel snapping issues and
  reduce complexity of handling. I eventually intend on implementing this.
- by reverting repaintUsingContainer to IntRects and using pixel snapping when possible, and
  enclosingIntRect where we lack context.

This implements the last solution, as it's the least invasive, but can potentially fix numerous
sub-pixel repaint issues.

Test: fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::layoutRunsAndFloats):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::repaintIncludingNonCompositingDescendants):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintUsingContainer):
(WebCore::RenderObject::repaint):
(WebCore::RenderObject::repaintRectangle):
(WebCore::RenderObject::repaintAfterLayoutIfNeeded):
* rendering/RenderObject.h:
(RenderObject):
* rendering/RenderSelectionInfo.h:
(WebCore::RenderSelectionInfo::repaint):
(WebCore::RenderBlockSelectionInfo::repaint):

LayoutTests: 

Test that we properly repaint selection gaps inside tables with sub-pixel offsets.

* fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt: Added.
* fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html: Added.
* platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png: Added.
* platform/chromium/TestExpectations:
* platform/mac-lion/Skipped:
* platform/mac-snowleopard/Skipped:
* platform/mac-wk2/Skipped:
* platform/mac/Skipped:
* platform/qt-4.8/Skipped:
* platform/qt/Skipped:
* platform/win-wk2/Skipped:
* platform/win-xp/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:
* platform/wk2/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename OVERFLOW_SCROLLING as ACCELERATED_OVERFLOW_SCROLLING
https://bugs.webkit.org/show_bug.cgi?id=96251

Patch by Sami Kyostila <skyostil@google.com> on 2012-09-12
Reviewed by Simon Fraser.

Rename OVERFLOW_SCROLLING as ACCELERATED_OVERFLOW_SCROLLING to better describe
the feature it controls.

.:

* Source/cmakeconfig.h.cmake:

Source/WebCore:

No tests because of no change in runtime behavior.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::usesCompositedScrolling):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
(StyleRareInheritedData):

Source/WebKit/blackberry:

* WebCoreSupport/AboutDataEnableFeatures.in:

Source/WebKit/chromium:

* features.gypi:

LayoutTests:

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add a virtual test suite for fast/hidpi
https://bugs.webkit.org/show_bug.cgi?id=90192

Patch by Alex Sakhartchouk <alexst@chromium.org> on 2012-09-12
Reviewed by Dirk Pranke.

Tools:

Add a virtual test suite to make sure the pixel tests in fast/hidpi give the same result
on the hardware accelerated path as the software path.

* DumpRenderTree/chromium/WebPreferences.cpp:
(WebPreferences::applyTo):
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort.virtual_test_suites):

LayoutTests:

Making sure the new virtual tests have matching expectations to non-gpu ones

* platform/chromium/TestExpectations:
* platform/chromium/virtual/gpu/fast/hidpi/README.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r128338): Broke Windows build
https://bugs.webkit.org/show_bug.cgi?id=96537

Unreviewed build fix.

Fix Apple-Win build by allocating array dynamically
since its size is not constant.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-12

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::stringArrayToJS):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Compilation error in RenderThemeEfl.cpp
https://bugs.webkit.org/show_bug.cgi?id=96540

Unreviewed build fix.

Fix compilation error in RenderThemeEfl.cpp when building
in debug mode.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-12

* platform/efl/RenderThemeEfl.h:
(WebCore::RenderThemeEfl::canvas):
(WebCore::RenderThemeEfl::edje):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Fix cases where find-in-page doesn't send a final update
https://bugs.webkit.org/show_bug.cgi?id=96402

Fix some issues in the WebKit implementation that prevented to send a final
reportFindInPageMatchCount message. Also, fix a buggy reset of the active match
when calling the stopFinding method.

Reviewed by Adam Barth.

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::scopeStringMatches):
(WebKit::WebFrameImpl::cancelPendingScopingEffort):
(WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):
(WebKit::WebFrameImpl::shouldScopeMatches):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        <rdar://problem/12275537> REGRESSION(r127384): Non-existent directories are no longer created for sandbox paths
        https://bugs.webkit.org/show_bug.cgi?id=96442

        Reviewed by Darin Adler.

        * Shared/SandboxExtension.h:
        (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
        * Shared/mac/SandboxExtensionMac.mm:
        (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
        Added a function for read-write configuration directories. It matches
        appendReadwriteSandboxDirectory() function behavior from WebProcessMac.mm.

        * UIProcess/WebContext.cpp:
        (WebKit::WebContext::createNewWebProcess):
        * UIProcess/mac/WebContextMac.mm:
        (WebKit::WebContext::platformInitializeWebProcess):
        Use the new function for directories that need to be created if they don't exist.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r128318 and r128332.
http://trac.webkit.org/changeset/128318
http://trac.webkit.org/changeset/128332
https://bugs.webkit.org/show_bug.cgi?id=96547

Caused accessibility test failures on snow leopard (Requested
by jamesr_ on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-12

Source/WebCore:

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::accessibilityIsIgnored):
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):
* accessibility/AccessibilityNodeObject.h:
(AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::node):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore):
(WebCore::AccessibilityRenderObject::isWebArea):
(WebCore::AccessibilityRenderObject::isImageButton):
(WebCore::AccessibilityRenderObject::isAnchor):
(WebCore::AccessibilityRenderObject::isNativeTextControl):
(WebCore::AccessibilityRenderObject::isSearchField):
(WebCore::AccessibilityRenderObject::isNativeImage):
(WebCore::AccessibilityRenderObject::isImage):
(WebCore::AccessibilityRenderObject::isPasswordField):
(WebCore::AccessibilityRenderObject::isInputImage):
(WebCore::AccessibilityRenderObject::isProgressIndicator):
(WebCore::AccessibilityRenderObject::isSlider):
(WebCore::AccessibilityRenderObject::isMenuRelated):
(WebCore::AccessibilityRenderObject::isMenu):
(WebCore::AccessibilityRenderObject::isMenuBar):
(WebCore::AccessibilityRenderObject::isMenuButton):
(WebCore::AccessibilityRenderObject::isMenuItem):
(WebCore::AccessibilityRenderObject::isPressed):
(WebCore::AccessibilityRenderObject::isIndeterminate):
(WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio):
(WebCore::AccessibilityRenderObject::isChecked):
(WebCore::AccessibilityRenderObject::isHovered):
(WebCore::AccessibilityRenderObject::isMultiSelectable):
(WebCore::AccessibilityRenderObject::isReadOnly):
(WebCore::AccessibilityRenderObject::headingLevel):
(WebCore::AccessibilityRenderObject::isHeading):
(WebCore::AccessibilityRenderObject::isLink):
(WebCore::AccessibilityRenderObject::isControl):
(WebCore::AccessibilityRenderObject::isFieldset):
(WebCore::AccessibilityRenderObject::isGroup):
(WebCore::AccessibilityRenderObject::selectedRadioButton):
(WebCore::AccessibilityRenderObject::selectedTabItem):
(WebCore::AccessibilityRenderObject::actionElement):
(WebCore::AccessibilityRenderObject::mouseButtonListener):
(WebCore::AccessibilityRenderObject::alterSliderValue):
(WebCore::AccessibilityRenderObject::increment):
(WebCore::AccessibilityRenderObject::decrement):
(WebCore::siblingWithAriaRole):
(WebCore::AccessibilityRenderObject::menuElementForMenuButton):
(WebCore::AccessibilityRenderObject::menuForMenuButton):
(WebCore::AccessibilityRenderObject::menuItemElementForMenu):
(WebCore::AccessibilityRenderObject::menuButtonForMenu):
(WebCore::AccessibilityRenderObject::hierarchicalLevel):
(WebCore::AccessibilityRenderObject::checkboxOrRadioValue):
(WebCore::AccessibilityRenderObject::valueDescription):
(WebCore::AccessibilityRenderObject::stepValueForRange):
(WebCore::AccessibilityRenderObject::isARIARange):
(WebCore::AccessibilityRenderObject::valueForRange):
(WebCore::AccessibilityRenderObject::maxValueForRange):
(WebCore::AccessibilityRenderObject::minValueForRange):
(WebCore::accessibleNameForNode):
(WebCore::AccessibilityRenderObject::accessibilityDescriptionForElements):
(WebCore::AccessibilityRenderObject::elementsFromAttribute):
(WebCore::AccessibilityRenderObject::ariaLabeledByElements):
(WebCore::AccessibilityRenderObject::ariaLabeledByAttribute):
(WebCore::labelForElement):
(WebCore::AccessibilityRenderObject::title):
(WebCore::AccessibilityRenderObject::ariaAccessibilityDescription):
(WebCore::AccessibilityRenderObject::accessibilityDescription):
(WebCore::AccessibilityRenderObject::isDescendantOfBarrenParent):
(WebCore::AccessibilityRenderObject::text):
(WebCore::AccessibilityRenderObject::isRequired):
(WebCore::AccessibilityRenderObject::changeValueByStep):
(WebCore::AccessibilityRenderObject::changeValueByPercent):
(WebCore::AccessibilityRenderObject::isEnabled):
(WebCore::AccessibilityRenderObject::isGenericFocusableElement):
(WebCore::AccessibilityRenderObject::canHaveChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):

LayoutTests:

* accessibility/canvas-fallback-content-2-expected.txt: Removed.
* accessibility/canvas-fallback-content-2.html: Removed.

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

Mark some new hidpi tests as failing after r128348.

* platform/chromium/TestExpectations:

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

Mark seek-to-end-after-duration-change.html as flaky.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Updated test expectations following r128346.

* platform/chromium-linux/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
* platform/chromium-mac/fast/repaint/repaint-across-writing-mode-boundary-expected.png:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Widen CRASH expectations for fast/replaced/border-radius-clip.html

Unreviewed gardening.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Fix search tickmarks not disappearing when compositing is enabled
https://bugs.webkit.org/show_bug.cgi?id=96536

Reviewed by James Robinson.

view->invalidateRect() on the root frame just invalidates the
contents, since WebViewImpl doesn't know anything about scrollbar
layers. This causes an "InvalidateAll" to not actually invalidate the
scrollbars.

To fix this, make WebFrameImpl explicitly invalidate the
scrollbars when required.

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::invalidateArea):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sync html5lib tests with latest sources (and sort the tests alphabetically in runner.html)
https://bugs.webkit.org/show_bug.cgi?id=96544

Reviewed by Adam Barth.

* html5lib/resources/adoption01.dat:
* html5lib/resources/domjs-unsafe.dat: Added.
* html5lib/resources/scripted/ark.dat: Added.
* html5lib/runner.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More unreviewed gardening after r128346.

* platform/chromium-win-xp/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
* platform/chromium-win/fast/repaint/repaint-across-writing-mode-boundary-expected.png:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] V8DOMWrapper::constructorForType is unnecessary now that we can get V8PerContextData from the v8::Context
https://bugs.webkit.org/show_bug.cgi?id=96556

Patch by Adam Barth <abarth@chromium.org> on 2012-09-12
Reviewed by Eric Seidel.

These functions no longer serve a purpose now that we can get the
V8PerContextData directly from the context. Previously we had to find
the Frame in order to find the per-context data.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateConstructorGetter):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::installDOMWindow):
* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::instantiateV8Object):
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):
* bindings/v8/V8PerContextData.cpp:
(WebCore::V8PerContextData::from):
* bindings/v8/V8PerContextData.h:
(V8PerContextData):
    - Changed this function to accept an arbitrary context rather than
      requiring the caller to use the current context.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkitdirs: fix uname version handling for cygwin
https://bugs.webkit.org/show_bug.cgi?id=96436

Reviewed by Jon Honeycutt.

Newer versions of cygwin embed an additional version string
inside parentheses, so you get "1.7.16(0.249/5/3)" instead of "1.7.16".
Update the code to handle that.

* Scripts/webkitdirs.pm:
(setupAppleWinEnv):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Element::classAttributeChanged should use characters8/16 to find first non-whitespace
https://bugs.webkit.org/show_bug.cgi?id=96446

Reviewed by Benjamin Poulain.

Source/WebCore: 

Made two new static templated methods to handle 8 or 16 bit class names.

No functional change, so no new tests.

* dom/Element.cpp:
(WebCore::classStringHasClassName):
(WebCore::Element::classAttributeChanged):

Source/WTF: 

Added bit size related string accessors to AtomicString to support change.

* wtf/text/AtomicString.h:
(AtomicString):
(WTF::AtomicString::is8Bit):
(WTF::AtomicString::characters8):
(WTF::AtomicString::characters16):


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