[CSS Exclusions] Multiple segment polygon layout does not get all segments
https://bugs.webkit.org/show_bug.cgi?id=100039

Patch by Hans Muller <hmuller@adobe.com> on 2012-10-30
Reviewed by Dirk Schulze.

Source/WebCore:

Corrected the algorithm for computing included polygon intervals for rectilinear polygons,
and polygons with horizontal edges in general.

Tests: fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-001.html
       fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-002.html

* rendering/ExclusionPolygon.cpp: Removed some internal dead code related to the no-longer-used sortedEdgesMinY Vector.
(WebCore::ExclusionPolygon::ExclusionPolygon): Initialize new ExclusionPolygonEdge edgeIndex field.
(WebCore::getVertexIntersectionVertices): Return the previous, next, and target vertex indices for a vertex intersection.
(WebCore::ExclusionPolygon::computeXIntersections): Refactored the core of this method to improve handling of horizontal edges.
(WebCore::ExclusionPolygon::computeEdgeIntersections): Ignore zero-width edges.
* rendering/ExclusionPolygon.h: Removed the rightVertexY() method, since it's no longer used.
(WebCore::ExclusionPolygon::edgeAt): New method.
(WebCore::ExclusionPolygon::numberOfEdges): New method.
(ExclusionPolygon): Added support for retrieving edges.
(WebCore::ExclusionPolygonEdge::vertex1): Use vertex1Index.
(WebCore::ExclusionPolygonEdge::vertex2): Use vertex2Index.
(ExclusionPolygonEdge): Renamed index1, index2 fields to vertex1Index, vertex2Index.
(WebCore::ExclusionPolygonEdge::previousEdge): New method.
(WebCore::ExclusionPolygonEdge::nextEdge): New method.

LayoutTests:

Added tests for CSS Exclusion shape-inside polygons with horizontal edges.
Corrected the simple-polygon.js code for computing a polygon's included intervals.

* fast/exclusions/resources/simple-polygon.js:
* fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-001-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-001.html: Added.
* fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-002-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-002.html: Added.
* fast/exclusions/shape-inside/shape-inside-simple-polygon-004-expected.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Remove unused methods
https://bugs.webkit.org/show_bug.cgi?id=100799

Patch by Jae Hyun Park <jae.park@company100.net> on 2012-10-30
Reviewed by Noam Rosenthal.

Currently, there are several unused methods regarding Coordinated
Graphics. This patch removes those unused methods.

Source/WebCore:

No new tests (No change in behavior).

* platform/graphics/texmap/TextureMapperGL.cpp:

Source/WebKit2:

* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:
(LayerTreeCoordinatorProxy):
* UIProcess/DrawingAreaProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DOM URL is flaky when workers are used
https://bugs.webkit.org/show_bug.cgi?id=99178

Reviewed by Geoffrey Garen.

Source/WebCore:

Extend JSNoStaticTables to also avoid direct access of static tables in constructor objects.

Test: fast/workers/worker-domurl.html

* bindings/scripts/CodeGeneratorJS.pm:
(constructorHashTableAccessor):
(GenerateConstructorDefinition):

LayoutTests:

Test that the methods of the URL constructor are accesible from both main and worker threads.

* fast/workers/resources/worker-domurl.js: Added.
(log):
(onmessage):
* fast/workers/worker-domurl-expected.txt: Added.
* fast/workers/worker-domurl.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Make WebKit2 Build with NETWORK_PROCESS disabled
https://bugs.webkit.org/show_bug.cgi?id=100798

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2012-10-30
Reviewed by David Kilzer.

Wrap a few remaining NetworkProcess files and related code in
ENABLE(NETWORK_PROCESS) guards to avoid being compiled when disabled.

* NetworkProcess/HostRecord.cpp:
* NetworkProcess/HostRecord.h:
* NetworkProcess/NetworkRequest.cpp:
* NetworkProcess/NetworkRequest.h:
* NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
* UIProcess/Network/NetworkProcessManager.cpp:
* UIProcess/Network/NetworkProcessManager.h:
Wrap files in guards.

* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::ProcessLauncher::processTypeAsString):
(WebKit::ProcessLauncher::getProcessTypeFromString):
Wrap NetworkProcess enum access in guards.

* WebProcess/WebKitMain.cpp:
(WebKitMain):
Wrap NetworkProcess enum switch case in guards.

* WebKit2Prefix.h:
Remove an extraneous close and reopen of the same guard.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Enable fast/images/exif-orientation-css.html
https://bugs.webkit.org/show_bug.cgi?id=100767

Unreviewed, expectations-only change.


* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] PurgeCredential should also purge the persisted credential store
https://bugs.webkit.org/show_bug.cgi?id=100744

Reviewed by George Staikos.

When challenged by the server, we will check the credential in-memory and from the persistent storage.
So the invalid credentials should also be purged from the persistent credential storage; Otherwise,
it will be sent to the server next time been challenged, instead of prompting the user.

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::purgeCredentials):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed test update after r132969

Add alternate font family name (Courier New).

* fast/css/font-face-descending-unicode-range.html:
* fast/css/font-face-download-error.html:
* fast/css/font-face-unicode-range.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Clean the code of "JavaScriptDebuggerBlackBerry"
https://bugs.webkit.org/show_bug.cgi?id=100724

Patch by Peter Wang <peter.wang@torchmobile.com.cn> on 2012-10-30
Reviewed by Rob Buis.

Remove the code of JavaScriptDebuggerBlackBerry.

Source/WebKit:

* PlatformBlackBerry.cmake:

Source/WebKit/blackberry:

* Api/WebPage.cpp:
* Api/WebPage.h:
* Api/WebPage_p.h:
(WebCore):
(WebPagePrivate):
* WebCoreSupport/JavaScriptDebuggerBlackBerry.cpp: Removed.
* WebCoreSupport/JavaScriptDebuggerBlackBerry.h: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed test expectations update

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Set the initial scissor box for WebGL
https://bugs.webkit.org/show_bug.cgi?id=100804

Patch by Gregg Tavares <gman@google.com> on 2012-10-30
Reviewed by Kenneth Russell.

The initial scissor box needs to be set for WebGL

No new tests as no new functionality.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::initializeNewContext):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=100809
ScrollingCoordinator::attachToStateTree() should take an enum 
indicating what type of node to create

Reviewed by Simon Fraser.

New enum ScrollingNodeType will soon have other values, such as 
FixedNode.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::attachToStateTree):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
(ScrollingCoordinatorMac):

This patch generalizes this function so that it can be used to create 
different types of nodes and so that it is actually ready to create 
child nodes. 
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::attachToStateTree):

The rootStateNode is always a ScrollingNode.
(WebCore::ScrollingCoordinatorMac::ensureRootStateNodeForFrameView):

For the time being, always create a ScrollingNode.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::attachToScrollingCoordinator):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix issues with filters and reflections
https://bugs.webkit.org/show_bug.cgi?id=100308

Reviewed by Dirk Schulze.

Source/WebCore:

Composited filters were being applied to the wrong CALayer. The code used
primaryLayer(), which may be a CATransformLayer (which filters cannot apply
to; doing so causes console spew), or a CALayer that is used for reflection
flattening, which again is the wrong layer.

Test: css3/filters/composited-reflected.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateContentsVisibility): Replace .get()-> with ->
(WebCore::GraphicsLayerCA::updateContentsOpaque): Ditto.
(WebCore::GraphicsLayerCA::updateFilters): Apply filters to m_layer, not primaryLayer(),
and use m_layerClones, not primaryLayerClones().
(WebCore::GraphicsLayerCA::cloneLayer): When cloning a layer for reflections, copy filters
from the source layer.
* platform/graphics/ca/PlatformCALayer.h:
(PlatformCALayer): Add a member function to copy filters from a supplied layer.
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::setFilters): Remove blank line.
(PlatformCALayer::copyFiltersFrom): Copy CAFIlters from the given layer.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::copyFiltersFrom): Stub; no filters on Windows.

LayoutTests:

Test composited filters inside a nested reflection.

* css3/filters/composited-reflected-expected.png: Added.
* css3/filters/composited-reflected-expected.txt: Added.
* css3/filters/composited-reflected.html: Added.
* platform/mac/css3/filters/composited-reflected-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Delaying 'change' and 'input' event dispatching during HTMLInputElement::setValue
https://bugs.webkit.org/show_bug.cgi?id=100772

Reviewed by Abhishek Arya.

Source/WebCore:

'change' and 'input' events are asynchronous and not
cancelable. We can use ScopedEvent.

Test: fast/forms/range/range-type-change-onchange.html

* dom/Node.cpp:
(WebCore::Node::dispatchChangeEvent): Use dispatchScopedEvent.
(WebCore::Node::dispatchInputEvent): Ditto.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValue):
Make a scope to delay event dispatching.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleKeydownEvent): Ditto.

LayoutTests:

* fast/forms/range/range-type-change-onchange-expected.txt: Added.
* fast/forms/range/range-type-change-onchange.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix broken python unit test
https://bugs.webkit.org/show_bug.cgi?id=100810

Patch by Kangil Han <kangil.han@samsung.com> on 2012-10-30
Reviewed by Dirk Pranke.

BUG 100755 has broken python unit test, e.g. assertion fail, since it modified baseline path.
Therefore, this patch fixes it.

* Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
(TestRebaselineTest.test_baseline_directory):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132984 268f45cc-cd09-0410-ab3c-d52691b4dbfc
F4 inside <input type=time> should not open calendar picker
https://bugs.webkit.org/show_bug.cgi?id=100730

Reviewed by Kent Tamura.

Source/WebCore:

We lacked the check to see if the picker indicator is visible.

Test: fast/forms/time-multiple-fields/time-multiple-fields-open-picker-key-bindings.html

* html/BaseMultipleFieldsDateAndTimeInputType.cpp:
(WebCore::BaseMultipleFieldsDateAndTimeInputType::handleKeydownEvent): Check if picker indicator is visible.

LayoutTests:

* fast/forms/time-multiple-fields/time-multiple-fields-open-picker-key-bindings-expected.txt: Added.
* fast/forms/time-multiple-fields/time-multiple-fields-open-picker-key-bindings.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=100813
ScrollingCoordinatorMac::stateNodeForID() should return a 
ScrollingStateNode* instead of a ScrollingStateScrollingNode*

Reviewed by Sam Weinig.

ScrollingCoordinatorMac::stateNodeForID() should return a 
ScrollingStateNode* instead of a ScrollingStateScrollingNode* so that 
it can be used for other types of nodes once we add them.
* page/scrolling/mac/ScrollingCoordinatorMac.h:
(ScrollingCoordinatorMac):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinatorMac::recomputeWheelEventHandlerCountForFrameView):
(WebCore::ScrollingCoordinatorMac::requestScrollPositionUpdate):
(WebCore::ScrollingCoordinatorMac::stateNodeForID):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Fix failure to highlight nodes on web inspector
https://bugs.webkit.org/show_bug.cgi?id=100303

Patch by Seokju Kwon <seokju.kwon@samsung.com> on 2012-10-30
Reviewed by Gyuyoung Kim.

It is not working to highlight nodes on web inspector
when using 'Single Backing Store'.
Add code for drawing it if there is the highlighted node.

* ewk/ewk_view_single.cpp:
(_ewk_view_single_smart_repaints_process):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WTR] Memory leaks in TestWebKitAPI::didReceiveMessageFromInjectedBundle()
https://bugs.webkit.org/show_bug.cgi?id=100770

Patch by Sudarsana Nagineni <sudarsana.nagineni@intel.com> on 2012-10-30
Reviewed by Sam Weinig.

Adopt strings returned by WKStringCreateWithUTF8CString() in
didReceiveMessageFromInjectedBundle() to avoid memory leaks.

* TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp:
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add baselines for fast/images/exif-orientation-css.html and exif-orientation-image-document.html
https://bugs.webkit.org/show_bug.cgi?id=100807

Unreviewed, expectations update.


* platform/chromium-linux-x86/fast/images/exif-orientation-css-expected.png: Added.
* platform/chromium-linux/fast/images/exif-orientation-css-expected.png: Added.
* platform/chromium-linux/fast/images/exif-orientation-image-document-expected.png: Added.
* platform/chromium-mac-lion/fast/images/exif-orientation-css-expected.png: Added.
* platform/chromium-mac-lion/fast/images/exif-orientation-image-document-expected.png: Added.
* platform/chromium-mac-snowleopard/fast/images/exif-orientation-css-expected.png: Added.
* platform/chromium-mac-snowleopard/fast/images/exif-orientation-image-document-expected.png: Added.
* platform/chromium-mac/fast/images/exif-orientation-css-expected.png: Added.
* platform/chromium-mac/fast/images/exif-orientation-image-document-expected.png: Added.
* platform/chromium-win/fast/images/exif-orientation-image-document-expected.png: Added.
* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RoboHornetPro spends ~25% of total test time in WebCore::Region::Shape methods
https://bugs.webkit.org/show_bug.cgi?id=98800

Reviewed by Sam Weinig.

This patch brings our total RoboHornetPro time from 8.2 seconds to 5.3 seconds!

OverlapMap previously used Regions to track Layer bounds rects.
Unfortunately unioning a list of Regions is O(N^2)
where N is the number of Shapes (in this case rects).
This is because Shapes are immutable, so to union two shapes, we copy
both Shapes' segment/span vectors into a single new Shape.
Thus if we union a set of M Regions, each with 1 Shape, we'll end up copying
the segments of the first Shape N times before we have the final Region/Shape
and the second shape N-1 times. The sum of 1 to N is (N*(N-1))/2 aka order N^2.
Fixing the N^2 algorithm covered by https://bugs.webkit.org/show_bug.cgi?id=100814.

For now we just avoid this O(N^2) by moving away from Region, since OverlapMap
doesn't need it. We just collect a vector of the layer rects and hit-test that directly.
Hit-testing the rect list is O(N), just like hit-testing the same information in a Region would be.

Even better for us is that the OverlapMap is never even used in RoboHornetPro.
We just collect these rects to end up doing nothing with them. :)

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::OverlapMap::add):
(WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers):
(WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer):
(WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer):
(RenderLayerCompositor::OverlapMap):


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