Update compositing/RTL tests to fail if the root layer is shifted incorrectly
https://bugs.webkit.org/show_bug.cgi?id=85820

Reviewed by James Robinson.

For the Chromium port, if the root layer was shifted incorrectly, the
non-composited red indicator layers would get drawn outside the root
layers bounds, making it impossible to see if the test was failing.

Also turn off overflow:hidden because compositing/ tests have mock
scrollbars. This makes it much easier to debug these tests locally.

* compositing/rtl/rtl-absolute-expected.png:
* compositing/rtl/rtl-absolute-overflow-expected.png:
* compositing/rtl/rtl-absolute-overflow-expected.txt:
* compositing/rtl/rtl-absolute-overflow-scrolled-expected.png:
* compositing/rtl/rtl-absolute-overflow-scrolled-expected.txt:
* compositing/rtl/rtl-absolute-overflow-scrolled.html:
* compositing/rtl/rtl-absolute-overflow.html:
* compositing/rtl/rtl-absolute.html:
* compositing/rtl/rtl-fixed-expected.png:
* compositing/rtl/rtl-fixed-overflow-expected.png:
* compositing/rtl/rtl-fixed-overflow-expected.txt:
* compositing/rtl/rtl-fixed-overflow-scrolled-expected.png:
* compositing/rtl/rtl-fixed-overflow-scrolled-expected.txt:
* compositing/rtl/rtl-fixed-overflow-scrolled.html:
* compositing/rtl/rtl-fixed-overflow.html:
* compositing/rtl/rtl-fixed.html:
* compositing/rtl/rtl-iframe-absolute-overflow-expected.png:
* compositing/rtl/rtl-iframe-absolute-overflow-expected.txt:
* compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.png:
* compositing/rtl/rtl-iframe-absolute-overflow-scrolled-expected.txt:
* compositing/rtl/rtl-iframe-fixed-overflow-expected.png:
* compositing/rtl/rtl-iframe-fixed-overflow-expected.txt:
* compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.png:
* compositing/rtl/rtl-iframe-fixed-overflow-scrolled-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove PlatformSupport::loadPlatformImageResource, call loadResource directly
https://bugs.webkit.org/show_bug.cgi?id=84417

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/WebCore:

* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* platform/chromium/PlatformSupport.h:
(PlatformSupport):
* platform/graphics/chromium/ImageChromium.cpp:
(WebCore::Image::loadPlatformResource):
* platform/graphics/chromium/ImageChromiumMac.mm: Removed.

Source/WebKit/chromium:

* src/PlatformSupport.cpp:
(WebCore):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116561 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: call abort handler when there are problems committing
https://bugs.webkit.org/show_bug.cgi?id=85841

Patch by Alec Flett <alecflett@chromium.org> on 2012-05-09
Reviewed by Ojan Vafai.

No new tests. Every existing test that calls commit() is testing
the success side of this, and this only throws when there are
LevelDB errors, which is exactly what we're trying to diagnose
with this patch.

* Modules/indexeddb/IDBBackingStore.h:
(Transaction):
* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::deleteDatabase):
(WebCore::IDBLevelDBBackingStore::Transaction::commit):
* Modules/indexeddb/IDBLevelDBBackingStore.h:
(Transaction):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::commit):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116562 268f45cc-cd09-0410-ab3c-d52691b4dbfc
When creating a new page during a navigation, prime the initial document with the correct referrer policy
https://bugs.webkit.org/show_bug.cgi?id=86001

Reviewed by Adam Barth.

Source/WebCore:

Test: http/tests/security/referrer-policy-redirect-link.html

* dom/Document.h:
(WebCore::Document::setReferrerPolicy):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):

Tools:

Store the referrer policy in the request, so the network stack can comply with it.

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::willSendRequest):

LayoutTests:

Skip the test on all but chromium, see https://bugs.webkit.org/show_bug.cgi?id=86000

* http/tests/security/referrer-policy-redirect-link-expected.txt: Added.
* http/tests/security/referrer-policy-redirect-link.html: Added.
* http/tests/security/resources/referrer-policy-postmessage.php: Added.
* http/tests/security/resources/referrer-policy-redirect-link.html: Added.
* platform/efl/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:
* platform/wk2/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116563 268f45cc-cd09-0410-ab3c-d52691b4dbfc
add some basic perf-o-matic tests for flexbox
https://bugs.webkit.org/show_bug.cgi?id=86017

Reviewed by Ryosuke Niwa.

Each of these tests take < 3s on my machine.

* Layout/flexbox-column-nowrap.html: Added.
* Layout/flexbox-column-wrap.html: Added.
* Layout/flexbox-row-nowrap.html: Added.
* Layout/flexbox-row-wrap.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CopiedSpace does not add pinned blocks back to the to-space filter
https://bugs.webkit.org/show_bug.cgi?id=86011

Reviewed by Geoffrey Garen.

After a collection has finished, we go through the blocks in from-space 
and move any of them that are pinned into to-space. At the beginning of 
collection, we reset the to-space block filter that is used during 
conservative scanning and add back the blocks that are filled during the 
collection. However, we neglect to add back those blocks that are moved 
from from-space to to-space, which can cause the conservative scan to 
think that some pinned items are not actually in CopiedSpace.

* heap/CopiedSpace.cpp:
(JSC::CopiedSpace::doneCopying): Add the pinned blocks back to the 
to-space filter. Also added a comment and assert for future readers that 
indicates that it's okay that we don't also add the block to the 
to-space block set since it was never removed.


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

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::clipboard):
* chromium/public/WebClipboard.h: Added.
(WebKit):
(WebClipboard):
(WebKit::WebClipboard::sequenceNumber):
(WebKit::WebClipboard::isFormatAvailable):
(WebKit::WebClipboard::readAvailableTypes):
(WebKit::WebClipboard::readPlainText):
(WebKit::WebClipboard::readHTML):
(WebKit::WebClipboard::readImage):
(WebKit::WebClipboard::readCustomData):
(WebKit::WebClipboard::writePlainText):
(WebKit::WebClipboard::writeHTML):
(WebKit::WebClipboard::writeURL):
(WebKit::WebClipboard::writeImage):
(WebKit::WebClipboard::writeDataObject):
(WebKit::WebClipboard::~WebClipboard):
* chromium/public/WebDragData.h: Added.
(WebKit):
(WebDragData):
(WebKit::WebDragData::~WebDragData):
(WebKit::WebDragData::WebDragData):
(WebKit::WebDragData::operator=):
(WebKit::WebDragData::isNull):
* chromium/public/WebImage.h: Added.
(WebKit):
(WebImage):
(WebKit::WebImage::~WebImage):
(WebKit::WebImage::WebImage):
(WebKit::WebImage::operator=):
(WebKit::WebImage::getSkBitmap):
(WebKit::WebImage::init):
(WebKit::WebImage::getCGImageRef):

Source/WebKit/chromium:

* WebKit.gyp:
* public/platform/WebClipboard.h:
* public/platform/WebDragData.h:
* public/platform/WebImage.h:
* public/platform/WebKitPlatformSupport.h:
(WebKit):
(WebKitPlatformSupport):
* src/AssertMatchingEnums.cpp:
* src/DragClientImpl.cpp:
* src/PlatformSupport.cpp:
* src/WebDragData.cpp:
* src/WebImageCG.cpp:
* src/WebImageDecoder.cpp:
* src/WebImageSkia.cpp:
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::copy):
* src/WebViewImpl.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup SVGElement.cpp
https://bugs.webkit.org/show_bug.cgi?id=86004

Reviewed by Eric Seidel.

Remove unneeded includes. We do not need to check attr in SVGElement::attributeChanged,
lower layers assume it is non-null and we do not call attributeChanged in SVG.

* svg/SVGElement.cpp:
(WebCore::SVGElement::attributeChanged):
(WebCore::SVGElement::isAnimatableAttribute):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=86025
RTL and vertical text documents do no scroll properly with the new 
tiled scrolling model
-and corresponding-
<rdar://problem/11077589>

Reviewed by Dan Bernstein.
        
Most of the fix here is just to teach the scrolling tree about the 
scroll origin.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinator::setScrollParameters):
* page/scrolling/ScrollingCoordinator.h:
(ScrollParameters):
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::update):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::scrollOrigin):
(ScrollingTreeNode):
* page/scrolling/ScrollingTreeState.cpp:
(WebCore::ScrollingTreeState::setScrollOrigin):
(WebCore):
* page/scrolling/ScrollingTreeState.h:
(WebCore::ScrollingTreeState::scrollOrigin):
(ScrollingTreeState):
* page/scrolling/mac/ScrollingTreeNodeMac.mm:
(WebCore::ScrollingTreeNodeMac::scrollPosition):
(WebCore::ScrollingTreeNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeNodeMac::minimumScrollPosition):
(WebCore::ScrollingTreeNodeMac::maximumScrollPosition):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidScroll):

Teaching the scrolling tree about the scroll origin revealed this pre-
existing bug. layoutOverflowRect() is not the right rect to use since 
it is not writing-mode savvy. unscaledDocumentRect() is the right rect 
for the view's bounds.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use suitable viewport values on XHTML-MP pages.
https://bugs.webkit.org/show_bug.cgi?id=85425

Patch by Hugo Parente Lima <hugo.lima@openbossa.org> on 2012-05-09
Reviewed by Kenneth Rohde Christiansen.

.:

Add LEGACY_VIEWPORT_ADAPTION use feature to cmake build system,
this feature will enable the use of a suitable viewport size
on legacy XHTML-MP pages.

* Source/cmake/WebKitFeatures.cmake:

Source/WebCore:

Tests: fast/viewport/viewport-legacy-xhtmlmp-misplaced-doctype.html
       fast/viewport/viewport-legacy-xhtmlmp-ordering.html
       fast/viewport/viewport-legacy-xhtmlmp.html

Use device-width and device-height as viewport size on
XHTML-MP pages if the use feature LEGACY_VIEWPORT_ADAPTION
is set according as the non normative section of
http://www.w3.org/TR/css-device-adapt/

* dom/Document.cpp:
(WebCore::Document::setDocType):

Tools:

Enable LEGACY_VIEWPORT_ADAPTION on Qt port.

* qmake/mkspecs/features/features.prf:

LayoutTests:

Add tests for legacy viewport adaption and skip them
on all ports but the Qt one.

* fast/viewport/viewport-legacy-xhtmlmp-expected.txt: Added.
* fast/viewport/viewport-legacy-xhtmlmp-misplaced-doctype-expected.txt: Added.
* fast/viewport/viewport-legacy-xhtmlmp-misplaced-doctype.html: Added.
* fast/viewport/viewport-legacy-xhtmlmp-ordering-expected.txt: Added.
* fast/viewport/viewport-legacy-xhtmlmp-ordering.html: Added.
* fast/viewport/viewport-legacy-xhtmlmp.html: Added.
* platform/chromium/test_expectations.txt:
* platform/efl/Skipped:
* platform/gtk/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116571 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix overzealous re-opened since blocked by... message
https://bugs.webkit.org/show_bug.cgi?id=86020

Reviewed by Adam Barth.

Changed CreateBug behavior to only re-open a blocked bug if it
was RESOLVED.  Also had to update the test infrastructure slightly
to allow for distinct mock commit revisions, so one could point
to a RESOLVED bug for testing while another pointed to an OPEN bug.

Also moved default created mock bug to be 60001 instead of 50004
which already exists as a reference mock bug.

* Scripts/webkitpy/common/checkout/checkout_mock.py:
(MockCheckout.__init__):
(MockCheckout.commit_info_for_revision):
* Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
(MockBugzilla.create_bug):
* Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
* Scripts/webkitpy/tool/commands/download_unittest.py:
(test_create_rollout_resolved):
* Scripts/webkitpy/tool/commands/queries_unittest.py:
(FailureReasonTest.test_blame_line_for_revision):
* Scripts/webkitpy/tool/steps/createbug.py:
(CreateBug.run):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Expose WebPluginContainer of WebPlugin to embedder
https://bugs.webkit.org/show_bug.cgi?id=85916

Reviewed by Darin Fisher.

The browser plugin needs to access its current guest's  WebPluginContainer
so that it can replace the guest with another guest WebPlugin when navigating
across processes.

* public/WebPlugin.h:
(WebPlugin):
(WebKit::WebPlugin::container):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116573 268f45cc-cd09-0410-ab3c-d52691b4dbfc
setPageScaleFactor should setScrollPosition if scale is unchanged
https://bugs.webkit.org/show_bug.cgi?id=84400

Patch by Alexandre Elias <aelias@google.com> on 2012-05-09
Reviewed by Adam Barth.

Previously, setPageScaleFactor forgot about its "origin" argument if
the page scale factor is unchanged.  This has proven undesirable in
practice because, for example, a single pinch gesture may zoom in and
back out to the original page scale factor, but at a different scroll
offset.

New test case added to scale-and-scroll-body-expected.txt

* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GC race condition in OpaqueJSClass::prototype
https://bugs.webkit.org/show_bug.cgi?id=86034

Reviewed by Filip Pizlo.

The bug here is basically:
    if (weakref) weakref->method()
where a GC may occur between the if & the method call.

* API/JSClassRef.cpp:
(OpaqueJSClass::prototype):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GC race condition in OpaqueJSClass::prototype
https://bugs.webkit.org/show_bug.cgi?id=86034

Build fix.

* API/JSClassRef.cpp:
(OpaqueJSClass::prototype):
    - Eeeep, landed bad version of patch!



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speed up some parts of TileCache drawing
https://bugs.webkit.org/show_bug.cgi?id=86033
<rdar://problem/10919373>

Reviewed by Sam Weinig.

* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::tileCoverageRect):
If we can't have scrollbars, there's not much need to extend the tile coverage rect outside of the visible rect, since it's
unlikely that we'll do any form of scrolling here.

(WebCore::TileCache::revalidateTiles):
Don't update the tile layer frame if it's big enough to contain the tile size. Also, if there are no new tiles created,
don't call platformCALayerDidCreateTiles since that will trigger an extra layer flush.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Fix issue where V8BindingPerContextData could keep the context object alive
https://bugs.webkit.org/show_bug.cgi?id=86036

Reviewed by Kentaro Hara.

This is a partial revert of http://trac.webkit.org/changeset/114320/. This keeps
the layout tests that were introduced since it turns out that
http://trac.webkit.org/changeset/114989 fixes the tests too.

Covered by: http/tests/security/isolatedWorld/context-destroy.html

* bindings/v8/V8IsolatedContext.cpp:
(WebCore::V8IsolatedContext::destroy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] LayoutTestController should use ENABLE guards for some features
https://bugs.webkit.org/show_bug.cgi?id=86030

Reviewed by Eric Seidel.

These features are disabled on OS(ANDROID) and so shouldn't be compiled
when the feature is off.

* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
* DumpRenderTree/chromium/LayoutTestController.h:
(LayoutTestController):
* DumpRenderTree/chromium/TestShell.h:
(TestShell):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r116573.
http://trac.webkit.org/changeset/116573
https://bugs.webkit.org/show_bug.cgi?id=86038

Broke the Chromium Mac compile (Requested by ojan_gardening on
#webkit).

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

* public/WebPlugin.h:
(WebPlugin):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
It should be possible to get useful debug logging from the JIT memory allocator
https://bugs.webkit.org/show_bug.cgi?id=86042

Reviewed by Geoff Garen.

Source/JavaScriptCore: 

* jit/ExecutableAllocator.h:

Source/WTF: 

* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::findAndRemoveFreeSpace):
(WTF::MetaAllocator::addFreeSpace):
(WTF::MetaAllocator::dumpProfile):



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