Add missing compile flag for compositing
https://bugs.webkit.org/show_bug.cgi?id=98681

Patch by Rik Cabanier <cabanier@adobe.com> on 2012-10-08
Reviewed by Dirk Schulze.

This flag is needed in case there is a difference in API
when compositing is enabled

* Configurations/FeatureDefines.xcconfig:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Suppress editing/pasteboard/data-transfer-items.html failure.
https://bugs.webkit.org/show_bug.cgi?id=98686

Unreviewed, expectations change.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GTK port should warn if bug modifier is missing in TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=98678

Reviewed by Dirk Pranke.

Tools:

Reimplement the warn_if_bug_missing_in_test_expectations method in
GtkPort, returning True for producing a warning in such cases.

* Scripts/webkitpy/layout_tests/port/gtk.py:
(GtkPort.warn_if_bug_missing_in_test_expectations):

LayoutTests:

Add generic Bug(GTK) modifiers for two test expectations.

* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Upstream some tweaks for overlay play button on Android
https://bugs.webkit.org/show_bug.cgi?id=98671

Patch by Min Qin <qinmin@chromium.org> on 2012-10-08
Reviewed by Adam Barth.

This change stops displaying the overlay play button if video height is too small
No test for this. Will rebase layout test expectations for android later.

* css/mediaControlsChromiumAndroid.css:
(video::-webkit-media-controls-overlay-enclosure):

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

Rebaselined those 2 tables/ tests that were forgotten in the rebaselining after r103875.
https://bugs.webkit.org/show_bug.cgi?id=74888 was opened to track those rebaselining but
it looks like some platform fell through the cracks.

* platform/chromium/TestExpectations:
Removed the 2 entries.

* platform/chromium-mac-snowleopard/tables/mozilla_expected_failures/core/captions1-expected.png: Added.
* platform/chromium-mac-snowleopard/tables/mozilla_expected_failures/core/captions2-expected.png: Added.
* platform/chromium-mac/tables/mozilla_expected_failures/core/captions1-expected.png: Added.
* platform/chromium-mac/tables/mozilla_expected_failures/core/captions1-expected.txt: Added.
* platform/chromium-mac/tables/mozilla_expected_failures/core/captions2-expected.png: Added.
* platform/chromium-mac/tables/mozilla_expected_failures/core/captions2-expected.txt: Added.
Progression: the table captions are larger, which matches other browsers and other platforms' baselines.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Add PNGs after r130653,
and skip tests on Qt-WK2, because they fail on it.

* platform/qt-5.0-wk2/TestExpectations:
* platform/qt/fast/ruby/rubyDOM-insert-rt-expected.png: Added.
* platform/qt/fast/ruby/rubyDOM-insert-text1-expected.png: Added.
* platform/qt/fast/ruby/rubyDOM-insert-text2-expected.png: Added.
* platform/qt/fast/ruby/rubyDOM-insert-text3-expected.png: Added.
* platform/qt/fast/ruby/rubyDOM-remove-rt1-expected.png: Added.
* platform/qt/fast/ruby/rubyDOM-remove-rt2-expected.png: Added.
* platform/qt/fast/ruby/rubyDOM-remove-text1-expected.png: Added.
* platform/qt/fast/ruby/rubyDOM-remove-text2-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace 2 uses of updateLogicalHeight with computeLogicalHeight
https://bugs.webkit.org/show_bug.cgi?id=98677

Reviewed by Ojan Vafai.

This is part of bug 96804.  Convert RenderTextControl and RenderSVGForeignObject to
override the const computeLogicalHeight method rather than the updateLogicalHeight
setter method.

No new tests, there should be no behavior change as this is just a refactor.

* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeLogicalHeight): Pass logicalHeight through rather than setting height.
This is a slight correctness fix, although we don't support vertical inputs yet.
* rendering/RenderTextControl.h:
(RenderTextControl):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::computeLogicalHeight):
* rendering/svg/RenderSVGForeignObject.h:
(RenderSVGForeignObject):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] Add support for polygonal shapes
https://bugs.webkit.org/show_bug.cgi?id=96811

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

Source/WebCore:

Initial version of the layout support for polygonal exclusion shapes: the ExclusionPolygon class.
Supports the public ExclusionShape operations using the algorithm described here:
http://hansmuller-webkit.blogspot.com/2012/06/horizontal-box-polygon-intersection-for.html.
Although both the "included" and "excluded" operations are supported, only the former is
used, since only shape-inside is supported at the moment.

The ExclusionPolygon class stores the polygon's edges in an interval tree.

Polygon edges are represented by the ExclusionPolygonEdge struct, which records the indices of
the pair of vertices joined by the edge.  Edge vertex index1 is usually less than index2, except
the last edge where index2 is 0.  We plan to improve the algorithm that creates the edges
by spanning vertices contained in sequences of more than two colinear vertices. For example,
a triangular polygon might be specified with 5 vertices like this: 3,0 5,0, 5,5, 4,4 2,2, 0,0.
By spanning the extra colinear points: 0,0 5,0, 5,5, which implies index1-index2 edges: 5-1 1-2 2-5.

Although the implementation supports complex polygons, the layout code is limited to
essentially rectangular shapes until a patch for https://bugs.webkit.org/show_bug.cgi?id=96813
lands.

Tests: fast/exclusions/shape-inside/shape-inside-polygon-rectangle.html
       fast/exclusions/shape-inside/shape-inside-simple-polygon-001.html
       fast/exclusions/shape-inside/shape-inside-simple-polygon-002.html
       fast/exclusions/shape-inside/shape-inside-simple-polygon-003.html
       fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* rendering/ExclusionPolygon.cpp: Added.
(WebCore):
(EdgeIntersection): Internal description of the intersection of a polygon edge and a horizontal line.
(WebCore::ExclusionPolygon::ExclusionPolygon): See the introductory text above for a description of this type.
(WebCore::computeXIntersection): Find and classify the X intercept of a polygon edge with horizontal line, if any.
(WebCore::ExclusionPolygon::rightVertexY): This method is used to decide if a horizontal line "crosses" a vertex.
(WebCore::appendIntervalX): Append an x coordinate to a vector of ExclusionIntervals.
(WebCore::ExclusionPolygon::computeXIntersections): Return a vector of the intersections of a horizontal line with the polygon's edges.
(WebCore::ExclusionPolygon::computeEdgeIntersections): Return a vector of the X projections of the edges that overlap a horizonal rectangle.
(WebCore::ExclusionPolygon::getExcludedIntervals): Return a SegmentList of the X intervals within a horizontal rectangle that overlap the polygon.
(WebCore::ExclusionPolygon::getIncludedIntervals): Return the X intervals within a horizontal rectangle that fit inside the polygon.
* rendering/ExclusionPolygon.h: Added.
(WebCore):
(ExclusionPolygon):
(WebCore::ExclusionPolygon::getXAt): X coordinate of a polygon vertex
(WebCore::ExclusionPolygon::getYAt): Y coordinate of a polygon vertex
(WebCore::ExclusionPolygon::numberOfVertices):
(WebCore::ExclusionPolygon::fillRule): A WindRule value that defines "inside" for self-intersecting polygons.
(ExclusionPolygonEdge):
(WebCore::ExclusionPolygonEdge::ExclusionPolygonEdge):
(WebCore::ExclusionPolygonEdge::vertex1):
(WebCore::ExclusionPolygonEdge::vertex2):
(WebCore::ExclusionPolygonEdge::minX):
(WebCore::ExclusionPolygonEdge::minY):
(WebCore::ExclusionPolygonEdge::maxX):
(WebCore::ExclusionPolygonEdge::maxY):
* rendering/ExclusionShape.cpp:
(WebCore::createExclusionPolygon): Return a new ExclusionPolygon.
(WebCore):
(WebCore::ExclusionShape::createExclusionShape): Added support for BasicShape::BASIC_SHAPE_POLYGON.
* rendering/ExclusionShapeInsideInfo.cpp:
(WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock): Enable BASIC_SHAPE_POLYGON shapes for RenderBlocks.

LayoutTests:

Verify that a rectangular shape-inside specified as a polygon works as expected for all
writing-modes.

Added exclusions tests for non-complex concave shape-inside polygons as well.
The shapes in this set of tests are "rectangular" in the sense that
horizontal lines that overlap the polygon only cross the polygon twice.
The expected part of each test uses float "sandbags" to simulate the
shape-inside area in the test expectations. The  tests use SVG to
display the polygon itself, to simplify visual inspection.
(See http://www.alistapart.com/articles/sandbags/).

* fast/exclusions/shape-inside/shape-inside-polygon-rectangle-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-polygon-rectangle.html: Added.
* fast/exclusions/resources/simple-polygon.js: Added.
(createPolygon):
(polygonXIntercepts):
(generatePolygonContentString):
(simulatePolygonShape):
(generateSimulatedPolygonShapeInsideElement):
(positionInformativeText):
(createPolygonShapeInsideTestCase):
(createPolygonShapeInsideTestCaseExpected):
* fast/exclusions/shape-inside/shape-inside-simple-polygon-001-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-simple-polygon-001.html: Added.
* fast/exclusions/shape-inside/shape-inside-simple-polygon-002-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-simple-polygon-002.html: Added.
* fast/exclusions/shape-inside/shape-inside-simple-polygon-003-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-simple-polygon-003.html: Added.
* fast/exclusions/shape-inside/shape-inside-simple-polygon-004-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add render object that paints plugin snapshots
https://bugs.webkit.org/show_bug.cgi?id=98322
<rdar://problem/12426546>

Reviewed by Simon Fraser.

First, teach plugins to maintain a set of states when plugin snapshotting is enabled.

Second, a new RenderSnapshottedPlugIn class is a RenderEmbeddedObject that knows how to paint
snapshots when the plugin is not visibly playing. It maintains a RenderImageResource to
the generated poster image.

* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::HTMLPlugInElement): By default all plugins play on load.
* html/HTMLPlugInElement.h: Move the inheritance of ImageLoaderClientBase down to
HTMLPlugInImageElement, since that is the class that actually deals with image-based plugins.
(WebCore::HTMLPlugInElement::displayState): Add bit for display state.
(WebCore::HTMLPlugInElement::setDisplayState):
(WebCore::HTMLPlugInElement::updateSnapshot):

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): If plugin snapshotting is
enabled, plugin state is set to wait for a poster image.
(WebCore::HTMLPlugInImageElement::createRenderer): Create RenderSnapshottedPlugIn if
plugin snapshotting is enabled.
(WebCore::HTMLPlugInImageElement::updateSnapshot): Once a snapshot is available, update the
renderer and set its state to wait for user input to start the plugin.
* html/HTMLPlugInImageElement.h:
(HTMLPlugInImageElement):

* rendering/RenderObject.h:
(WebCore::RenderObject::isSnapshottedPlugIn): Add new function to identify
RenderSnapshottedPlugIn instances. Since RenderSnapshottedPlugIn inherits from
RenderEmbeddedObject, isEmbeddedObject() still returns true.
* rendering/RenderEmbeddedObject.h:
(RenderEmbeddedObject): Elevate a few virtual methods to protected for
RenderSnapshottedPlugIn to override.

* rendering/RenderSnapshottedPlugIn.cpp: Added.
(WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn): Initialize snapshot
resource.
(WebCore::RenderSnapshottedPlugIn::~RenderSnapshottedPlugIn): Shut down snapshot
image resource to remove the renderer as a client, and remove image from memory cache.
(WebCore::RenderSnapshottedPlugIn::plugInImageElement): Convenience function to get the
HTML element.
(WebCore::RenderSnapshottedPlugIn::updateSnapshot): Cache the snapshot, and repaint.
(WebCore::RenderSnapshottedPlugIn::paint): If the plugin is not playing, paint like a
RenderImage does.
(WebCore::RenderSnapshottedPlugIn::paintReplaced): Paint the snapshot and overlay if the
plugin is not playing.
(WebCore::RenderSnapshottedPlugIn::paintReplacedSnapshot): Inspired by
RenderImage::paintReplaced() and RenderImage::paintIntoRect().
* rendering/RenderSnapshottedPlugIn.h: Added.
(WebCore::RenderSnapshottedPlugIn::isSnapshottedPlugin): Returns true.

* rendering/RenderTheme.h: Add a function that paints the overlay on top of the snapshot.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintPlugInSnapshotOverlay):

* WebCore.xcodeproj/project.pbxproj: Add new RenderSnapshottedPlugIn class.
* CMakeLists.txt: Ditto.
* GNUmakefile.list.am: Ditto.
* Target.pri: Ditto.
* WebCore.gypi: Ditto.
* WebCore.vcproj/WebCore.vcproj: Ditto.
* rendering/RenderingAllInOne.cpp: Ditto.

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