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

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: Exclude the new flaky test. The other new test covers the change. Created 6 years, 6 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 4527 matching lines...) Expand 10 before | Expand all | Expand 10 after
4538 4538
4539 if (!hasOverflowClip() && !hasControlClip()) { 4539 if (!hasOverflowClip() && !hasControlClip()) {
4540 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) { 4540 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) {
4541 LayoutUnit top = max<LayoutUnit>(curr->lineTop(), curr->top()); 4541 LayoutUnit top = max<LayoutUnit>(curr->lineTop(), curr->top());
4542 LayoutUnit bottom = min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height()); 4542 LayoutUnit bottom = min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height());
4543 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y () + top, curr->width(), bottom - top); 4543 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y () + top, curr->width(), bottom - top);
4544 if (!rect.isEmpty()) 4544 if (!rect.isEmpty())
4545 rects.append(pixelSnappedIntRect(rect)); 4545 rects.append(pixelSnappedIntRect(rect));
4546 } 4546 }
4547 4547
4548 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling() ) { 4548 addChildFocusRingRects(rects, additionalOffset, paintContainer);
4549 if (!curr->isText() && !curr->isListMarker() && curr->isBox()) {
4550 RenderBox* box = toRenderBox(curr);
4551 FloatPoint pos;
4552 // FIXME: This doesn't work correctly with transforms.
4553 if (box->layer())
4554 pos = curr->localToContainerPoint(FloatPoint(), paintContain er);
4555 else
4556 pos = FloatPoint((additionalOffset.x() + box->x()).toFloat() , (additionalOffset.y() + box->y()).toFloat()); // FIXME: Snap offsets? crbug.co m/350474
4557 box->addFocusRingRects(rects, flooredLayoutPoint(pos), paintCont ainer);
4558 }
4559 }
4560 } 4549 }
4561 4550
4562 if (inlineElementContinuation()) 4551 if (inlineElementContinuation())
4563 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint (additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()), paintContainer); 4552 inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint (additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()), paintContainer);
4564 } 4553 }
4565 4554
4566 void RenderBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const 4555 void RenderBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const
4567 { 4556 {
4568 RenderBox::computeSelfHitTestRects(rects, layerOffset); 4557 RenderBox::computeSelfHitTestRects(rects, layerOffset);
4569 4558
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
5028 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5017 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5029 { 5018 {
5030 showRenderObject(); 5019 showRenderObject();
5031 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5020 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5032 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5021 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5033 } 5022 }
5034 5023
5035 #endif 5024 #endif
5036 5025
5037 } // namespace WebCore 5026 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/transforms/transform-focus-ring-expected.html ('k') | Source/core/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698