Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. 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 copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 // If we have no lines then we have no work to do. | 207 // If we have no lines then we have no work to do. |
| 208 if (!firstLineBox()) | 208 if (!firstLineBox()) |
| 209 return; | 209 return; |
| 210 | 210 |
| 211 LayoutUnit outlineSize = renderer->maximalOutlineSize(paintInfo.phase); | 211 LayoutUnit outlineSize = renderer->maximalOutlineSize(paintInfo.phase); |
| 212 if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset, outlineSiz e)) | 212 if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset, outlineSiz e)) |
| 213 return; | 213 return; |
| 214 | 214 |
| 215 PaintInfo info(paintInfo); | 215 PaintInfo info(paintInfo); |
| 216 ListHashSet<RenderInline*> outlineObjects; | 216 ListHashSet<RenderInline*> outlineObjects; |
| 217 info.outlineObjects = &outlineObjects; | 217 info.setOutlineObjects(&outlineObjects); |
| 218 | 218 |
| 219 // See if our root lines intersect with the dirty rect. If so, then we pain t | 219 // See if our root lines intersect with the dirty rect. If so, then we pain t |
| 220 // them. Note that boxes can easily overlap, so we can't make any assumptio ns | 220 // them. Note that boxes can easily overlap, so we can't make any assumptio ns |
| 221 // based off positions of our first line box or our last line box. | 221 // based off positions of our first line box or our last line box. |
| 222 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { | 222 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { |
| 223 if (lineIntersectsDirtyRect(renderer, curr, info, paintOffset)) { | 223 if (lineIntersectsDirtyRect(renderer, curr, info, paintOffset)) { |
| 224 RootInlineBox* root = curr->root(); | 224 RootInlineBox* root = curr->root(); |
| 225 curr->paint(info, paintOffset, root->lineTop(), root->lineBottom()); | 225 curr->paint(info, paintOffset, root->lineTop(), root->lineBottom()); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline | | info.phase == PaintPhaseChildOutlines) { | 229 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline | | info.phase == PaintPhaseChildOutlines) { |
| 230 ListHashSet<RenderInline*>::iterator end = info.outlineObjects->end(); | 230 ListHashSet<RenderInline*>::iterator end = info.outlineObjects()->end(); |
| 231 for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects->begi n(); it != end; ++it) { | 231 for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects()->be gin(); it != end; ++it) { |
| 232 RenderInline* flow = *it; | 232 RenderInline* flow = *it; |
| 233 flow->paintOutline(info, paintOffset); | 233 flow->paintOutline(info, paintOffset); |
| 234 } | 234 } |
| 235 info.outlineObjects->clear(); | 235 info.outlineObjects()->clear(); |
|
eseidel
2013/08/15 19:36:40
We're just mutating this member directly, which me
| |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq uest& request, HitTestResult& result, const HitTestLocation& locationInContainer , const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) const | 239 bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq uest& request, HitTestResult& result, const HitTestLocation& locationInContainer , const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) const |
| 240 { | 240 { |
| 241 if (hitTestAction != HitTestForeground) | 241 if (hitTestAction != HitTestForeground) |
| 242 return false; | 242 return false; |
| 243 | 243 |
| 244 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could hit test like this is if it has a layer. | 244 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could hit test like this is if it has a layer. |
| 245 | 245 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 ASSERT(child->prevLineBox() == prev); | 370 ASSERT(child->prevLineBox() == prev); |
| 371 prev = child; | 371 prev = child; |
| 372 } | 372 } |
| 373 ASSERT(prev == m_lastLineBox); | 373 ASSERT(prev == m_lastLineBox); |
| 374 #endif | 374 #endif |
| 375 } | 375 } |
| 376 | 376 |
| 377 #endif | 377 #endif |
| 378 | 378 |
| 379 } | 379 } |
| OLD | NEW |