[chromium] Root invalidations for RTL pages need to be in the right space
https://bugs.webkit.org/show_bug.cgi?id=91155

Reviewed by Kenneth Russell.

Source/WebKit/chromium:

The root layer has a translation on it when placed in the tree, so any
invalidations on this layer likewise need to be adjusted.

This adjustment is due to the fact that compositor layers all have the
origin in the upper left corner of the layer, but this is not always
the origin for graphics layers. Rather than making compositor layers
have to deal with a potential offset, we change the transform when
inserting the layer into the tree. Invalidations need to be similarly
transformed from document space into compositor layer space.

The need for this offset is due to the definition of the initial
containing block. RTL pages (pages with dir=RTL on the body) start
scrolled all the way to the right, and the origin is in the upper left
hand corner of this initial viewport. Thus on RTL pages with
horizontal overflow, the left of the document is in negative CSS
space.

* src/NonCompositedContentHost.cpp:
(WebKit::NonCompositedContentHost::invalidateRect):

LayoutTests:

Add a test that demonstrates this problem. Before the code fix, the
test shows just a red square because the invalidation for the style
change repaints the wrong rect.

* compositing/rtl/rtl-overflow-invalidation-expected.png: Added.
* compositing/rtl/rtl-overflow-invalidation-expected.txt: Added.
* compositing/rtl/rtl-overflow-invalidation.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122529 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Needs callback before AuthorShadowRoot is added.
https://bugs.webkit.org/show_bug.cgi?id=91167

Reviewed by Hajime Morita.

This is a preliminary patch for adding multiple Shadow DOM support for media elements and form elements.
They assume that UserAgentShadowRoot is the oldest, however currently a page author may try to add
AuthorShadowRoot before adding UserAgentShadowRoot.

This patch adds a callback before AuthorShadowRoot is being added, and allow us to add UserAgentShadowRoot
for those elements. See also Bug 77936, Bug 77937, Bug 90532.

* dom/Element.h:
(WebCore::Element::willAddAuthorShadowRoot):
* dom/ElementShadow.cpp:
(WebCore::ElementShadow::addShadowRoot):
* dom/ElementShadow.h:
(ElementShadow):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::create):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move m_type and m_hasNameCache from HTMLCollectionCacheBase to DynamicNodeListCacheBase for better bit packing
https://bugs.webkit.org/show_bug.cgi?id=91164

Reviewed by Anders Carlsson.

Moved m_type and m_hasNameCache from HTMLCollection and renamed them to m_collectionType and m_isNameCacheValid.

Also renamed shouldIncludeChildren to shouldOnlyIncludeDirectChildren and negated the return value since
all HTMLCollection include children in the collection and the function was meant to tell us whether the collection
should include descendents that are not direct children of base().

In addition, renamed nextNodeOrSibling to nextNode since "or sibling" doesn't seem to add any semantic clarity.

* dom/DynamicNodeList.h:
(WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase):
(DynamicNodeListCacheBase):
(WebCore::DynamicNodeListCacheBase::type):
(WebCore::DynamicNodeListCacheBase::hasNameCache):
(WebCore::DynamicNodeListCacheBase::setHasNameCache):
(WebCore::DynamicNodeListCacheBase::clearCache):
* html/HTMLCollection.cpp:
(WebCore::shouldOnlyIncludeDirectChildren):
(WebCore::HTMLCollection::HTMLCollection):
(WebCore::HTMLCollection::isAcceptableElement):
(WebCore::nextNode):
(WebCore::HTMLCollection::itemAfter):
* html/HTMLCollection.h:
(WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase):
(HTMLCollectionCacheBase):
(WebCore::HTMLCollectionCacheBase::clearCache):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Geolocation override
https://bugs.webkit.org/show_bug.cgi?id=89365

Source/WebCore:

Reviewed by Pavel Feldman.

Reverted original patch.
Change has not been reviewed by the right people. It declares
public protocol methods and is wrong in several ways.

* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::GeolocationController):
(WebCore::GeolocationController::positionChanged):
* Modules/geolocation/GeolocationController.h:
(GeolocationController):
* inspector/Inspector.json:
* inspector/InspectorInstrumentation.cpp:
(WebCore):
* inspector/InspectorInstrumentation.h:
(WebCore):
(InspectorInstrumentation):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::InspectorPageAgent):
* inspector/InspectorPageAgent.h:
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.UserAgentSettingsTab):
(WebInspector.UserAgentSettingsTab.prototype._createDeviceMetricsElement):
* inspector/front-end/UserAgentSupport.js:

LayoutTests:

Reviewed by Pavel Feldman.
Change has not been reviewed by the right people. It declares
public protocol methods and is wrong in several ways.

Reverted original patch.

* inspector/geolocation-error-expected.txt: Removed.
* inspector/geolocation-error.html: Removed.
* inspector/geolocation-success-expected.txt: Removed.
* inspector/geolocation-success.html: Removed.


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