[EFL] REGRESSION after r153432: some accessibility tests crash.
https://bugs.webkit.org/show_bug.cgi?id=119333

Patch by Mario Sanchez Prada <mario.prada@samsung.com> on 2013-08-07
Reviewed by Darin Adler.

Use a RefPtr to store a reference to the parent element of
an AccessibilityUIElement instead of the raw pointer, so we
never derefence a function from an invalid pointer.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::attributesOfElement): Use a RefPtr instead of a raw pointer.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed wrong definition for AppleWin port's WebGL after r153768.

Rubberstamped by Benjamin Poulain.

* wtf/Platform.h: Replaced WTF_USE_SURFACE with WTF_USE_GRAPHICS_SURFACE.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up: Simplifying the printing of the command line arguments passed to jsDriver.pl
<https://bugs.webkit.org/show_bug.cgi?id=119558>

Reviewed by Martin Robinson.

Currently we build the command line to execute jsDriver.pl twice so as to both
print it to standard output and actually execute it. We should only build up
this command line once. Moreover, we should print to standard output the actual
command line that we are going to use including the GTK- and EFL-specific call
to /Tools/jhbuild/jhbuild-wrapper.

* Scripts/run-javascriptcore-tests:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't remove contents layer from its parent unless necessary
https://bugs.webkit.org/show_bug.cgi?id=119560

Reviewed by Simon Fraser.

RenderLayerBacking::updateInternalHierarchy() is called in some
instances where there doesn't need to be a complete reparenting of the
the m_graphicsLayer. For example, on OS X when the user changes the
scrollbar styles to/from always visible. We don't need to always
remove the graphics layer from its parent - any reparenting does that
automatically.

Unfortunately we can't trigger this situation in an automated test.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateInternalHierarchy): Don't call removeFromParent().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[rendering] Implement PaintInfo interfaces
https://bugs.webkit.org/show_bug.cgi?id=119388

Reviewed by Benjamin Poulain.

In discussion in IRC, it was decided to remove this comment since implementing such change
would have a vast impact on rendering classes.

* rendering/PaintInfo.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Remove pointless const in InputHandler
https://bugs.webkit.org/show_bug.cgi?id=119550

Patch by Jacky Jiang <zhajiang@blackberry.com> on 2013-08-07
Reviewed by Rob Buis.
Internally reviewed by Leo Yang and Mike Fenton.

* Api/WebPageClient.h:
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::requestSpellingCheckingOptions):
(BlackBerry::WebKit::InputHandler::redrawSpellCheckDialogIfRequired):
* WebKitSupport/InputHandler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Be more aggressive about sending fake mouse events less frequently
https://bugs.webkit.org/show_bug.cgi?id=119563
<rdar://problem/14669029>

Reviewed by Tim Horton.

r109151 added code that throttles back the fake mouse events that we
send during scrolling, but in such a way that a page could take up to
100ms to handle a single mousemove, and we'd still send fake mousemove
events every 100ms. This could cause serious scrolling stutter.

Fix by changing when we drop back to sending events every 250ms, rather than every
100ms: if the slowest mousemove takes 10ms or more (less than one frame), drop back
to a 250ms fake move interval.

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid spurious "all repaint" layouts when scrolling WebViews on Retina displays
https://bugs.webkit.org/show_bug.cgi?id=119564

Reviewed by Beth Dakin.

When scrolling WebViews on Macs with Retina displays, AppKit uses
device pixels for the scroll offset, so [scrollView() documentVisibleRect]
can return a CGRect with non-integral origin. This rect is used by layout,
via layoutSize(), to decide whether the view size changed, which prompts
a full repaint. However, FrameView gets a value which has been rounded
by enclosingIntRect(), which increases the height or width by 1px if the
y or x offset is on a half-pixel, causing spurious full repaints.

Fix by plumbing through platformVisibleContentSize(), which just
gets the size of the -documentVisibleRect.

* page/FrameView.cpp:
(WebCore::FrameView::layout): Don't get layoutHeight and layoutWidth
separately, since that is two calls down into platformVisibleContentSize.
* platform/ScrollView.cpp:
(WebCore::ScrollView::unscaledVisibleContentSize):
(WebCore::ScrollView::platformVisibleContentSize):
* platform/ScrollView.h:
* platform/mac/ScrollViewMac.mm:
(WebCore::ScrollView::platformVisibleContentSize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow the DumpRenderTree runloop to be idle while waiting for a test to complete
https://bugs.webkit.org/show_bug.cgi?id=119317

Reviewed by Tim Horton.

The change in r55200 made DumpRenderTree spin a busy-loop while waiting for
the test to complete, which is not power friendly. Although DRT instances
are generally busy anyway, not sitting in a busy loop should free up some CPU
cycles for other instances of DRT.

Editing tests continue to pass. All Java tests are skipped and were not
tested, but when run fail similarly with and without the patch.

* DumpRenderTree/mac/DumpRenderTree.mm:
(dump):
(runTest):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix on Efl port after r153785.

* CMakeLists.txt: Added "${WEBCORE_DIR}/style" in include list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update the images for the blog size-matters

* blog-files/size-matters/JavaScriptCore-relative-binary-growth.png: Added.
* blog-files/size-matters/WebCore-relative-binary-growth.png: Added.
* blog-files/size-matters/WebKit-relative-binary-growth.png: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Propagate overflow from the flow thread to the first and last region
https://bugs.webkit.org/show_bug.cgi?id=118526

Reviewed by David Hyatt.

Source/WebCore:

The patch implements layout overflow propagation for the first and last regions. The approach
taken is triggering a simple layout on the regions after the named flows are laid out
that extracts the layout overflow from the flow thread and adds it to the regions.

The process is based on adding two new layout phases: the overflow phase and the final phase.
The overflow phase is set after the flow threads are laid out and it marks the regions as
needing to extract the overflow from the flow thread. In case there are blocks with auto overflow
it's possible the overflow to create scrollbars that shrink the regions. In this case the flow
thread is relaid out and set in the final phase, forcing the regions to recollect the layout
overflow. In theory this would be an N-step layout because scrollbars can force content to change
regions and create overflow for other blocks (and thus creating more scrollbars). For now, we are
limiting this to the first pass by inserting this new final layout phase.

A short description of the processing model for a document:
- layout the document (all the flow threads should be in the constrained layout phase after this step)
- reverse iterate through the flow threads and mark the regions for simplified layout (we need to
reverse iterate so the overflow can correctly propagate with nested regions)
- if the layout changes the size of a region, invalidate the flow thread and when laying it out mark
it as needing a new pass
- make a secondary pass through the flow threads that changed after scrollbars have been added and
recompute the overflow for their regions; mark the flow threads in the final phase (flow threads can't
be invalidated in the final phase)
- after the overflow was propagated update all the flow threads in the normal layout phase

There are some issues with the patch:
- the simplified layout doesn't compute correct overflow values for inline blocks
- the layout overflow from the flow thread doesn't take the region size into account

The first issue is not related to regions and will be fixed in a future patch. The second issue
will be fixed when box overflow will be region bound.

Tests: fast/regions/overflow-scrollable-1.html
       fast/regions/overflow-scrollable-2.html
       fast/regions/overflow-scrollable-3.html
       fast/regions/overflow-scrollable-fit-complex.html
       fast/regions/overflow-scrollable-fit.html
       fast/regions/overflow-scrollable-nested.html

* rendering/FlowThreadController.cpp: Flow threads layout driver functions.
(WebCore::FlowThreadController::updateFlowThreadsNeedingLayout):
(WebCore::FlowThreadController::updateFlowThreadsIntoConstrainedPhase):
(WebCore::FlowThreadController::updateFlowThreadsIntoOverflowPhase):
(WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
(WebCore::FlowThreadController::updateFlowThreadsIntoFinalPhase):
* rendering/FlowThreadController.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedNormalFlowLayout):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
(WebCore::RenderFlowThread::invalidateRegions):
(WebCore::RenderFlowThread::validateRegions):
(WebCore::RenderFlowThread::layout):
(WebCore::RenderFlowThread::firstRegion): This getter should work even though the region chain is invalid.
(WebCore::RenderFlowThread::lastRegion): This getter should work even though the region chain is invalid.
(WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
(WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded): If the flow thread has no overflow do nothing.
(WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
(WebCore::RenderFlowThread::addForcedRegionBreak):
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::pageLogicalHeight):
(WebCore::RenderRegion::maxPageLogicalHeight):
(WebCore::RenderRegion::logicalHeightOfAllFlowThreadContent):
(WebCore::RenderRegion::flowThreadPortionOverflowRect):
(WebCore::RenderRegion::overflowRectForFlowThreadPortion): Used to get the flow thread visual or layout overflow.
(WebCore::RenderRegion::layoutBlock):
(WebCore::RenderRegion::computeOverflowFromFlowThread):
(WebCore::RenderRegion::updateLogicalHeight):
* rendering/RenderRegion.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::layoutContentToComputeOverflowInRegions):
(WebCore::RenderView::layout):
* rendering/RenderView.h:

LayoutTests:

Add tests for scrolling of regions in containers in different situations: regions with
transforms, nested regions, regions affected by scrollbars etc.

* fast/regions/overflow-scrollable-1-expected.html: Added.
* fast/regions/overflow-scrollable-1.html: Added.
* fast/regions/overflow-scrollable-2-expected.html: Added.
* fast/regions/overflow-scrollable-2.html: Added.
* fast/regions/overflow-scrollable-3-expected.html: Added.
* fast/regions/overflow-scrollable-3.html: Added.
* fast/regions/overflow-scrollable-fit-complex-expected.html: Added.
* fast/regions/overflow-scrollable-fit-complex.html: Added.
* fast/regions/overflow-scrollable-fit-expected.html: Added.
* fast/regions/overflow-scrollable-fit.html: Added.
* fast/regions/overflow-scrollable-nested-expected.txt: Added.
* fast/regions/overflow-scrollable-nested.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r139282): Old caret sometimes gets "stuck" (not repainted) in contenteditable elements.
<http://webkit.org/b/119520>
<rdar://problem/14658929>

Reviewed by Simon Fraser.

Source/WebCore:

When computing a new caret rect, don't forget to repaint the old rect if the caret jumped
from one node to another.
We were being a little too clever, assuming that oldRect==newRect meant that no repaint was
necessary, but moving from (0,0) in one node to (0,0) in another would cause a ghost caret
in the old node.

Test: fast/repaint/caret-jump-between-nodes.html

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::recomputeCaretRect):

    Fall through all the way down to caret repaints if the selection's new anchor node is not
    the same as m_previousCaretNode.

LayoutTests:

* fast/repaint/caret-jump-between-nodes-expected.txt: Added.
* fast/repaint/caret-jump-between-nodes.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move more style recalc code to StyleResolveTree.cpp
https://bugs.webkit.org/show_bug.cgi?id=119553

Reviewed by Andreas Kling.

* css/StyleResolver.cpp:
* css/StyleResolver.h:
        
    Remove now unused StyleResolver::styleForText.

* dom/ElementShadow.cpp:
* dom/ElementShadow.h:
        
    Remove ElementShadow::recalcStyle.

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setResetStyleInheritance):
        
    Use Style::resolveTree instead of ElementShadow::recalcStyle.

* dom/ShadowRoot.h:
        
    Remove ShadowRoot::recalcStyle.

* dom/Text.cpp:
* dom/Text.h:
        
    Remove Text::recalcTextStyle.

* style/StyleResolveTree.cpp:
(WebCore::Style::updateTextStyle):
        
    Moved from Text::recalcTextStyle. Speed up by just setting the parent style on common case.

(WebCore::Style::resolveShadowTree):
        
    Moved from ShadowRoot::recalcStyle. 
    Simplified to cover only cases that can occur with the current shadow DOM support.

(WebCore::Style::resolveTree):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Use granular DOMStorage modification events to avoid complete DataGrid update.
https://bugs.webkit.org/show_bug.cgi?id=119541

Reviewed by Joseph Pecoraro.

InspectorDOMStorageAgent sends more granular events about the storage modifications.
Using these would avoid the complete rebuilding of the DataGrid.

* UserInterface/DOMStorageContentView.js:
(WebInspector.DOMStorageContentView.prototype.itemsCleared):
(WebInspector.DOMStorageContentView.prototype.itemRemoved):
(WebInspector.DOMStorageContentView.prototype.itemAdded):
(WebInspector.DOMStorageContentView.prototype.itemUpdated):
* UserInterface/DOMStorageObserver.js:
(WebInspector.DOMStorageObserver.prototype.domStorageItemsCleared):
(WebInspector.DOMStorageObserver.prototype.domStorageItemRemoved):
(WebInspector.DOMStorageObserver.prototype.domStorageItemAdded):
(WebInspector.DOMStorageObserver.prototype.domStorageItemUpdated):
* UserInterface/StorageManager.js:
(WebInspector.StorageManager.prototype.domStorageItemsCleared):
(WebInspector.StorageManager.prototype.domStorageItemRemoved):
(WebInspector.StorageManager.prototype.domStorageItemAdded):
(WebInspector.StorageManager.prototype.domStorageItemUpdated):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Skip more tests depending on canvas blending.
https://bugs.webkit.org/show_bug.cgi?id=100072

Unreviewed gardening.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/14680524> REGRESSION(153806): Crash @ yahoo.com when WebKit is built with a .order file

Unreviewed.

Ensure llint symbols are in source order.

* JavaScriptCore.order:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce toSVGMPathElement(), and use it
https://bugs.webkit.org/show_bug.cgi?id=119566

Reviewed by Andreas Kling.

As a step to change static_cast with toSVGXXX, static_cast<SVGMPathElement*> can
be changed with toSVGMPathElement().

* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::updateAnimationPath):
* svg/SVGMPathElement.h:
(WebCore::toSVGMPathElement):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::invalidateMPathDependencies):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed rebaselining after r153647.

* platform/qt/fast/css/input-search-padding-expected.png:
* platform/qt/fast/css/input-search-padding-expected.txt:
* platform/qt/fast/css/text-overflow-input-expected.png:
* platform/qt/fast/css/text-overflow-input-expected.txt:
* platform/qt/fast/forms/box-shadow-override-expected.png:
* platform/qt/fast/forms/box-shadow-override-expected.txt:
* platform/qt/fast/forms/control-restrict-line-height-expected.png:
* platform/qt/fast/forms/control-restrict-line-height-expected.txt:
* platform/qt/fast/forms/placeholder-position-expected.png:
* platform/qt/fast/forms/placeholder-position-expected.txt:
* platform/qt/fast/forms/placeholder-pseudo-style-expected.png:
* platform/qt/fast/forms/placeholder-pseudo-style-expected.txt:
* platform/qt/fast/forms/search-cancel-button-style-sharing-expected.png:
* platform/qt/fast/forms/search-cancel-button-style-sharing-expected.txt:
* platform/qt/fast/forms/search-display-none-cancel-button-expected.png:
* platform/qt/fast/forms/search-display-none-cancel-button-expected.txt:
* platform/qt/fast/forms/search-rtl-expected.png:
* platform/qt/fast/forms/search-rtl-expected.txt:
* platform/qt/fast/forms/search-styled-expected.png:
* platform/qt/fast/forms/search-styled-expected.txt:
* platform/qt/fast/forms/search-vertical-alignment-expected.png:
* platform/qt/fast/forms/search-vertical-alignment-expected.txt:
* platform/qt/fast/forms/search/search-size-with-decorations-expected.png: Added.
* platform/qt/fast/forms/search/search-size-with-decorations-expected.txt: Added.
* platform/qt/fast/repaint/search-field-cancel-expected.png:
* platform/qt/fast/repaint/search-field-cancel-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r121551) Incorrect handling of invalid media query list.
https://bugs.webkit.org/show_bug.cgi?id=119164

Reviewed by Antti Koivisto.

Differentiate between syntactically invalid media queries and media queries with empty expressions.

Introduce a dedicated function for valid, but empty expression queries, so that passing NULL MediaQuerySet
object to CSSParser::createMediaRule() can indicate invalid media query.

Source/WebCore:

Test: fast/media/invalid-media-query-list.html

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::createMediaRule):
(WebCore::CSSParser::createEmptyMediaRule):
* css/CSSParser.h:

LayoutTests:

* fast/media/invalid-media-query-list-expected.html: Added.
* fast/media/invalid-media-query-list.html: Added.


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