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

Side by Side Diff: Source/core/rendering/RenderBlock.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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 4491 matching lines...) Expand 10 before | Expand all | Expand 10 after
4502 4502
4503 if (!hasOverflowClip() && !hasControlClip()) { 4503 if (!hasOverflowClip() && !hasControlClip()) {
4504 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) { 4504 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) {
4505 LayoutUnit top = max<LayoutUnit>(curr->lineTop(), curr->top()); 4505 LayoutUnit top = max<LayoutUnit>(curr->lineTop(), curr->top());
4506 LayoutUnit bottom = min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height()); 4506 LayoutUnit bottom = min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height());
4507 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y () + top, curr->width(), bottom - top); 4507 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y () + top, curr->width(), bottom - top);
4508 if (!rect.isEmpty()) 4508 if (!rect.isEmpty())
4509 rects.append(pixelSnappedIntRect(rect)); 4509 rects.append(pixelSnappedIntRect(rect));
4510 } 4510 }
4511 4511
4512 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling() ) { 4512 addChildrenFocusRingRects(rects, additionalOffset, paintContainer);
4513 if (!curr->isText() && !curr->isListMarker() && curr->isBox()) {
4514 RenderBox* box = toRenderBox(curr);
4515 FloatPoint pos;
4516 // FIXME: This doesn't work correctly with transforms.
4517 if (box->layer())
4518 pos = curr->localToContainerPoint(FloatPoint(), paintContain er);
4519 else
4520 pos = FloatPoint((additionalOffset.x() + box->x()).toFloat() , (additionalOffset.y() + box->y()).toFloat()); // FIXME: Snap offsets? crbug.co m/350474
4521 box->addFocusRingRects(rects, flooredLayoutPoint(pos), paintCont ainer);
4522 }
4523 }
4524 } 4513 }
4525 4514
4526 if (inlineElementContinuation()) 4515 if (inlineElementContinuation())
4527 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint (additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()), paintContainer); 4516 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint (additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()), paintContainer);
4528 } 4517 }
4529 4518
4530 void RenderBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const 4519 void RenderBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const
4531 { 4520 {
4532 RenderBox::computeSelfHitTestRects(rects, layerOffset); 4521 RenderBox::computeSelfHitTestRects(rects, layerOffset);
4533 4522
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
4992 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 4981 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
4993 { 4982 {
4994 showRenderObject(); 4983 showRenderObject();
4995 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 4984 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
4996 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 4985 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
4997 } 4986 }
4998 4987
4999 #endif 4988 #endif
5000 4989
5001 } // namespace WebCore 4990 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698