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

Side by Side Diff: Source/core/layout/LayoutBlock.cpp

Issue 1083403005: Don't add duplicated line box rects into focus ring rects (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase again Created 5 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 3529 matching lines...) Expand 10 before | Expand all | Expand 10 after
3540 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); 3540 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top());
3541 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t op() + curr->height()); 3541 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t op() + curr->height());
3542 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y () + top, curr->width(), bottom - top); 3542 LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y () + top, curr->width(), bottom - top);
3543 if (!rect.isEmpty()) 3543 if (!rect.isEmpty())
3544 rects.append(rect); 3544 rects.append(rect);
3545 } 3545 }
3546 3546
3547 addChildFocusRingRects(rects, additionalOffset); 3547 addChildFocusRingRects(rects, additionalOffset);
3548 } 3548 }
3549 3549
3550 if (inlineElementContinuation) 3550 if (inlineElementContinuation) {
3551 inlineElementContinuation->addFocusRingRects(rects, additionalOffset + ( inlineElementContinuation->containingBlock()->location() - location())); 3551 Vector<LayoutRect> inlineFocusRingRects;
3552 // We need to give the LayoutInline a clean vector to let it add focus r ing rects of line boxes.
3553 inlineElementContinuation->addFocusRingRects(inlineFocusRingRects, addit ionalOffset + (inlineElementContinuation->containingBlock()->location() - locati on()));
3554 rects.appendVector(inlineFocusRingRects);
3555 }
3552 } 3556 }
3553 3557
3554 void LayoutBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const 3558 void LayoutBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const
3555 { 3559 {
3556 LayoutBox::computeSelfHitTestRects(rects, layerOffset); 3560 LayoutBox::computeSelfHitTestRects(rects, layerOffset);
3557 3561
3558 if (hasHorizontalLayoutOverflow() || hasVerticalLayoutOverflow()) { 3562 if (hasHorizontalLayoutOverflow() || hasVerticalLayoutOverflow()) {
3559 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) { 3563 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) {
3560 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); 3564 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top());
3561 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t op() + curr->height()); 3565 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t op() + curr->height());
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
3911 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 3915 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
3912 { 3916 {
3913 showLayoutObject(); 3917 showLayoutObject();
3914 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 3918 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
3915 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 3919 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
3916 } 3920 }
3917 3921
3918 #endif 3922 #endif
3919 3923
3920 } // namespace blink 3924 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/focus-ring-recursive-inlines-expected.txt ('k') | Source/core/layout/LayoutInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698