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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp

Issue 2604073002: Apply offset from the correct graphics layer; simplify code for link highlights. (Closed)
Patch Set: none Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 for (LayoutMultiColumnSetList::const_iterator iter = 112 for (LayoutMultiColumnSetList::const_iterator iter =
113 m_multiColumnSetList.begin(); 113 m_multiColumnSetList.begin();
114 iter != m_multiColumnSetList.end(); ++iter) { 114 iter != m_multiColumnSetList.end(); ++iter) {
115 LayoutMultiColumnSet* columnSet = *iter; 115 LayoutMultiColumnSet* columnSet = *iter;
116 computedValues.m_extent += columnSet->logicalHeightInFlowThread(); 116 computedValues.m_extent += columnSet->logicalHeightInFlowThread();
117 } 117 }
118 } 118 }
119 119
120 void LayoutFlowThread::absoluteQuadsForDescendant(const LayoutBox& descendant, 120 void LayoutFlowThread::absoluteQuadsForDescendant(const LayoutBox& descendant,
121 Vector<FloatQuad>& quads) { 121 Vector<FloatQuad>& quads,
122 MapCoordinatesFlags mode) {
122 LayoutPoint offsetFromFlowThread; 123 LayoutPoint offsetFromFlowThread;
123 for (const LayoutObject* object = &descendant; object != this;) { 124 for (const LayoutObject* object = &descendant; object != this;) {
124 const LayoutObject* container = object->container(); 125 const LayoutObject* container = object->container();
125 offsetFromFlowThread += object->offsetFromContainer(container); 126 offsetFromFlowThread += object->offsetFromContainer(container);
126 object = container; 127 object = container;
127 } 128 }
128 LayoutRect boundingRectInFlowThread(offsetFromFlowThread, 129 LayoutRect boundingRectInFlowThread(offsetFromFlowThread,
129 descendant.frameRect().size()); 130 descendant.frameRect().size());
130 // Set up a fragments relative to the descendant, in the flow thread 131 // Set up a fragments relative to the descendant, in the flow thread
131 // coordinate space, and convert each of them, individually, to absolute 132 // coordinate space, and convert each of them, individually, to absolute
132 // coordinates. 133 // coordinates.
133 for (FragmentainerIterator iterator(*this, boundingRectInFlowThread); 134 for (FragmentainerIterator iterator(*this, boundingRectInFlowThread);
134 !iterator.atEnd(); iterator.advance()) { 135 !iterator.atEnd(); iterator.advance()) {
135 LayoutRect fragment = boundingRectInFlowThread; 136 LayoutRect fragment = boundingRectInFlowThread;
136 // We use inclusiveIntersect() because intersect() would reset the 137 // We use inclusiveIntersect() because intersect() would reset the
137 // coordinates for zero-height objects. 138 // coordinates for zero-height objects.
138 fragment.inclusiveIntersect(iterator.fragmentainerInFlowThread()); 139 fragment.inclusiveIntersect(iterator.fragmentainerInFlowThread());
139 fragment.moveBy(-offsetFromFlowThread); 140 fragment.moveBy(-offsetFromFlowThread);
140 quads.append(descendant.localToAbsoluteQuad(FloatRect(fragment))); 141 quads.append(descendant.localToAbsoluteQuad(FloatRect(fragment), mode));
141 } 142 }
142 } 143 }
143 144
144 bool LayoutFlowThread::nodeAtPoint(HitTestResult& result, 145 bool LayoutFlowThread::nodeAtPoint(HitTestResult& result,
145 const HitTestLocation& locationInContainer, 146 const HitTestLocation& locationInContainer,
146 const LayoutPoint& accumulatedOffset, 147 const LayoutPoint& accumulatedOffset,
147 HitTestAction hitTestAction) { 148 HitTestAction hitTestAction) {
148 if (hitTestAction == HitTestBlockBackground) 149 if (hitTestAction == HitTestBlockBackground)
149 return false; 150 return false;
150 return LayoutBlockFlow::nodeAtPoint(result, locationInContainer, 151 return LayoutBlockFlow::nodeAtPoint(result, locationInContainer,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 229
229 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded( 230 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(
230 const MultiColumnSetInterval& interval) { 231 const MultiColumnSetInterval& interval) {
231 if (m_result) 232 if (m_result)
232 return; 233 return;
233 if (interval.low() <= m_offset && interval.high() > m_offset) 234 if (interval.low() <= m_offset && interval.high() > m_offset)
234 m_result = interval.data(); 235 m_result = interval.data();
235 } 236 }
236 237
237 } // namespace blink 238 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFlowThread.h ('k') | third_party/WebKit/Source/core/layout/LayoutInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698