Regression(r135962): m_pendingSyncBackingStores needs to be cleared in LayerTreeRenderer::purgeGLResources()
https://bugs.webkit.org/show_bug.cgi?id=103527

Reviewed by Jocelyn Turcotte.

Make sure m_pendingSyncBackingStores is cleared in
LayerTreeRenderer::purgeGLResources() to avoid trying to assign
backing store to layers after everything has been invalidated.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::purgeGLResources):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][Win] Enable usage of QTWEBKIT_PLUGIN_PATH.
https://bugs.webkit.org/show_bug.cgi?id=103529

This patch enables the same behavior for Windows
as it is currently implemented for all other operating
systems supported by Qt.
Directories listed in the environment variable
QTWEBKIT_PLUGIN_PATH are being searched for additional
plugins.
The only difference is that directories on Windows
need to be separated by a semicolon instead of a colon.

Reviewed by Kenneth Rohde Christiansen.

* plugins/win/PluginDatabaseWin.cpp:
(WebCore):
(WebCore::addQtWebKitPluginPath):
(WebCore::PluginDatabase::defaultPluginDirectories):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test svg/animations/mpath-remove-from-dependents-on-delete-crash.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=103375

Unreviewed test update.

According to the original bug, at least 4 iterations were required to
crash (without the fix). To make the test faster, I've reduced the max
iteration count to 5, rather than 10. This may not fix the timeoout
issue because it might be a real timeout, not just a slow test.

* svg/animations/mpath-remove-from-dependents-on-delete-crash.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Calling .removeCue() for a cue that was never added should raise a NOT_FOUND_ERR
https://bugs.webkit.org/show_bug.cgi?id=103412

Patch by Antoine Quint <graouts@apple.com> on 2012-11-28
Reviewed by Eric Carlson.

Source/WebCore:

Updating the .removeCue() implementation to match the latest spec. This means we now
raise a NOT_FOUND_ERR exception when trying to remove a cue that wasn't present in the
cue list instead of a INVALID_STATE_ERR exception like the spec used to mandate.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::removeCue):

LayoutTests:

Updating the .removeCue() test checking on the exception to be NOT_FOUND_ERR instead
of INVALID_STATE_ERR.

* media/track/track-add-remove-cue-expected.txt:
* media/track/track-add-remove-cue.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, land updated Chromium results after track limiter removal.

* fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/chromium-mac-lion/media/video-empty-source-expected.png:
* platform/chromium-mac-snowleopard/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Removed.
* platform/chromium-mac-snowleopard/fast/forms/range/slider-thumb-stylability-expected.txt: Removed.
* platform/chromium-mac-snowleopard/fast/repaint/slider-thumb-float-expected.txt: Removed.
* platform/chromium-mac-snowleopard/media/video-empty-source-expected.png:
* platform/chromium-mac/fast/dom/HTMLInputElement/input-slider-update-expected.txt: Added.
* platform/chromium-mac/fast/forms/box-shadow-override-expected.txt:
* platform/chromium-mac/fast/forms/input-appearance-height-expected.txt:
* platform/chromium-mac/fast/forms/range/input-appearance-range-expected.txt: Added.
* platform/chromium-mac/fast/forms/range/range-thumb-height-percentage-expected.txt: Renamed from LayoutTests/platform/chromium/fast/forms/range/range-thumb-height-percentage-expected.txt.
* platform/chromium-mac/fast/forms/range/slider-padding-expected.txt: Added.
* platform/chromium-mac/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/chromium-mac/fast/forms/range/slider-thumb-stylability-expected.txt:
* platform/chromium-mac/fast/hidpi/video-controls-in-hidpi-expected.txt:
* platform/chromium-mac/fast/layers/video-layer-expected.txt:
* platform/chromium-mac/fast/repaint/slider-thumb-drag-release-expected.txt: Added.
* platform/chromium-mac/fast/repaint/slider-thumb-float-expected.txt: Removed.
* platform/chromium-mac/media/audio-controls-rendering-expected.txt:
* platform/chromium-mac/media/audio-repaint-expected.txt:
* platform/chromium-mac/media/controls-after-reload-expected.txt:
* platform/chromium-mac/media/controls-strict-expected.txt:
* platform/chromium-mac/media/controls-styling-expected.txt:
* platform/chromium-mac/media/controls-styling-strict-expected.txt:
* platform/chromium-mac/media/controls-without-preload-expected.txt:
* platform/chromium-mac/media/media-controls-clone-expected.txt:
* platform/chromium-mac/media/media-document-audio-repaint-expected.txt:
* platform/chromium-mac/media/video-controls-rendering-expected.txt:
* platform/chromium-mac/media/video-display-toggle-expected.txt:
* platform/chromium-mac/media/video-empty-source-expected.png:
* platform/chromium-mac/media/video-empty-source-expected.txt:
* platform/chromium-mac/media/video-no-audio-expected.txt:
* platform/chromium-mac/media/video-playing-and-pause-expected.txt:
* platform/chromium-mac/media/video-zoom-controls-expected.txt:
* platform/chromium-mac/platform/chromium/virtual/gpu/fast/hidpi/video-controls-in-hidpi-expected.txt:
* platform/chromium-win-xp/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Removed.
* platform/chromium-win-xp/fast/forms/range/slider-thumb-stylability-expected.txt: Removed.
* platform/chromium-win-xp/fast/repaint/slider-thumb-float-expected.txt: Removed.
* platform/chromium-win/fast/dom/HTMLInputElement/input-slider-update-expected.txt:
* platform/chromium-win/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt:
* platform/chromium-win/fast/forms/box-shadow-override-expected.txt:
* platform/chromium-win/fast/forms/input-appearance-height-expected.txt:
* platform/chromium-win/fast/forms/range/input-appearance-range-expected.txt:
* platform/chromium-win/fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/chromium-win/fast/forms/range/slider-padding-expected.txt:
* platform/chromium-win/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/chromium-win/fast/forms/range/slider-thumb-stylability-expected.txt:
* platform/chromium-win/fast/multicol/client-rects-expected.txt:
* platform/chromium-win/fast/repaint/slider-thumb-drag-release-expected.txt:
* platform/chromium-win/fast/repaint/slider-thumb-float-expected.txt:
* platform/chromium-win/media/video-empty-source-expected.txt:
* platform/chromium/TestExpectations:
* platform/chromium/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Renamed from LayoutTests/platform/chromium-mac/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt.
* platform/chromium/fast/forms/range/slider-thumb-shared-style-expected.txt: Removed.
* platform/chromium/fast/multicol/client-rects-expected.txt: Added.
* platform/chromium/fast/repaint/slider-thumb-float-expected.txt: Renamed from LayoutTests/platform/mac/fast/repaint/slider-thumb-float-expected.txt.
* platform/mac/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Removed.
* platform/mac/fast/forms/range/slider-thumb-stylability-expected.txt: Removed.
* platform/win-future/fast/forms/range/range-thumb-height-percentage-expected.txt: Copied from LayoutTests/fast/forms/range/range-thumb-height-percentage-expected.txt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Handle pinch correctly in slow-scrolling area
https://bugs.webkit.org/show_bug.cgi?id=102740

Reviewed by James Robinson.

With the nonmodal gesture event model, pinch zoom gestures involve
interleaved pinch and scroll events. This caused a bug on slow-scroll
areas: the scroll events were sent to the main thread and
the pinch events were handled in the impl thread.

This patch makes it so that scroll events are always handled in the impl
thread if a pinch is active.

* src/WebCompositorInputHandlerImpl.cpp:
(WebKit::WebCompositorInputHandlerImpl::WebCompositorInputHandlerImpl):
(WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal):
* src/WebCompositorInputHandlerImpl.h:
* tests/WebCompositorInputHandlerImplTest.cpp:
(WebKit::TEST_F):
(WebKit):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed. Mark http/tests/media/video-buffered-range-contains-currentTime.html as requiring an image rebaseline.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move empty loading to DocumentLoader, simplify FrameLoader::init()
https://bugs.webkit.org/show_bug.cgi?id=101512

Reviewed by Adam Barth.

Source/WebCore:

No new tests, though several outputs changed because we no longer send resource
    load callbacks for empty loads.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::~DocumentLoader):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::clearMainResourceLoader):
(WebCore::DocumentLoader::isLoadingInAPISense):
(WebCore::DocumentLoader::documentURL):
(WebCore::DocumentLoader::isLoadingMainResource):
(WebCore::DocumentLoader::maybeLoadEmpty):
(WebCore):
(WebCore::DocumentLoader::startLoadingMainResource): Handle empty main resource
     loads directly here.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::serverRedirectSourceForHistory):
(DocumentLoader):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameLoader): Initialize some variables whose values
    were previously being reset in init(). Given that the FrameLoader is in
    an inconsistent state before init() is called anyway, there doesn't seem
    to be a disadvantage to just initializing them to their post-init() values.
(WebCore::FrameLoader::init): Just call startLoadingMainResource(), instead of
    doing a bunch of direct calls to functions FrameLoader shouldn't know about.
* loader/FrameLoaderStateMachine.cpp:
(WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
* loader/FrameLoaderStateMachine.h:
* loader/MainResourceLoader.cpp: Throughout, remove the concept of an empty load.
(WebCore::MainResourceLoader::loadNow): This only returned true when an empty
    load got deferred, which won't happen now. Return void and always treat
    as returning false.
* loader/MainResourceLoader.h:
(MainResourceLoader):

Tools:

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::updateForCommittedLoad): This function doesn't play nicely with empty urls and incorrectly
    interprets them as a non-empty load. This change is required for
     http/tests/navigation/new-window-redirect-history.html to continue to pass in chromium.
* TestWebKitAPI/Tests/WebKit2/AboutBlankLoad.cpp: This test relies on a callback that no longer
     is sent for about:blank loads.  Hook into didFinishLoadForFrame() instead.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::TEST):

LayoutTests:

Don't expect resource load callbacks for empty loads.

* http/tests/inspector/network/network-iframe-load-and-delete.html:
* http/tests/loading/redirect-methods-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add unit tests for ChromeClientImpl::getNavigationPolicy
https://bugs.webkit.org/show_bug.cgi?id=102424

Reviewed by Adam Barth.

This tests a bunch of basic scenarios regarding what will produce a
popup, a new foreground/background tab, or a new window.

* WebKit.gypi: Added test file.
* src/WebViewImpl.h:
(WebViewImpl): Added friend declaration for setCurrentInputEventForTest.
* tests/ChromeClientImplTest.cpp: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=102970
[WK1] REGRESSION (r129545): Main frame doesn't rubberband unless 
WebFrameLoadDelegate implements -webView:didFirstLayoutInFrame:

Reviewed by Sam Weinig.

We should always register for DidFirstLayout in WK1 since we do work 
at that time besides just calling the delegate function.
* WebView/WebView.mm:
(-[WebView _cacheFrameLoadDelegateImplementations]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/12645085> REGRESSION (r130851): With kerning enabled, a white-space: pre-wrap inline starting with tab+space has the wrong width
https://bugs.webkit.org/show_bug.cgi?id=103541

Reviewed by Anders Carlsson.

Source/WebCore: 

Test: fast/text/tab-with-kerning.html

When kerning is enabled, words are measured with their trailing space, then the width of a
space is subtracted. The logic to do this was incorrectly being invoked even when the
trailing whitespace character was a tab or a newline.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::nextLineBreak): Changed to check only for the space
character, not other space-like characters.

LayoutTests: 

* fast/text/tab-with-kerning-expected.html: Added.
* fast/text/tab-with-kerning.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, land updated Mac results after track limiter removal.

* fast/dom/HTMLInputElement/input-slider-update-expected.txt:
* fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt:
* fast/forms/range/input-appearance-range-expected.txt:
* fast/forms/range/slider-padding-expected.txt:
* fast/forms/range/slider-thumb-stylability-expected.txt:
* fast/multicol/client-rects-expected.txt:
* fast/repaint/slider-thumb-drag-release-expected.txt:
* fast/repaint/slider-thumb-float-expected.txt:
* platform/mac/TestExpectations:
* platform/mac/fast/forms/box-shadow-override-expected.txt:
* platform/mac/fast/forms/input-appearance-height-expected.txt:
* platform/mac/fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/mac/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/mac/media/audio-controls-rendering-expected.txt:
* platform/mac/media/controls-after-reload-expected.txt:
* platform/mac/media/controls-strict-expected.txt:
* platform/mac/media/controls-styling-strict-expected.txt:
* platform/mac/media/controls-without-preload-expected.txt:
* platform/mac/media/video-controls-rendering-expected.txt:
* platform/mac/media/video-display-toggle-expected.txt:
* platform/mac/media/video-no-audio-expected.txt:
* platform/mac/media/video-playing-and-pause-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove deprecated logging usage from QueueEngine
https://bugs.webkit.org/show_bug.cgi?id=103532

Reviewed by Dirk Pranke.

Replace usage of deprecated logging in webkitpy.tool.bot.queueengine with
logging through the Logger object. The unit test is modified to reflect
these changes.

After these changes the deprecated logging (i.e. logging to stderr) is not
used anymore through webkitpy and can be removed.

* Scripts/webkitpy/tool/bot/queueengine.py:
(QueueEngine.exit_after_handled_error):
(QueueEngine.run):
(QueueEngine._stopping):
(QueueEngine._sleep):
* Scripts/webkitpy/tool/bot/queueengine_unittest.py:
(QueueEngineTest._run_engine):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] InRenderFlowThread returns false in the first setStyle
https://bugs.webkit.org/show_bug.cgi?id=102839

Reviewed by Dave Hyatt.

Source/WebCore:

Some render objects use the "inRenderFlowThread" during the first styleWillChange/styleDidChange.
The first call to these methods comes from NodeRendererFactory::createRenderer. That happens before the RenderObject is
attached to the parent renderer, meaning that inRenderFlowThread is false. That means a RenderLayerBacking will be
created for renderers inside the RenderFlowThread, but composited layers inside the RenderFlowThread are not supported yet.
https://bugs.webkit.org/show_bug.cgi?id=84900

Test: fast/repaint/region-painting-composited-element.html

* dom/NodeRenderingContext.cpp:
(WebCore::NodeRendererFactory::createRenderer):
Added code to propagate the inRenderFlowThread flag from the parent node before the style is set for the first time.

LayoutTests:

Added test to check that the composited elements added to a RenderFlowThread are painted correctly.

* fast/repaint/region-painting-composited-element-expected.html: Added.
* fast/repaint/region-painting-composited-element.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed. Fixing lint errors introduced in r136030.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Auto-height regions will not calculate the height correctly when the content changes dynamically
https://bugs.webkit.org/show_bug.cgi?id=102954

Reviewed by David Hyatt.

Source/WebCore:

Whenever the flow changes, we need to reset the region computed auto-heights.
However, when we reset the region heights to "auto" or "un-computed", we also need to make
sure that all the region breaks are counted again, so that we split regions correctly during the new layout.
I've reused the m_regionsInvalidated property to force the flow do a complete layout.

Test: fast/regions/autoheight-dynamic-update.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::resetRegionsOverrideLogicalContentHeight):

LayoutTests:

Added test to check for auto-height region size update after an element is added to the flow.
In this case the first region will need to resize to accommodate the size of the added elements.

* fast/regions/autoheight-dynamic-update-expected.html: Added.
* fast/regions/autoheight-dynamic-update.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/fast/table/css-table-max-height.html failing on Qt Linux
https://bugs.webkit.org/show_bug.cgi?id=103453

Patch by Pravin D <pravind.2k4@gmail.com> on 2012-11-28
Reviewed by Julien Chaffraix.

The testcase failure was due to the difference in the default line-height value
used by Qt-linux port from other ports.

* fast/table/css-table-max-height.html:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix duplicate expectation.

* platform/efl-wk1/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136042 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Crash when using hover and first-letter inside a flow-thread
https://bugs.webkit.org/show_bug.cgi?id=102957

Reviewed by David Hyatt.

Source/WebCore:

Some RenderObjects use a different path when they are destroyed. That's because they are dynamically
added just before layout happens and their parent is usually not their actual owner. In those cases the parent
will remove the object from the tree, but it's actually the owner that will destroy the object and all its
children.

RenderFlowThread maintains a RenderBoxRegionInfo object for each RenderObject that is rendered inside the
flow-thread. When the RenderObject is removed from the RenderFlowThread, the associated RenderBoxRegionInfo object
also needs to be removed.

In these special cases (list-marker, first-letter), the object itself was removed from the RenderFlowThread,
but its children were still left in the flow-thread. When the these special objects were later destroyed,
they will remove their own children. Removing their children means it will try to remove them from the
associated RenderFlowThread. However, in this cases there would be no link back to the parent flow-thread,
as the tree is now detached from the enclosing RenderFlowThread.

Added code that recursively removes the whole children tree from the RenderFlowThread when the root is removed.

Tests: fast/regions/firstletter-inside-flowthread.html
       fast/regions/listmarker-inside-flowthread.html

* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeRemovedFromTree):
(WebCore::RenderObject::removeFromRenderFlowThread):
(WebCore):
(WebCore::RenderObject::removeFromRenderFlowThreadRecursive):
* rendering/RenderObject.h:
(RenderObject):

LayoutTests:

Added CSS Regions tests for the firstLetter and listMarker render objects that use
different destroy paths in the code.

* fast/regions/firstletter-inside-flowthread-expected.html: Added.
* fast/regions/firstletter-inside-flowthread.html: Added.
* fast/regions/listmarker-inside-flowthread-expected.html: Added.
* fast/regions/listmarker-inside-flowthread.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
cleanup: Change some code to be cleaner, more readable and style conforming
https://bugs.webkit.org/show_bug.cgi?id=103543

Patch by Sadrul Habib Chowdhury <sadrul@chromium.org> on 2012-11-28
Reviewed by Antonio Gomes.

Use more appropriate function name and more meaningful variable names to make the code cleaner.
This is covered by existing tests. This does not make any behavioural changes, so no new tests.

* page/EventHandler.cpp:
(WebCore::closestScrollableNodeInDocumentIfPossible):
(WebCore::EventHandler::handleWheelEvent):

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