[Shadow] A 'selectstart' event fired on distributed nodes should not be stopped at shadow boundary of the parent shadow host.
https://bugs.webkit.org/show_bug.cgi?id=90508

Reviewed by Dimitri Glazkov.

Source/WebCore:

We should not stop some kinds of events at the shadow boundary of a shadow host if the
event is fired on distributed nodes.

See the spec for such kinds of events.
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#events-that-are-always-stopped

Test: fast/dom/shadow/events-stopped-at-shadow-boundary.html

* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::ensureEventAncestors):
(WebCore::inTheSameScope):
(WebCore):
(WebCore::EventDispatcher::determineDispatchBehavior):
* dom/EventDispatcher.h:
(EventDispatcher):

LayoutTests:

* fast/dom/shadow/events-stopped-at-shadow-boundary-expected.txt:
* fast/dom/shadow/events-stopped-at-shadow-boundary.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Introduce CCResourceProvider, replacing TextureAllocator and hiding textures from clients to allow transport
https://bugs.webkit.org/show_bug.cgi?id=91044

Reviewed by Adrienne Walker.

This does several things:
- Add a CCResourceProvider class, that hides textures and the 3D context
from layers (except those that need it). Instead layers manage
"resources". In the future, resources are expected to be transportable
to a "parent" CCResourceProvider to allow flattening of nested
compositors.
- Replace texture ids by resource ids in DrawQuads (allowing them to be
serializable).
- Replace TextureAllocator uses by the CCResourceProvider class.
- Upload of data is done through the CCResourceProvider instead of
explicit GL calls.
- External textures are wrapped into a resource at draw time (see
caveat/FIXME in CCTextureLayerImpl).
- Rendering with the resources is done through an explicit
beginRenderFrom/endRenderFrom that exposes the texture only between that
pair.
- Merge all the LayerTextureSubImage instances (one per layer), into a
single instance on the CCResourceProvider.

Added CCResourceProviderTest, the refactoring is covered by existing tests.

Source/Platform:

* chromium/public/WebCompositorTextureQuad.h:
(WebCompositorTextureQuad):
(WebKit::WebCompositorTextureQuad::resourceId):
* chromium/public/WebCompositorTileQuad.h:
(WebCompositorTileQuad):
(WebKit::WebCompositorTileQuad::resourceId):

Source/WebCore:

* WebCore.gypi:
* platform/chromium/support/WebCompositorTextureQuad.cpp:
(WebKit::WebCompositorTextureQuad::create):
(WebKit::WebCompositorTextureQuad::WebCompositorTextureQuad):
* platform/chromium/support/WebCompositorTileQuad.cpp:
(WebKit::WebCompositorTileQuad::create):
(WebKit::WebCompositorTileQuad::WebCompositorTileQuad):
* platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp:
(WebCore::BitmapCanvasLayerTextureUpdater::Texture::updateRect):
(WebCore::BitmapCanvasLayerTextureUpdater::create):
(WebCore::BitmapCanvasLayerTextureUpdater::BitmapCanvasLayerTextureUpdater):
(WebCore::BitmapCanvasLayerTextureUpdater::prepareToUpdate):
(WebCore::BitmapCanvasLayerTextureUpdater::updateTextureRect):
* platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h:
(WebCore):
(Texture):
(BitmapCanvasLayerTextureUpdater):
* platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp:
(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect):
(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::create):
(WebCore::BitmapSkPictureCanvasLayerTextureUpdater::BitmapSkPictureCanvasLayerTextureUpdater):
* platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h:
(Texture):
(BitmapSkPictureCanvasLayerTextureUpdater):
* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerChromium::createTextureUpdaterIfNeeded):
* platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.cpp:
(WebCore::createAcceleratedCanvas):
(WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect):
(WebCore::FrameBufferSkPictureCanvasLayerTextureUpdater::updateTextureRect):
* platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h:
(Texture):
(FrameBufferSkPictureCanvasLayerTextureUpdater):
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerTextureUpdater::create):
(WebCore::ImageLayerTextureUpdater::updateTextureRect):
(WebCore::ImageLayerTextureUpdater::ImageLayerTextureUpdater):
(ImageLayerTextureUpdater):
(WebCore::ImageLayerChromium::createTextureUpdaterIfNeeded):
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::create):
(WebCore::LayerRendererChromium::LayerRendererChromium):
(WebCore::LayerRendererChromium::decideRenderPassAllocationsForFrame):
(WebCore::applyFilters):
(WebCore::LayerRendererChromium::drawBackgroundFilters):
(WebCore::LayerRendererChromium::drawRenderPassQuad):
(WebCore::LayerRendererChromium::drawTileQuad):
(WebCore::LayerRendererChromium::drawYUVVideoQuad):
(WebCore::LayerRendererChromium::drawTextureQuad):
(WebCore::LayerRendererChromium::drawIOSurfaceQuad):
(WebCore::LayerRendererChromium::drawHeadsUpDisplay):
(WebCore::LayerRendererChromium::finishDrawingFrame):
(WebCore::LayerRendererChromium::getFramebufferTexture):
(WebCore::LayerRendererChromium::useRenderPass):
(WebCore::LayerRendererChromium::useScopedTexture):
(WebCore::LayerRendererChromium::bindFramebufferToTexture):
(WebCore::LayerRendererChromium::finishCurrentFramebuffer):
(WebCore):
(WebCore::LayerRendererChromium::initializeSharedObjects):
* platform/graphics/chromium/LayerRendererChromium.h:
(LayerRendererChromium):
(WebCore::LayerRendererChromium::resourceProvider):
* platform/graphics/chromium/LayerTextureSubImage.cpp:
(WebCore::LayerTextureSubImage::LayerTextureSubImage):
(WebCore::LayerTextureSubImage::upload):
(WebCore::LayerTextureSubImage::uploadWithTexSubImage):
(WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
* platform/graphics/chromium/LayerTextureSubImage.h:
(WebKit):
(LayerTextureSubImage):
* platform/graphics/chromium/LayerTextureUpdater.h:
(WebCore):
(Texture):
* platform/graphics/chromium/ManagedTexture.cpp:
(WebCore::ManagedTexture::ManagedTexture):
(WebCore::ManagedTexture::reserve):
(WebCore::ManagedTexture::allocate):
(WebCore::ManagedTexture::steal):
(WebCore::ManagedTexture::clear):
* platform/graphics/chromium/ManagedTexture.h:
(WebCore::ManagedTexture::resourceId):
(ManagedTexture):
* platform/graphics/chromium/ScrollbarLayerChromium.cpp:
(WebCore::ScrollbarLayerChromium::pushPropertiesTo):
(WebCore::ScrollbarLayerChromium::createTextureUpdaterIfNeeded):
* platform/graphics/chromium/TextureCopier.cpp:
(WebCore::AcceleratedTextureCopier::copyTexture):
(WebCore):
(WebCore::AcceleratedTextureCopier::flush):
* platform/graphics/chromium/TextureCopier.h:
(TextureCopier):
(AcceleratedTextureCopier):
* platform/graphics/chromium/TextureManager.cpp:
(WebCore::TextureManager::TextureManager):
(WebCore::TextureManager::deleteEvictedTextures):
(WebCore::TextureManager::removeTexture):
(WebCore::TextureManager::allocateTexture):
(WebCore::TextureManager::requestTexture):
* platform/graphics/chromium/TextureManager.h:
(WebCore):
(WebCore::TextureManager::create):
(TextureManager):
(TextureInfo):
(EvictionEntry):
* platform/graphics/chromium/TextureUploader.h:
(TextureUploader):
* platform/graphics/chromium/ThrottledTextureUploader.cpp:
(WebCore::ThrottledTextureUploader::uploadTexture):
* platform/graphics/chromium/ThrottledTextureUploader.h:
(ThrottledTextureUploader):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::pushPropertiesTo):
* platform/graphics/chromium/TrackingTextureAllocator.cpp: Removed.
* platform/graphics/chromium/TrackingTextureAllocator.h: Removed.
* platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
(WebCore::CCHeadsUpDisplay::draw):
* platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
(WebCore::CCIOSurfaceLayerImpl::willDraw):
* platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h:
(CCIOSurfaceLayerImpl):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::willDraw):
(WebCore::CCLayerImpl::didDraw):
(WebCore::CCLayerImpl::contentsResourceId):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(CCLayerImpl):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::initializeLayerRenderer):
(WebCore::CCLayerTreeHost::deleteContentsTexturesOnImplThread):
(WebCore::CCLayerTreeHost::beginCommitOnImplThread):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore):
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
(WebCore::CCLayerTreeHostImpl::releaseContentsTextures):
(WebCore::CCLayerTreeHostImpl::didDrawAllLayers):
(WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(WebCore):
(WebCore::CCLayerTreeHostImpl::resourceProvider):
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCPrioritizedTexture.cpp:
(WebCore::CCPrioritizedTexture::acquireBackingTexture):
(WebCore::CCPrioritizedTexture::resourceId):
(WebCore::CCPrioritizedTexture::upload):
(WebCore::CCPrioritizedTexture::beginRenderTo):
(WebCore::CCPrioritizedTexture::endRenderTo):
(WebCore):
* platform/graphics/chromium/cc/CCPrioritizedTexture.h:
(WebCore):
(CCPrioritizedTexture):
(WebCore::CCPrioritizedTexture::Backing::resourceId):
(WebCore::CCPrioritizedTexture::Backing::Backing):
(Backing):
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
(WebCore::CCPrioritizedTextureManager::CCPrioritizedTextureManager):
(WebCore::CCPrioritizedTextureManager::~CCPrioritizedTextureManager):
(WebCore::CCPrioritizedTextureManager::acquireBackingTextureIfNeeded):
(WebCore::CCPrioritizedTextureManager::reduceMemory):
(WebCore::CCPrioritizedTextureManager::clearAllMemory):
(WebCore::CCPrioritizedTextureManager::allBackingTexturesWereDeleted):
(WebCore::CCPrioritizedTextureManager::createBacking):
(WebCore::CCPrioritizedTextureManager::destroyBacking):
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.h:
(WebCore::CCPrioritizedTextureManager::create):
(CCPrioritizedTextureManager):
* platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp:
(WebCore::CCRenderPassDrawQuad::create):
(WebCore::CCRenderPassDrawQuad::CCRenderPassDrawQuad):
* platform/graphics/chromium/cc/CCRenderPassDrawQuad.h:
(CCRenderPassDrawQuad):
(WebCore::CCRenderPassDrawQuad::maskResourceId):
* platform/graphics/chromium/cc/CCRenderSurface.cpp:
(WebCore::CCRenderSurface::appendQuads):
* platform/graphics/chromium/cc/CCRenderer.h:
(WebCore):
(CCRenderer):
* platform/graphics/chromium/cc/CCResourceProvider.cpp: Added.
(WebCore):
(WebCore::textureToStorageFormat):
(WebCore::isTextureFormatSupportedForStorage):
(WebCore::CCResourceProvider::create):
(WebCore::CCResourceProvider::~CCResourceProvider):
(WebCore::CCResourceProvider::graphicsContext3D):
(WebCore::CCResourceProvider::inUseByConsumer):
(WebCore::CCResourceProvider::createResource):
(WebCore::CCResourceProvider::createResourceFromExternalTexture):
(WebCore::CCResourceProvider::deleteResource):
(WebCore::CCResourceProvider::deleteOwnedResources):
(WebCore::CCResourceProvider::upload):
(WebCore::CCResourceProvider::beginRenderTo):
(WebCore::CCResourceProvider::endRenderTo):
(WebCore::CCResourceProvider::beginRenderFrom):
(WebCore::CCResourceProvider::endRenderFrom):
(WebCore::CCResourceProvider::CCResourceProvider):
(WebCore::CCResourceProvider::initialize):
* platform/graphics/chromium/cc/CCResourceProvider.h: Added.
(WebKit):
(WebCore):
(CCResourceProvider):
(WebCore::CCResourceProvider::maxTextureSize):
(WebCore::CCResourceProvider::numResources):
(Resource):
* platform/graphics/chromium/cc/CCScopedTexture.cpp:
(WebCore::CCScopedTexture::CCScopedTexture):
(WebCore::CCScopedTexture::allocate):
(WebCore::CCScopedTexture::free):
* platform/graphics/chromium/cc/CCScopedTexture.h:
(WebCore::CCScopedTexture::create):
(CCScopedTexture):
(WebCore::CCScopedTexture::beginRenderTo):
(WebCore::CCScopedTexture::endRenderTo):
(WebCore::CCScopedTexture::beginRenderFrom):
(WebCore::CCScopedTexture::endRenderFrom):
* platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp:
(WebCore::CCScrollbarLayerImpl::CCScrollbarLayerImpl):
(WebCore):
(WebCore::CCScrollbarLayerImpl::appendQuads):
* platform/graphics/chromium/cc/CCScrollbarLayerImpl.h:
(WebCore::CCScrollbarLayerImpl::setBackTrackResourceId):
(WebCore::CCScrollbarLayerImpl::setForeTrackResourceId):
(WebCore::CCScrollbarLayerImpl::setThumbResourceId):
(CCScrollbarLayerImpl):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::recreateContext):
(WebCore::CCSingleThreadProxy::doCommit):
(WebCore::CCSingleThreadProxy::stop):
* platform/graphics/chromium/cc/CCTexture.h:
(WebCore::CCTexture::id):
(WebCore::CCTexture::setId):
(CCTexture):
* platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
(WebCore::CCTextureLayerImpl::CCTextureLayerImpl):
(WebCore::CCTextureLayerImpl::willDraw):
(WebCore):
(WebCore::CCTextureLayerImpl::appendQuads):
(WebCore::CCTextureLayerImpl::didDraw):
* platform/graphics/chromium/cc/CCTextureLayerImpl.h:
(CCTextureLayerImpl):
* platform/graphics/chromium/cc/CCTextureUpdater.cpp:
(WebCore::CCTextureUpdater::update):
* platform/graphics/chromium/cc/CCTextureUpdater.h:
(WebCore):
(CCTextureUpdater):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
(WebCore::CCThreadProxy::layerTreeHostClosedOnImplThread):
(WebCore::CCThreadProxy::recreateContextOnImplThread):
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
(WebCore::DrawableTile::resourceId):
(WebCore::DrawableTile::setResourceId):
(WebCore::DrawableTile::DrawableTile):
(DrawableTile):
(WebCore::CCTiledLayerImpl::contentsResourceId):
(WebCore::CCTiledLayerImpl::hasTextureIdForTileAt):
(WebCore::CCTiledLayerImpl::appendQuads):
(WebCore::CCTiledLayerImpl::pushTileProperties):
* platform/graphics/chromium/cc/CCTiledLayerImpl.h:
(CCTiledLayerImpl):
* platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
(WebCore::CCVideoLayerImpl::CCVideoLayerImpl):
(WebCore::CCVideoLayerImpl::~CCVideoLayerImpl):
(WebCore::CCVideoLayerImpl::willDraw):
(WebCore::CCVideoLayerImpl::willDrawInternal):
(WebCore::CCVideoLayerImpl::appendQuads):
(WebCore::CCVideoLayerImpl::didDraw):
(WebCore::CCVideoLayerImpl::FramePlane::allocateData):
(WebCore::CCVideoLayerImpl::FramePlane::freeData):
(WebCore::CCVideoLayerImpl::allocatePlaneData):
(WebCore::CCVideoLayerImpl::copyPlaneData):
(WebCore::CCVideoLayerImpl::freePlaneData):
(WebCore::CCVideoLayerImpl::freeUnusedPlaneData):
(WebCore::CCVideoLayerImpl::didLoseContext):
* platform/graphics/chromium/cc/CCVideoLayerImpl.h:
(CCVideoLayerImpl):
(FramePlane):
(WebCore::CCVideoLayerImpl::FramePlane::FramePlane):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/CCLayerTreeHostImplTest.cpp:
* tests/CCPrioritizedTextureTest.cpp:
(WTF::CCPrioritizedTextureTest::CCPrioritizedTextureTest):
(WTF::CCPrioritizedTextureTest::createManager):
(WTF::CCPrioritizedTextureTest::validateTexture):
(WTF::CCPrioritizedTextureTest::resourceProvider):
(CCPrioritizedTextureTest):
(WTF::TEST_F):
* tests/CCQuadCullerTest.cpp:
* tests/CCResourceProviderTest.cpp: Added.
(WebKit):
(ResourceProviderContext):
(WebKit::ResourceProviderContext::create):
(WebKit::ResourceProviderContext::bindTexture):
(WebKit::ResourceProviderContext::createTexture):
(WebKit::ResourceProviderContext::deleteTexture):
(WebKit::ResourceProviderContext::texStorage2DEXT):
(WebKit::ResourceProviderContext::texImage2D):
(WebKit::ResourceProviderContext::texSubImage2D):
(WebKit::ResourceProviderContext::getPixels):
(WebKit::ResourceProviderContext::textureCount):
(WebKit::ResourceProviderContext::textureSize):
(WebKit::ResourceProviderContext::ResourceProviderContext):
(WebKit::ResourceProviderContext::Texture::Texture):
(Texture):
(WebKit::ResourceProviderContext::allocateTexture):
(WebKit::ResourceProviderContext::setPixels):
(CCResourceProviderTest):
(WebKit::CCResourceProviderTest::CCResourceProviderTest):
(WebKit::CCResourceProviderTest::context):
(WebKit::CCResourceProviderTest::getResourcePixels):
(WebKit::TEST_F):
* tests/CCScopedTextureTest.cpp:
(WebKitTests::TEST):
* tests/CCTiledLayerImplTest.cpp:
(CCLayerTestCommon::createLayer):
(CCLayerTestCommon::TEST):
* tests/CCTiledLayerTestCommon.cpp:
(WebKitTests::FakeLayerTextureUpdater::Texture::updateRect):
* tests/CCTiledLayerTestCommon.h:
(Texture):
(WebKitTests::FakeTextureCopier::copyTexture):
(WebKitTests::FakeTextureCopier::flush):
(WebKitTests::FakeTextureUploader::uploadTexture):
* tests/ContentLayerChromiumTest.cpp:
(WebKit::TEST):
* tests/FakeCCGraphicsContext.h: Copied from Source/WebCore/platform/graphics/chromium/cc/CCTexture.h.
(WebKit):
(WebKit::createFakeCCGraphicsContext):
* tests/LayerRendererChromiumTest.cpp:
(FakeLayerRendererChromium::FakeLayerRendererChromium):
(LayerRendererChromiumTest::LayerRendererChromiumTest):
(LayerRendererChromiumTest::context):
(LayerRendererChromiumTest):
(TEST_F):
(TEST):
* tests/TextureCopierTest.cpp:
* tests/TextureManagerTest.cpp:
(WTF::TextureManagerTest::TextureManagerTest):
(WTF::TextureManagerTest::createTextureManager):
(WTF::TextureManagerTest::requestTexture):
(TextureManagerTest):
* tests/TiledLayerChromiumTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Form state restore: Classify form control sates by owners in internal and serialized representations
https://bugs.webkit.org/show_bug.cgi?id=91594

Reviewed by Hajime Morita.

Source/WebCore:

Before this change, the internal representation of form control states
was a map like:

    {name, type, formKey} -> [FormControlState, FormControlState, ...]

Also, the serialized representation was:

    [name, type, formKey, FormControlState,
     name, type, formKey, formControlState,
     ...]

This changes these represenations. The internal representation is

    A map owned by FormController:
        formKey -> SavedFormState
    SavedFormState owns a map like:
        {name, type} -> [FormControlState, FormControlState, ...]

The serialized representation is:

    [formKey, count,
     name, type, FormControlState,
     name, type, FormControlState,
     name, type, FormControlState,
     ....
     formKey, count,
     name, type, FormControlState,
     name, type, FormControlState,
     name, type, FormControlState,
     ....]

The serialized representation would be smaller in many cases because
each of items doesn't have formKey.

Tests: Covered by fast/forms/state-restore-broken-state.html,
state-restore-per-form.html, and state-restore-skip-stateless.html.

* html/FormController.cpp:
(FormElementKey): Remove formKey argument and m_formKey.
(WebCore::FormElementKey::FormElementKey):
(WebCore::FormElementKey::operator=):
(WebCore::FormElementKey::ref):
(WebCore::FormElementKey::deref):
(WebCore::operator==):

(SavedFormState):
 - The role of SavedFromState was changed. It represented all of control
  states. Now it represent control states owned by a signle form.
 - Make this non-copyable and fast-allocated.
 - Add m_controlStateCount, a counter of FormControlState
(WebCore::SavedFormState::SavedFormState):
 Initialize m_controlStateCount.
(WebCore::isNotFormControlTypeCharacter):
Moved from another place in this file.
(WebCore::SavedFormState::deserialize):
Added. Build a SavedFromState with the specified stateVector.
(WebCore::SavedFormState::serializeTo):
Added. m_controlStateCount is needed here.
(WebCore::SavedFormState::appendControlState):
 - Remove formKey arguement.
 - Update m_controlStateCount.
(WebCore::SavedFormState::takeControlState): ditto.

(WebCore::formStateSignature): Bump the version.
(WebCore::FormController::createSavedFormStateMap):
Added. Build a SavedFormStateMap from the form control list. This is a
helper for formElementsState, and classifies controls in the document.
(WebCore::FormController::formElementsState):
Build a SavedFormStateMap with createSavedFormStateMap(),
then serializes it.
(WebCore::FormController::setStateForNewFormElements):
Deserialize SavedFormState, and build SavedFormStateMap.
(WebCore::FormController::takeStateForFormElement):
Finds the corresponding SavedFormState with a formKey, and uses it.
* html/FormController.h:
Declare createSavedFormStateMap(), and moved typedefs for it.

LayoutTests:

Because the state serialization order depends on iteration order of
HashMap, serialized state array is not stable. We should remove raw dump
of serialized state array.

* fast/forms/state-restore-per-form.html: Remove the code to dump the
form state. It's useless because the test have enough assertions.
* fast/forms/state-restore-per-form-expected.txt:
* fast/forms/resources/state-restore-per-form-back.html: Removed.

* fast/forms/resources/state-restore-skip-stateless-dump.html:
Instead of dumping form state, check existence of types with JavaScript code.
* fast/forms/state-restore-skip-stateless-expected.txt:
* fast/forms/state-restore-skip-stateless.html: Fix a typo.

* fast/forms/state-restore-broken-state-expected.txt:
Update the expectation because of the serialization format change.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move contents right when a vertical scrollbar is shown at the left side of an RTL element.
https://bugs.webkit.org/show_bug.cgi?id=85856

Reviewed by Hajime Morita.

Source/WebCore:

This change prevents the scrollWidth value from being cropped by the width of a
scrollbar when a vertical scrollbar is shown at the left side of an RTL element.
This change also increases the clientLeft value by this scrollbar width and move
contents right to improve compliance with CSSOM <http://www.w3.org/TR/cssom-view>.

Tests: scrollbars/rtl/div-horizontal.html
       scrollbars/rtl/div-vertical.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject): Move contents to the right.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::topLeftLocationOffset): Move the top-left corner to the right to prevent WebKit from cropping scrollWidth.
* rendering/RenderBox.h:
(WebCore::RenderBox::clientLeft): Increase clientLeft by the width of a scrollbar.

LayoutTests:

This changes adds a couple of tests that verify CSSOM properties of RTL elements
are compliant with <http://www.w3.org/TR/cssom-view> regardless of their
scrollbar positions.

* platform/chromium/TestExpectations:
* scrollbars/rtl: Added.
* scrollbars/rtl/div-horizontal-expected.txt: Added.
* scrollbars/rtl/div-horizontal.html: Added.
* scrollbars/rtl/div-vertical-expected.txt: Added.
* scrollbars/rtl/div-vertical.html: Added.


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