Direct pattern compositing breaks when no-repeat is set on a large layer
https://bugs.webkit.org/show_bug.cgi?id=116140

Source/WebCore:

Reviewed by Antti Koivisto.

In some cases the directly composited background color logic overrides the layer's
contentsRect, which results in wrong rendering of tiled images.
This patch makes sure that the background image is applied after the solid color,
which ensures the correct contentsRect.

Test: compositing/patterns/direct-pattern-compositing-contain-no-repeat.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDirectlyCompositedContents):

LayoutTests:

Added a ref-test to make sure that direct pattern compositing works well with no-repeat
in a particular geometry.

Reviewed by Antti Koivisto.

* compositing/patterns/direct-pattern-compositing-contain-no-repeat-expected.html: Added.
* compositing/patterns/direct-pattern-compositing-contain-no-repeat.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Begin moving "focus" state logic from Node to Element.
<http://webkit.org/b/116760>

Reviewed by Antti Koivisto.

Only Elements can be focused, so merge the "focus" state logic from Node and ContainerNode
and move it into Element. There's a lot more iceberg under this tip, but we'll be starting
with setFocus(bool) and focused().

* dom/Node.h:
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Element.cpp:
(WebCore::Element::isUserActionElementFocused):
(WebCore::Element::setFocus):
* dom/Element.h:
(WebCore::Element::focused):
* dom/Node.cpp:

    Move focused() and setFocus(bool) from Node/ContainerNode to Element.

* dom/Document.cpp:
(WebCore::Document::setFocusedNode):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent):

    Check if the inspected Node is an Element before asking if it's focused.

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