Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1474)

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 288013005: Handle transformed descendants when drawing focus rings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix inline-block under inline Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 531ee887d3e6d09775cbec1963fb2da91f5082fd..e79ac4c11f682a22094ba25b2d45461691edee9a 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1249,6 +1249,30 @@ void RenderObject::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRec
graphicsContext->endLayer();
}
+void RenderObject::addChildrenFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer)
+{
+ for (RenderObject* curr = slowFirstChild(); curr; curr = curr->nextSibling()) {
esprehn 2014/05/29 21:37:06 current, don't abbreviate.
Xianzhu 2014/05/29 22:12:31 Done.
+ if (curr->isText() || curr->isListMarker())
+ continue;
+
+ if (curr->isBox()) {
+ RenderBox* box = toRenderBox(curr);
+ if (box->hasLayer()) {
+ Vector<IntRect> layerFocusRingRects;
+ box->addFocusRingRects(layerFocusRingRects, LayoutPoint(), box);
+ for (size_t i = 0; i < layerFocusRingRects.size(); ++i)
+ rects.append(box->localToContainerQuad(FloatRect(layerFocusRingRects[i]), paintContainer).enclosingBoundingBox());
+ } else {
+ FloatPoint pos(additionalOffset);
+ pos.move(box->locationOffset()); // FIXME: Snap offsets? crbug.com/350474
+ box->addFocusRingRects(rects, flooredIntPoint(pos), paintContainer);
+ }
+ } else {
+ curr->addFocusRingRects(rects, additionalOffset, paintContainer);
+ }
+ }
+}
+
// FIXME: In repaint-after-layout, we should be able to change the logic to remove the need for this function. See crbug.com/368416.
LayoutPoint RenderObject::positionFromRepaintContainer(const RenderLayerModelObject* repaintContainer) const
{
« Source/core/rendering/RenderObject.h ('K') | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698