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

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

Issue 1280543005: Refactor LayoutInline::addOutlineRects to avoid tricky logic to avoid dups (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after
2590 rects.append(rect); 2590 rects.append(rect);
2591 } 2591 }
2592 2592
2593 addOutlineRectsForNormalChildren(rects, additionalOffset); 2593 addOutlineRectsForNormalChildren(rects, additionalOffset);
2594 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObj ects()) { 2594 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObj ects()) {
2595 for (auto* box : *positionedObjects) 2595 for (auto* box : *positionedObjects)
2596 addOutlineRectsForDescendant(*box, rects, additionalOffset); 2596 addOutlineRectsForDescendant(*box, rects, additionalOffset);
2597 } 2597 }
2598 } 2598 }
2599 2599
2600 if (inlineElementContinuation) { 2600 if (inlineElementContinuation)
chrishtr 2015/08/07 23:35:31 Can this code just be deleted, and then the specia
Xianzhu 2015/08/07 23:56:23 They are for different cases. You can treat the ad
chrishtr 2015/08/08 02:42:00 Then I don't understand where the potential duplic
2601 Vector<LayoutRect> inlineOutlineRects; 2601 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in lineElementContinuation->containingBlock()->location() - location()));
2602 // We need to give the LayoutInline a clean vector to let it add focus r ing rects of line boxes.
2603 inlineElementContinuation->addOutlineRects(inlineOutlineRects, additiona lOffset + (inlineElementContinuation->containingBlock()->location() - location() ));
2604 rects.appendVector(inlineOutlineRects);
2605 }
2606 } 2602 }
2607 2603
2608 void LayoutBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const 2604 void LayoutBlock::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layou tPoint& layerOffset) const
2609 { 2605 {
2610 LayoutBox::computeSelfHitTestRects(rects, layerOffset); 2606 LayoutBox::computeSelfHitTestRects(rects, layerOffset);
2611 2607
2612 if (hasHorizontalLayoutOverflow() || hasVerticalLayoutOverflow()) { 2608 if (hasHorizontalLayoutOverflow() || hasVerticalLayoutOverflow()) {
2613 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) { 2609 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBo x()) {
2614 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); 2610 LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top());
2615 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t op() + curr->height()); 2611 LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->t op() + curr->height());
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2925 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2921 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2926 { 2922 {
2927 showLayoutObject(); 2923 showLayoutObject();
2928 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2924 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2929 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2925 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2930 } 2926 }
2931 2927
2932 #endif 2928 #endif
2933 2929
2934 } // namespace blink 2930 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutBoxModelObject.cpp » ('j') | Source/core/layout/LayoutBoxModelObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698