[chromium] Route all animate calls through CCLayerTreeHost in composited mode to simplify rate limiting logic
https://bugs.webkit.org/show_bug.cgi?id=75577

Reviewed by Darin Fisher.

Source/WebCore:

This internalizes the animation rate limiting logic to CCLayerTreeHost and removes the setters/getters for the
m_animating flag. This requires that all animation updates have to go through CCLayerTreeHost to get the right
rate limiting behavior, regardless of which proxy is being used.

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::updateAnimations):
(WebCore::CCLayerTreeHost::layout):
(WebCore::CCLayerTreeHost::startRateLimiter):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::beginFrameAndCommit):

Source/WebKit/chromium:

Routes WebWidget-initiated animate() calls through the CCLayerTreeHost in composited mode. CCLayerTreeHost's
rate limiting logic needs to be aware of when requestAnimationFrame callbacks are run. In threaded mode, the
animate calls are driven from CCThreadProxy and so the CCLayerTreeHost can set whatever state it needs. This
makes the single-threaded mode where the animate calls are driven through the WebWidget interface outside of the
CCProxy's control.

This is a small step towards inverting the scheduling control from the WebWidget to the compositor.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::animate):
(WebKit::WebViewImpl::updateAnimations):
* src/WebViewImpl.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Date parsing is too restrictive.
https://bugs.webkit.org/show_bug.cgi?id=75671

Reviewed by Oliver Hunt.

Source/JavaScriptCore: 

ES5 date parsing currently requires all fields to be present, which does not match the spec (ES5.1 15.9.1.15).
The spec allow a date to be date only, or date + time.

The date portion on the should match: (pseudocode!:)
    [(+|-)YY]YYYY[-MM[-DD]]
though we are slightly more liberal (permitted by the spec), allowing:
    [+|-]Y+[-MM[-DD]]
The time portion should match:
    THH:mm[:ss[.sss]][Z|(+|-)HH:mm]
again we're slightly more liberal, allowing:
    THH:mm[:ss[.s+]][Z|(+|-)HH:mm]

* wtf/DateMath.cpp:
(WTF::parseES5DatePortion):
    - Month/day fields are optional, default to 01.
(WTF::parseES5TimePortion):
    - Hours/Minutes are requires, seconds/timezone are optional.
(WTF::parseES5DateFromNullTerminatedCharacters):
    - Dates may be date only, or date + time.

LayoutTests: 

* fast/js/date-parse-test-expected.txt:
* fast/js/script-tests/date-parse-test.js:
    - Add more test cases for Date.parse.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: IndexedDB: fix cursor prefetch crash
http://crbug.com/108071
https://bugs.webkit.org/show_bug.cgi?id=75596

Reviewed by Tony Chang.

Test: storage/indexeddb/prefetch-bugfix-108071.html
Note: DumpRenderTree doesn't exercise the bug, it only occurs in
multi-process chromium.  The layout test will soon be run as a
chromium ui test: http://codereview.chromium.org/9108004

* storage/IDBCursorBackendImpl.cpp:
(WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
(WebCore::IDBCursorBackendImpl::~IDBCursorBackendImpl): Destroy
cursors before their objectstores.
(WebCore::IDBCursorBackendImpl::prefetchReset): Don't run continue if
the cursor is closed.
(WebCore::IDBCursorBackendImpl::close): Set a closed flag.
* storage/IDBCursorBackendImpl.h:

LayoutTests: IndexedDB: fix cursor prefetch crash
https://bugs.webkit.org/show_bug.cgi?id=75596

Reviewed by Tony Chang.

* storage/indexeddb/prefetch-bugfix-108071-expected.txt: Added.
* storage/indexeddb/prefetch-bugfix-108071.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
sizeof(CSSRule) is 20 instead of 12 on Windows
https://bugs.webkit.org/show_bug.cgi?id=75665

Reviewed by Darin Fisher.

Unlike gcc and clang, MSVC pads each consecutive member variables of the same type
in bitfields. e.g. if you have:

sturct AB {
unsigned m_1 : 31;
bool m_2 : 1;
}

then MSVC pads m_1 and allocates sizeof(unsigned) * 2 for AB whereas gcc and clang
only allocate sizeof(unsigned) * 1 for AB.

Fix the bloat by turning all bitfields in CSSRule either signed or unsigned integers.

* css/CSSRule.cpp:
* css/CSSRule.h:
(WebCore::CSSRule::sourceLine):
(WebCore::CSSRule::setSourceLine):
(WebCore::CSSRule::hasCachedSelectorText):
(WebCore::CSSRule::setHasCachedSelectorText):
* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::CSSStyleRule):
(WebCore::CSSStyleRule::cleanup):
(WebCore::CSSStyleRule::selectorText):
(WebCore::CSSStyleRule::setSelectorText):
* css/CSSStyleRule.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][Texmap] Convert shaders in TextureMapperGL to use a macro
https://bugs.webkit.org/show_bug.cgi?id=75598

Use VERTEX_SHADER() and FRAGMENT_SHADER() macros, instead of quoted string literals when
declaring shaders in TextureMapperGL.

We need two macros to account for the differences between OpenGL and OpenGL ES2.

Reviewed by Martin Robinson.


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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Disallow access to DOM storage from detached frames.
https://bugs.webkit.org/show_bug.cgi?id=61326

Reviewed by Adam Barth.

* storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::disabledByPrivateBrowsingInFrame):

Source/WebKit/chromium: Check whether a WebView exists before accessing it in StorageAreaProxy. This is not necessarily the case, e.g. for detached iframes.
https://bugs.webkit.org/show_bug.cgi?id=61326

Reviewed by Adam Barth.

* src/StorageAreaProxy.cpp:
(WebCore::StorageAreaProxy::canAccessStorage):

LayoutTests: Unskip fast/storage/storage-detached-iframe.html on chromium
https://bugs.webkit.org/show_bug.cgi?id=61326

Reviewed by Adam Barth.

* fast/storage/storage-detached-iframe-expected.txt:
* fast/storage/storage-detached-iframe.html:
* platform/chromium/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Array.prototype.lastIndexOf ignores undefined fromIndex.
https://bugs.webkit.org/show_bug.cgi?id=75678

Reviewed by Sam Weinig.

Source/JavaScriptCore: 

array.lastIndexOf(x, undefined) is equivalent to array.lastIndexOf(x, 0), not array.lastIndexOf(x)

* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncLastIndexOf):
    - should check argumnet count, rather than checking agument value for undefined.

LayoutTests: 

* ietestcenter/Javascript/15.4.4.15-5-4-expected.txt:
    - check in passing result



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Refactoring] Moving between TreeScopes should be done by its own class.
https://bugs.webkit.org/show_bug.cgi?id=75290

Reviewed by Ryosuke Niwa.

This change extracted Node::setTreeScopeRecursively(),
setDocumentRecursively() and a part of setDocument() into a new
class called TreeScopeAdopter. By doing this, the idea of
moving a node from scope to scope, that was originally hidden
behind the forest of Node APIs, has become clearer.

Note that this change is a preparation for Bug 59816.

No new tests. No behavioral change.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/ContainerNode.cpp: Followed the renaming.
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::removeBetween):
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::appendChild):
(WebCore::ContainerNode::parserAddChild):
* dom/DOMAllInOne.cpp:
* dom/Document.cpp: Followed te renaming.
(WebCore::Document::setDocType):
(WebCore::Document::adoptNode):
* dom/Element.cpp: Followed te renaming.
(WebCore::Element::removeShadowRoot):
* dom/Node.cpp:
(WebCore::Node::setDocument):
(WebCore::Node::setTreeScope):
(WebCore::Node::didMoveToNewDocument):
* dom/Node.h:
* dom/TreeScope.h:
* dom/TreeScope.cpp:
(WebCore::TreeScope::adoptIfNeeded): moved from setTreeScopeRecursively()
* dom/TreeScopeAdopter.cpp: Added.
(WebCore::TreeScopeAdopter::TreeScopeAdopter):
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveTreeToNewDocument):
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* dom/TreeScopeAdopter.h: Added.
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::execute):
(WebCore::TreeScopeAdopter::needsScopeChange()):
(WebCore::TreeScopeAdopter::shadowRootFor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=75593
Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2012-01-05
Reviewed by Alexey Proskuryakov.

Null-check 'page' variable before use, to follow the common usage pattern of m_frame->page()
throughout the rest of FrameView.cpp.

* page/FrameView.cpp:
(WebCore::FrameView::notifyPageThatContentAreaWillPaint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed bad merge fix for r104259 which dropped a line from r104210.

* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More chromium expected results after r104208.

* platform/chromium-cg-mac-leopard/fast/table/032-expected.png: Added.
* platform/chromium-mac-leopard/fast/table/032-expected.txt: Removed.
* platform/chromium-win-xp/fast/table/032-expected.png:
* platform/chromium-win-xp/fast/table/032-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r104210): Dromaeo DOM test score is lower
https://bugs.webkit.org/show_bug.cgi?id=75679

Reviewed by Andreas Kling.

The regression was caused by isDomVersionConsistent not being able to obtain the tree version
inside isLengthCacheValid when m_cachedItem is null. Fix the regression by always setting
m_cachedItem to some node when caching the length so that we can obtain the tree version later.

Also address Antti's review comment to fit m_cachedLength, m_isLengthCacheValid, and
m_isItemCacheValid all in 32-bit.

* dom/DynamicNodeList.cpp:
(WebCore::DynamicSubtreeNodeList::SubtreeCaches::setLengthCache):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't hardcode expected file URIs in as they depend on the platform
https://bugs.webkit.org/show_bug.cgi?id=75666

Reviewed by Dirk Pranke.

* Scripts/webkitpy/layout_tests/port/win.py:
(WinPort.show_results_html_file):
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(MainTest.test_unexpected_failures):
(MainTest.test_results_directory_default):
(MainTest.test_results_directory_relative):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimize with memcpy instead of copying frame by frame in Realtimeanalyser::doFFTAnalysis
https://bugs.webkit.org/show_bug.cgi?id=74693

Patch by Wei James <james.wei@intel.com> on 2012-01-05
Reviewed by Kenneth Russell.

* webaudio/RealtimeAnalyser.cpp:
(WebCore::RealtimeAnalyser::doFFTAnalysis):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
date.toISOString produces incorrect results for dates with ms prior to 1970
https://bugs.webkit.org/show_bug.cgi?id=75684

Reviewed by Sam Weinig.

Source/JavaScriptCore: 

* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToISOString):

LayoutTests: 

* fast/js/date-toisostring-expected.txt:
* fast/js/script-tests/date-toisostring.js:
    - Added test case



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Date constructor handles infinite values incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=70998

Reviewed by Filip Pizlo.

Source/JavaScriptCore: 

* runtime/DateConstructor.cpp:
(JSC::constructDate):
    - should be checking !finite rather then isnan.

LayoutTests: 

* fast/js/date-constructor-expected.txt:
* fast/js/script-tests/date-constructor.js:
    - Added test cases.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move HTMLFormControlElementWithState class in its own header file.
https://bugs.webkit.org/show_bug.cgi?id=75482

Reviewed by Kent Tamura.

Move HTMLFormControlElementWithState class which was mixed in HTMLFormControlElement
files into its own header file and its own implementation file.

No new tests : the existing ones should cover the refactoring.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLElementsAllInOne.cpp:
* html/HTMLFormControlElement.cpp:
* html/HTMLFormControlElement.h:
* html/HTMLKeygenElement.h:
* html/HTMLSelectElement.h:
* html/HTMLTextFormControlElement.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104268 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/10633760> Update copyright strings

Reviewed by Mark Rowe.

Source/JavaScriptCore: 

* Info.plist:

Source/JavaScriptGlue: 

* Info.plist:

Source/WebCore: 

* Info.plist:

Source/WebKit/mac: 

* Info.plist:

Source/WebKit2: 

* Info.plist:
* PluginProcess/Info.plist:
* WebProcess/Info.plist:

WebKitLibraries: 

* win/tools/scripts/COPYRIGHT-END-YEAR:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WTF::String: Inline method shouldn't have WTF_EXPORT_PRIVATE
https://bugs.webkit.org/show_bug.cgi?id=75612

Patch by Hajime Morrita <morrita@chromium.org> on 2012-01-06
Reviewed by Kevin Ollivier.

* wtf/text/WTFString.h:
(WTF::String::findIgnoringCase):
(WTF::String::append):
(WTF::String::fromUTF8):
(WTF::String::fromUTF8WithLatin1Fallback):
(WTF::String::isHashTableDeletedValue):

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