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

Side by Side Diff: Source/core/layout/LayoutInline.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, 8 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
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 { 1393 {
1394 if (!rect.isEmpty()) 1394 if (!rect.isEmpty())
1395 AbsoluteLayoutRectsGeneratorContext::operator()(rect); 1395 AbsoluteLayoutRectsGeneratorContext::operator()(rect);
1396 } 1396 }
1397 }; 1397 };
1398 1398
1399 } // unnamed namespace 1399 } // unnamed namespace
1400 1400
1401 void LayoutInline::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoin t& additionalOffset) const 1401 void LayoutInline::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoin t& additionalOffset) const
1402 { 1402 {
1403 AbsoluteLayoutRectsIgnoringEmptyRectsGeneratorContext context(rects, additio nalOffset); 1403 // Add line boxes only if this object is the first object of addFocusRingRec ts().
1404 generateLineBoxRects(context); 1404 // Otherwise the parent (LayoutBlockFlow or LayoutInline) should have added line box rects
1405 // covering those of this object.
1406 if (rects.isEmpty()) {
1407 AbsoluteLayoutRectsIgnoringEmptyRectsGeneratorContext context(rects, add itionalOffset);
1408 generateLineBoxRects(context);
1409 }
1405 1410
1406 addChildFocusRingRects(rects, additionalOffset); 1411 addChildFocusRingRects(rects, additionalOffset);
1407 1412
1408 if (continuation()) { 1413 if (LayoutBoxModelObject* continuation = this->continuation()) {
1409 if (continuation()->isInline()) 1414 if (continuation->isInline())
1410 continuation()->addFocusRingRects(rects, additionalOffset + (continu ation()->containingBlock()->location() - containingBlock()->location())); 1415 continuation->addFocusRingRects(rects, additionalOffset + (continuat ion->containingBlock()->location() - containingBlock()->location()));
1411 else 1416 else
1412 continuation()->addFocusRingRects(rects, additionalOffset + (toLayou tBox(continuation())->location() - containingBlock()->location())); 1417 continuation->addFocusRingRects(rects, additionalOffset + (toLayoutB ox(continuation)->location() - containingBlock()->location()));
1413 } 1418 }
1414 } 1419 }
1415 1420
1416 void LayoutInline::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layo utPoint& layerOffset) const 1421 void LayoutInline::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layo utPoint& layerOffset) const
1417 { 1422 {
1418 AbsoluteLayoutRectsGeneratorContext context(rects, layerOffset); 1423 AbsoluteLayoutRectsGeneratorContext context(rects, layerOffset);
1419 generateLineBoxRects(context); 1424 generateLineBoxRects(context);
1420 } 1425 }
1421 1426
1422 void LayoutInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) 1427 void LayoutInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
(...skipping 21 matching lines...) Expand all
1444 } 1449 }
1445 1450
1446 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const 1451 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const
1447 { 1452 {
1448 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r); 1453 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r);
1449 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1454 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1450 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); 1455 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box);
1451 } 1456 }
1452 1457
1453 } // namespace blink 1458 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlock.cpp ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698