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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 1242
1243 drawLineForBoxSide(graphicsContext, leftOuter, topOuter, leftInner, bottomOu ter, BSLeft, outlineColor, outlineStyle, outlineWidth, outlineWidth); 1243 drawLineForBoxSide(graphicsContext, leftOuter, topOuter, leftInner, bottomOu ter, BSLeft, outlineColor, outlineStyle, outlineWidth, outlineWidth);
1244 drawLineForBoxSide(graphicsContext, leftOuter, topOuter, rightOuter, topInne r, BSTop, outlineColor, outlineStyle, outlineWidth, outlineWidth); 1244 drawLineForBoxSide(graphicsContext, leftOuter, topOuter, rightOuter, topInne r, BSTop, outlineColor, outlineStyle, outlineWidth, outlineWidth);
1245 drawLineForBoxSide(graphicsContext, rightInner, topOuter, rightOuter, bottom Outer, BSRight, outlineColor, outlineStyle, outlineWidth, outlineWidth); 1245 drawLineForBoxSide(graphicsContext, rightInner, topOuter, rightOuter, bottom Outer, BSRight, outlineColor, outlineStyle, outlineWidth, outlineWidth);
1246 drawLineForBoxSide(graphicsContext, leftOuter, bottomInner, rightOuter, bott omOuter, BSBottom, outlineColor, outlineStyle, outlineWidth, outlineWidth); 1246 drawLineForBoxSide(graphicsContext, leftOuter, bottomInner, rightOuter, bott omOuter, BSBottom, outlineColor, outlineStyle, outlineWidth, outlineWidth);
1247 1247
1248 if (useTransparencyLayer) 1248 if (useTransparencyLayer)
1249 graphicsContext->endLayer(); 1249 graphicsContext->endLayer();
1250 } 1250 }
1251 1251
1252 void RenderObject::addChildrenFocusRingRects(Vector<IntRect>& rects, const Layou tPoint& additionalOffset, const RenderLayerModelObject* paintContainer)
1253 {
1254 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.
1255 if (curr->isText() || curr->isListMarker())
1256 continue;
1257
1258 if (curr->isBox()) {
1259 RenderBox* box = toRenderBox(curr);
1260 if (box->hasLayer()) {
1261 Vector<IntRect> layerFocusRingRects;
1262 box->addFocusRingRects(layerFocusRingRects, LayoutPoint(), box);
1263 for (size_t i = 0; i < layerFocusRingRects.size(); ++i)
1264 rects.append(box->localToContainerQuad(FloatRect(layerFocusR ingRects[i]), paintContainer).enclosingBoundingBox());
1265 } else {
1266 FloatPoint pos(additionalOffset);
1267 pos.move(box->locationOffset()); // FIXME: Snap offsets? crbug.c om/350474
1268 box->addFocusRingRects(rects, flooredIntPoint(pos), paintContain er);
1269 }
1270 } else {
1271 curr->addFocusRingRects(rects, additionalOffset, paintContainer);
1272 }
1273 }
1274 }
1275
1252 // FIXME: In repaint-after-layout, we should be able to change the logic to remo ve the need for this function. See crbug.com/368416. 1276 // FIXME: In repaint-after-layout, we should be able to change the logic to remo ve the need for this function. See crbug.com/368416.
1253 LayoutPoint RenderObject::positionFromRepaintContainer(const RenderLayerModelObj ect* repaintContainer) const 1277 LayoutPoint RenderObject::positionFromRepaintContainer(const RenderLayerModelObj ect* repaintContainer) const
1254 { 1278 {
1255 // FIXME: This assert should be re-enabled when we move repaint to after com positing update. crbug.com/360286 1279 // FIXME: This assert should be re-enabled when we move repaint to after com positing update. crbug.com/360286
1256 // ASSERT(containerForRepaint() == repaintContainer); 1280 // ASSERT(containerForRepaint() == repaintContainer);
1257 1281
1258 LayoutPoint offset = isBox() ? toRenderBox(this)->location() : LayoutPoint() ; 1282 LayoutPoint offset = isBox() ? toRenderBox(this)->location() : LayoutPoint() ;
1259 if (repaintContainer == this) 1283 if (repaintContainer == this)
1260 return offset; 1284 return offset;
1261 1285
(...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after
3461 { 3485 {
3462 if (object1) { 3486 if (object1) {
3463 const WebCore::RenderObject* root = object1; 3487 const WebCore::RenderObject* root = object1;
3464 while (root->parent()) 3488 while (root->parent())
3465 root = root->parent(); 3489 root = root->parent();
3466 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3490 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3467 } 3491 }
3468 } 3492 }
3469 3493
3470 #endif 3494 #endif
OLDNEW
« 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