[BlackBerry] Reset JS state for each test
https://bugs.webkit.org/show_bug.cgi?id=86899

Patch by Xiaobo Wang <xbwang@torchmobile.com.cn> on 2012-05-23
Reviewed by Nikolas Zimmermann.

* DumpRenderTree/blackberry/DumpRenderTree.cpp:
 (BlackBerry::WebKit::DumpRenderTree::resetToConsistentStateBeforeTesting):

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

Not reviewed.

* src/WebDocument.cpp:
(WebKit::WebDocument::insertUserStyleSheet):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r118096.
http://trac.webkit.org/changeset/118096
https://bugs.webkit.org/show_bug.cgi?id=87285

caused multiple crashes on the mac bots (Requested by
jessieberlin on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-05-23

* dom/ContainerNodeAlgorithms.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PlatformClockCM has uninitialized m_rate member.
https://bugs.webkit.org/show_bug.cgi?id=87217

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-controller-time.html

Initialize the m_rate member to a default of 1 (second-per-second), matching the implementation
of ClockGeneric.

* platform/mac/PlatformClockCM.mm:
(PlatformClockCM::PlatformClockCM):

LayoutTests:

* media/media-controller-time-expected.txt: Added.
* media/media-controller-time.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GenericClock loses precision due to float->double conversion.
https://bugs.webkit.org/show_bug.cgi?id=87227

Reviewed by Darin Adler.

No new tests; fixes media/media-controller-time.html on Chromium.

Only narrow to float after the entire calculation is complete. This requires now() and m_offset
to be double-precision.

* platform/ClockGeneric.cpp:
(ClockGeneric::currentTime):
(ClockGeneric::now): Make double-precision.
* platform/ClockGeneric.h:
(ClockGeneric): Make m_offset double-precision.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wx] Implement transparency layer support.
https://bugs.webkit.org/show_bug.cgi?id=87279

Reviewed by Kevin Ollivier.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wx] Make sure we do not create a substitute font if the facename is not found.
https://bugs.webkit.org/show_bug.cgi?id=87280

Reviewed by Kevin Ollivier.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening - one more media/track test is crashy.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wx] Fix memory leak in FontHolder.
https://bugs.webkit.org/show_bug.cgi?id=87281

Reviewed by Kevin Ollivier.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Encapsulated some calculations for whether portions of the heap are empty
https://bugs.webkit.org/show_bug.cgi?id=87210

Reviewed by Gavin Barraclough.

This is a step toward incremental DOM finalization.

* heap/Heap.cpp:
(JSC::Heap::~Heap): Explicitly call freeAllBlocks() instead of relying
implicitly on all blocks thinking they're empty. In future, we may
choose to tear down the heap without first setting all data structures
to "empty".

* heap/MarkedBlock.h:
(JSC::MarkedBlock::isEmpty):
(JSC::MarkedBlock::gatherDirtyCells): Renamed markCountIsZero to isEmpty,
in preparation for making it check for outstanding finalizers in addition
to marked cells.

* heap/MarkedSpace.cpp:
(Take):
(JSC::Take::Take):
(JSC::Take::operator()):
(JSC::Take::returnValue):
(JSC::MarkedSpace::shrink):
(JSC::MarkedSpace::freeAllBlocks): Refactored the "Take" functor to support
a conditional isEmpty check, so it dould be shared by shrink() and freeAllBlocks().

* heap/WeakBlock.cpp:
(JSC::WeakBlock::WeakBlock):
(JSC::WeakBlock::visitLiveWeakImpls):
(JSC::WeakBlock::visitDeadWeakImpls):
* heap/WeakBlock.h:
(WeakBlock):
(JSC::WeakBlock::isEmpty):
* heap/WeakSet.cpp:
(JSC::WeakSet::sweep):
(JSC::WeakSet::shrink): Use isEmpty(), in preparation for changes in
its implementation.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r116188): After exiting full screen, Safari window is frozen, then inline video speeds through frames as it catches up with audio
https://bugs.webkit.org/show_bug.cgi?id=87206

Reviewed by Darin Adler.

When re-enabling the Safari window's autodisplay flag, also force the window to re-display.
Otherwise, the window will not repaint itself until it is forced to by user interaction.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Regression(r112694): Crash in WebCore::AXObjectCache::postNotification 
https://bugs.webkit.org/show_bug.cgi?id=86029

Reviewed by Abhishek Arya.

Test: accessibility/content-changed-notification-causes-crash.html

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isDetached):
(AccessibilityObject):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::contentChanged):

LayoutTests: Regression(r112694): Crash in WebCore::AXObjectCache::postNotification
https://bugs.webkit.org/show_bug.cgi?id=86029

Reviewed by Abhishek Arya.

* accessibility/content-changed-notification-causes-crash-expected.txt: Added.
* accessibility/content-changed-notification-causes-crash.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Move queryLocalizedString to Platform.h
https://bugs.webkit.org/show_bug.cgi?id=85762

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/Platform:

* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::queryLocalizedString):
* chromium/public/WebLocalizedString.h: Added.
(WebKit):

Source/WebKit/chromium:

* WebKit.gyp:
* public/platform/WebKitPlatformSupport.h:
(WebKit::WebKitPlatformSupport::getPluginList):
* public/platform/WebLocalizedString.h:
* src/LocalizedStrings.cpp:
(WebCore::query):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Layers on main thread should get a RenderSurface for animating transform only if masksToBounds is true also
https://bugs.webkit.org/show_bug.cgi?id=87184

Reviewed by James Robinson.

Source/WebCore:

Layers on main thread get a RenderSurface if their impl counterpart may
have a RenderSurface due to its animating transform. We currently create
a RenderSurface for all layers with an animating transform and
a descendant that drawsContents. But a RenderSurface on impl also
implies that the layer masksToBounds. So only make a RenderSurface on
main thread when the layer also masksToBounds.

Modified unit test CCLayerTreeHostCommonTest.verifyAnimationsForRenderSurfaceHierarchy.

* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::subtreeShouldRenderToSeparateSurface):

Source/WebKit/chromium:

* tests/CCLayerTreeHostCommonTest.cpp:
(WebKitTests::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change acceptMIMETypes member to acceptTypes now that file extensions are legal accept types
https://bugs.webkit.org/show_bug.cgi?id=87271

Patch by Raymes Khoury <raymes@chromium.org> on 2012-05-23
Reviewed by Darin Fisher.

* public/WebFileChooserParams.h:
(WebFileChooserParams):
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::runOpenPanel):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(117918) - 4 webgl/tex-iomage-and-sub-image-2d-with-image tests failing on Mac bots.
https://bugs.webkit.org/show_bug.cgi?id=87136

Reviewed by Stephen White.

Source/WebCore:

Fixed longstanding bug in GraphicsContext3D constructor in Mac
port, and logic error in tracking of texture bound to unit 0. Also
fixed up Cairo port's constructor by code inspection. This code is
ripe for cleanup; Bug 87198 filed for this.

Covered by existing tests.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
    Initialize missing members.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
    Correctly initialize m_activeTexture.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::bindTexture):
    Fix logic error in tracking of texture bound to unit 0.

LayoutTests:

Unskipped tests.

* platform/mac/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement DOM4 DOMError
https://bugs.webkit.org/show_bug.cgi?id=87055

Patch by Alec Flett <alecflett@chromium.org> on 2012-05-23
Reviewed by Adam Barth.

Implement the DOMError class and it's IDL interface.

No new tests. Not testable yet, as it's not used.

* WebCore.gypi:
* dom/DOMError.cpp: Added.
(WebCore):
(WebCore::DOMError::DOMError):
* dom/DOMError.h: Added.
(WebCore):
(DOMError):
(WebCore::DOMError::create):
(WebCore::DOMError::name):
* dom/DOMError.idl: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][Wk2] Assertion failure when selecting an option in select list with size attribute greater than one
https://bugs.webkit.org/show_bug.cgi?id=86974

Patch by Dinu Jacob <dinu.jacob@nokia.com> on 2012-05-23
Reviewed by Simon Hausmann.

Select list with size attribute greater than one will not initially have any
item in selected state (if no option has 'selected' tag), resulting in
m_selectedModelIndex in WebPopupMenuProxyQt to be invalid. Hence, need to check
whether the old index is invalid before accessing the item at that index.

* UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_itemSelector.qml: Added new test that
  tests selection in a select list with size attribute value of 2.
* UIProcess/API/qt/tests/qmltests/common/selectwithsize.html: Added.
* UIProcess/qt/WebPopupMenuProxyQt.cpp:
(WebKit::PopupMenuItemModel::select): Check whether old index is valid before accessing
  the item at that index.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] UI thread unnecessarily blocks on WebKit thread when servicing requestAnimationFrames
https://bugs.webkit.org/show_bug.cgi?id=87289

Patch by Andrew Lo <anlo@rim.com> on 2012-05-23
Reviewed by Antonio Gomes.

requestAnimationFrame already covered by tests in LayoutTests/fast/animation.

If UI thread cannot acquire DisplayRefreshMonitor mutex immediately,
avoid blocking on the mutex, it can trigger the frame change on the next
animation tick instead.

* platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp:
(WebCore::DisplayRefreshMonitor::displayLinkFired):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac DRT should be able to load external URLs for replay performance tests
https://bugs.webkit.org/show_bug.cgi?id=86191

Reviewed by Alexey Proskuryakov.

Let external URL requests go through if the test file is not a local file or hosted at localhost.
e.g. "DumpRenderTree http://webkit.org/" as supposed to "DumpRenderTree test.html" or
"DumpRenderTree http://localhost:8000/".

* DumpRenderTree/mac/ResourceLoadDelegate.mm:
(isLocalhost):
(hostIsUsedBySomeTestsToGenerateError):
(-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):


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