HTMLMediaElement will not unthrottle page when playback stops for nreasons other than user-initiated pause.
https://bugs.webkit.org/show_bug.cgi?id=117016

Reviewed by Oliver Hunt.

Add a new class PageActivityAssertionToken to allow HTMLMediaElement to decouple
knowledge of and control over the lifetime of PageThrottler. The new class will
have weak references to and from the PageThrottler so that holders of the token
will not need to care if the Page or PageThrottler has been destroyed.

HTMLMediaElement will create one of these PageActivityAssertionTokens when playback
begins and destroy it when playback stops for any reason, or when the element is
destroyed.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::playbackProgressTimerFired):
(WebCore::HTMLMediaElement::updatePlayState):
* html/HTMLMediaElement.h:
* page/Page.cpp:
(WebCore::createActivityToken): Added simple factory method.
* page/Page.h:
* page/PageActivityAssertionToken.cpp:
(WebCore::PageActivityAssertionToken::PageActivityAssertionToken): Call addActivityToken();
(WebCore::PageActivityAssertionToken::~PageActivityAssertionToken): Call removeActivityToken();
(WebCore::PageActivityAssertionToken::invalidate): Clear m_throttler.
* page/PageActivityAssertionToken.h:
* page/PageThrottler.cpp:
(WebCore::PageThrottler::~PageThrottler): Invalidate all outstanding tokens.
(WebCore::PageThrottler::addActivityToken): Bump the activity count.
(WebCore::PageThrottler::removeActivityToken): Lower the activity count.
* page/PageThrottler.h:

Add the new files to the various build systems:
* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow no space between "background-position:" dimensions
https://bugs.webkit.org/show_bug.cgi?id=116870

Reviewed by Darin Adler.

From Blink r149314 by <ericwilligers@chromium.org>

Source/WebCore:

Specs allow no spaces between the dimensions of a
"background-position:" like "1px+1px", we should support
that.

Whitespaces are no longer early consumed, dramatically dropping
the shift/reduce conflicts to half. The productions unary_term,
calc_func_term, calc_func_expr and calc_func_paren_expr no longer
consume whitespaces.

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::realLex):

LayoutTests:

* fast/backgrounds/background-position-parsing-2-expected.txt:
* fast/backgrounds/background-position-parsing-2.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update XMLHttpRequest timeout tests to a newer version from W3C
https://bugs.webkit.org/show_bug.cgi?id=117023

Reviewed by Alexey Proskuryakov.

The XMLHttpRequest Timeout tests have gone through a bit of restructuring and should
be updated. This is being primarily done because of the intention of updating the
testharness scripts which would break these tests if they were left not updated.

These tests were updated from the W3C web-platform-tests GitHub repository.
https://github.com/w3c/web-platform-tests

* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-aborted.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-aborted.js: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-abortedonmain.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-abortedonmain.js: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-overrides-expected.txt: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-overrides.html: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-overrides.js: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-overridesexpires.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-overridesexpires.js: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-runner.js:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-simple.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-simple.js: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-synconmain.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-synconmain.js: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-synconworker.js: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-twice.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-twice.js: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-aborted.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-overrides-expected.txt: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-overrides.html: Added.
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-overridesexpires.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-simple.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-synconworker.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-worker-twice.html:
* http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout.js:
(RequestTracker.prototype.startXHR):
(AbortedRequest.prototype.startXHR.handleEvent):
(runTestRequests):


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