CSS 2.1 failure: content-counter-010.htm fails
https://bugs.webkit.org/show_bug.cgi?id=81447

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Test: fast/css/content-counter-010.htm

Per http://lists.w3.org/Archives/Public/public-css-testsuite/2010Nov/0064.html, the correct rendering of
7000 to 7999 in Armenian changed in Nov 2010. Update implementation to match the revised spec.

* rendering/RenderListMarker.cpp:
(WebCore::toArmenianUnder10000):

LayoutTests:

* fast/css/content-counter-010-expected.html: Added.
* fast/css/content-counter-010.htm: Added.
  Note that <meta http-equiv="Content-Type" content="text/html; charset=utf-8"  was added to the suite test
  to allow it to render correctly from a file:/ url.
* fast/lists/w3-css3-lower-armenian-expected.txt:
* fast/lists/w3-css3-lower-armenian.html:
* fast/lists/w3-css3-upper-armenian-expected.txt:
* fast/lists/w3-css3-upper-armenian.html:
  Amended tests to conform to revised specification for numbers between 7000 and 7999.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Tests] Move fast/notifications/notifications-double-show.html to http/tests/notifications
https://bugs.webkit.org/show_bug.cgi?id=95537
<rdar://problem/12213860>

Reviewed by Alexey Proskuryakov.

Calling show() multiple times should only call the ondisplay event handler once.

* fast/notifications/notifications-double-show-expected.txt: Removed.
* fast/notifications/notifications-double-show.html: Removed.
* http/tests/notifications/legacy/double-show-expected.txt: Added.
* http/tests/notifications/legacy/double-show.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The options dictionary in Notification constructor should not accept event listeners
https://bugs.webkit.org/show_bug.cgi?id=95538
<rdar://problem/12213901>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

The latest spec only allows setting the event listeners after the notification has been created.

Test: http/tests/notifications/events-in-dictionary.html

* Modules/notifications/Notification.cpp:
(WebCore::Notification::create): Do not look for the event handlers in the options dictionary.

LayoutTests:

Make sure the onshow handler added in the options dictionary does not get called.

* http/tests/notifications/events-in-dictionary-expected.txt: Added.
* http/tests/notifications/events-in-dictionary.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<audio> and <video> should send Do Not Track when appropriate
https://bugs.webkit.org/show_bug.cgi?id=96134

Reviewed by Eric Carlson.

Source/WebCore:

Add a FrameLoaderClient function to determine whether the DNT header should be sent,
and plumb that new function down into the MediaPlayerPrivateAVFoundationObjC class.

Test: http/tests/media/video-donottrack.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldSendDoNotTrackHTTPHeader):
    Pass the question on through to the FrameLoaderClient.
* html/HTMLMediaElement.h:
* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::shouldSendDoNotTrackHTTPHeader):
    Call through to the implementation in WebKit or WebKit2.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldSendDoNotTrackHTTPHeader):
    Pass the question on to the HTMLMediaElement.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
    If we should send the DNT header, add it to the header options array
    when creating the AVAsset.

Source/WebKit/mac:

Add support for the shouldSendDoNotTrackHTTPHeader by passing the request
on to the WebFrameLoadDelegate.

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::shouldSendDoNotTrackHeader):
    Pass the question on to the WebFrameLoadDelegate.
* WebView/WebDelegateImplementationCaching.h:
(WebFrameLoadDelegateImplementationCache):
    Add an entry for the delegate's webViewShouldSendDoNotTrackHeader method.
* WebView/WebDelegateImplementationCaching.mm:
(CallResourceLoadDelegateReturningBoolean): Added a 0-parameter overloaded function.
* WebView/WebView.mm:
(-[WebView _cacheFrameLoadDelegateImplementations]): initialize the
    cached value for shouldSendDoNotTrackHeaderFunc.

Source/WebKit2:

Add support for the shouldSendDoNotTrackHTTPHeader by passing the request
on to the WebFrameLoadDelegate.

* Shared/APIClientTraits.cpp: Increment the interfaceSizes for
    WKBundlePageLoaderClient by the value of the new functions.
* Shared/APIClientTraits.h: Ditto.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h: Add a new API to
    WKBundlePageLoaderClient and bump the version number.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::shouldSendDoNotTrackHTTPHeader):
    Pass the question on to the client.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::shouldSendDoNotTrackHTTPHeader):
    Pass the question on to the bundle.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/qt/QtBuiltinBundlePage.cpp:
(WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):
    Add an entry for the new function in the Qt loader client.

Tools:

Add a testRunner JS API for calling setShouldSendDoNotTrackHTTPHeader to DRT and
WTR. Add FrameLoaderClient client methods for retrieving that value.

* DumpRenderTree/TestRunner.cpp:
(setShouldSendDoNotTrackHTTPHeaderCallback): Pass through to the TestRunner.
(TestRunner::staticFunctions): Add the setShouldSendDoNotTrackHTTPHeader function.
* DumpRenderTree/TestRunner.h:
(TestRunner::setShouldSendDoNotTrackHTTPHeader): Simple setter.
(TestRunner::shouldSendDoNotTrackHTTPHeader): Simple getter.
* DumpRenderTree/mac/FrameLoadDelegate.mm:
(-[FrameLoadDelegate webViewShouldSendDoNotTrackHTTPHeader:]):
    Pass the question on to the TestRunner.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
    Add the setShouldSendDoNotTrackHTTPHeader client function.
(WTR::InjectedBundlePage::shouldSendDoNotTrackHTTPHeader):
    Pass the question on to the TestRunner.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::shouldSendDoNotTrackHTTPHeader): Simple getter.
(WTR::TestRunner::setShouldSendDoNotTrackHTTPHeader): Simple Setter.

LayoutTests:

Add a new HTTP test ensuring the DNT header is passed correctly during video tests.

* http/tests/media/resources/video-donottrack-check-donottrack.php: Added.
* http/tests/media/video-donottrack-expected.txt: Added.
* http/tests/media/video-donottrack.html: Added.

Skip the new tests on platforms which do not support it:
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Fix deadlock between WebMediaPlayerClientImpl dtor and PutCurrentFrame
https://bugs.webkit.org/show_bug.cgi?id=96010

Reviewed by James Robinson.

Source/Platform:

Add some additional clarifying comments.

* chromium/public/WebVideoFrameProvider.h:
(Client):
(WebVideoFrameProvider):

Source/WebKit/chromium:

The key fix here is that the destructor no longer has a mutex.
The m_compositingMutex was supposedly protecting races between
~WebMediaPlayerClientImpl and setVideoFrameProviderClient. The
former is only called from the main thread and the latter is called
from the compositor thread only when the main thread is blocked (and
it already asserts that this is the case).

In addition, the m_providerMutex in CCVideoLayerImpl prevents the
destruction of WebMediaPlayerClientImpl, thus keeping the frame
acquired via getCurrentFrame alive until putCurrentFrame is called.
These functions are only called by the client, and comments are added
to the interface to better document this.

To prevent a race between load() and getCurrentFrame/putCurrentFrame
(which are called from different threads) a new m_webMediaPlayerMutex
to replace part of what the old m_compositingMutex was doing.

* src/WebMediaPlayerClientImpl.cpp:
(WebKit::WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl):
(WebKit::WebMediaPlayerClientImpl::load):
(WebKit::WebMediaPlayerClientImpl::loadInternal):
(WebKit::WebMediaPlayerClientImpl::setVideoFrameProviderClient):
(WebKit::WebMediaPlayerClientImpl::getCurrentFrame):
(WebKit::WebMediaPlayerClientImpl::putCurrentFrame):
* src/WebMediaPlayerClientImpl.h:
(WebMediaPlayerClientImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exlusions] add support for the basic shapes
https://bugs.webkit.org/show_bug.cgi?id=95490

Patch by Hans Muller <hmuller@adobe.com> on 2012-09-10
Reviewed by David Hyatt.

Initial commit of a subset of the ExclusionShape classes.

This set of classes enables the exclusions layout code to determine how to break up a line into segments
that will fit within or around a shape, given the Y coordinates of the line's top edge and bottom edges.
The ExclusionShape class represents BasicShapes whose coordinates have been resolved to actual values. It
provides a pair of methods, getInsideIntervals() and getOutsideIntervals(), that return the line segments'
start and end X coordinates, and a method that computes the shape's bounding box. The line segments'
coordinates are represented by a Vector of ExclusionIntervals. ExclusionInterval is just a pair
of X coordinates.

The other classes, ExclusionRectangle (and TBD ExclusionPolygon et al), are internal to the
ExclusionShape implementation.

This is the initial version of the ExclusionShapes code and it's only being used to the limited extent WebKit
currently supports shape-inside exclusions. It will be extended to support computing a minimal
line segment's "first layout location" and other improvements, in tandem with the exclusions layout code.

No new tests have been added since this code just replaces a provisional implementation stub.

More information about the algorithms used by the ExclusionShapes classes can be found here: http://hansmuller-webkit.blogspot.com.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* rendering/ExclusionInterval.cpp: Added.
(WebCore):
(WebCore::IntervalX1Comparator::operator()):
Compare x1 ExclusionInterval fields.
(WebCore::ExclusionInterval::intersect):
Compute the intersection of this interval with another interval. Unlike merge/subtract,
the result is always a single interval.
(WebCore::sortExclusionIntervals):
Sort a vector of intervals by their x1 (start) field.
(WebCore::mergeExclusionIntervals):
Union of two vectors of intervals.
(WebCore::intersectExclusionIntervals):
Intersecion of two vectors of intervals.
(WebCore::subtractExclusionIntervals):
Difference of two vectors of intervals.

* rendering/ExclusionInterval.h: Added.
Represents the actual start and end coordinates of a horizontal line segment.
(WebCore):
(ExclusionInterval):
(WebCore::ExclusionInterval::ExclusionInterval):

* rendering/ExclusionRectangle.cpp: Added.
(WebCore):
(WebCore::ellipseXIntercept):
(WebCore::ExclusionRectangle::getOutsideIntervals):
(WebCore::ExclusionRectangle::getInsideIntervals):

* rendering/ExclusionRectangle.h: Added.
A subclass of ExclusionShape used to represent rounded rectangles, circles, and ellipses.
(WebCore):
(ExclusionRectangle)
(WebCore::ExclusionRectangle::ExclusionRectangle):
(WebCore::ExclusionRectangle::shapeBoundingBox):

* rendering/ExclusionShape.cpp: Added.
(WebCore):
(WebCore::createExclusionRectangle):
(WebCore::createExclusionCircle):
(WebCore::createExclusionEllipse):
(WebCore::Exclusionhape::createExclusionShape):
Creates an ExclusionShape given a BasicShape and the width/height of a border box.  Currently rounded
rectangles, circles, and ellipses are supported.  Support for polygons will be included in the
next patch.

* rendering/ExclusionShape.h: Added.
The rest of the exclusions implementation will only depend on the definitions included by this file: ExclusionShape,
and ExclusionInterval. ExclusionShape subclasses define shape-specific implementations of the methods that compute the
horizontal intervals that fit within or around a specific shape, a shape's bounding box, and - in future
revisions - other operations required by the exclusions implementation, like computing the first possible
layout location within a shape. ExclusionShapes are created for BasicShape objects as needed, using the
createExclusionShape() method.
(WebCore):
(ExclusionShape):
(WebCore::ExclusionShape::~ExclusionShape):

* rendering/WrapShapeInfo.cpp:
(WebCore::WrapShapeInfo::computeShapeSize):
Create an ExclusionShape for the RenderBlock's BasicShape.
(WebCore::WrapShapeInfo::computeSegmentsForLine):
Use ExclusionShape::getInsideIntervals() to compute the shape-inside intervals within which a line will fit.

* rendering/WrapShapeInfo.h:
(WebCore::WrapShapeInfo::shapeTop):
Removed - no longer used.
(WrapShapeInfo):
(WebCore::WrapShapeInfo::lineState):
Use the ExclusionShape's bounding box to compute lineState.

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