Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 Vector<ImageResource*> images; | 358 Vector<ImageResource*> images; |
| 359 appendImagesFromStyle(images, *newStyle); | 359 appendImagesFromStyle(images, *newStyle); |
| 360 if (images.isEmpty()) | 360 if (images.isEmpty()) |
| 361 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this); | 361 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRe nderObject(this); |
| 362 else | 362 else |
| 363 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this); | 363 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->addRende rObject(this); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintCo ntainer) | 366 void RenderBlock::repaintTreeAfterLayout(const RenderLayerModelObject& repaintCo ntainer) |
| 367 { | 367 { |
| 368 if (!shouldCheckForInvalidationAfterLayout()) | 368 // Note, we don't want to early out here using shouldCheckForInvalidationAft erLayout as |
| 369 return; | 369 // we have to make sure we go through any positioned objects as they won't b e seen in |
| 370 // the normal tree walk. | |
| 370 | 371 |
| 371 RenderBox::repaintTreeAfterLayout(repaintContainer); | 372 if (shouldCheckForInvalidationAfterLayout()) |
| 373 RenderBox::repaintTreeAfterLayout(repaintContainer); | |
| 372 | 374 |
| 373 // Take care of positioned objects. This is required as LayoutState keeps a single clip rect. | 375 // Take care of positioned objects. This is required as LayoutState keeps a single clip rect. |
| 374 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) { | 376 if (TrackedRendererListHashSet* positionedObjects = this->positionedObjects( )) { |
| 375 TrackedRendererListHashSet::iterator end = positionedObjects->end(); | 377 TrackedRendererListHashSet::iterator end = positionedObjects->end(); |
| 376 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset()); | 378 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset()); |
| 379 | |
| 380 bool isFloatingOrRelPositioned = isFloating() || isRelPositioned(); | |
|
leviw_travelin_and_unemployed
2014/05/27 17:27:57
Can this not be an issue with absPos as well? Can
| |
| 377 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) { | 381 for (TrackedRendererListHashSet::iterator it = positionedObjects->begin( ); it != end; ++it) { |
| 378 RenderBox* box = *it; | 382 RenderBox* box = *it; |
| 379 | 383 |
| 380 // One of the renderers we're skipping over here may be the child's repaint container, | 384 // One of the renderers we're skipping over here may be the child's repaint container, |
| 381 // so we can't pass our own repaint container along. | 385 // so we can't pass our own repaint container along. |
| 382 const RenderLayerModelObject& repaintContainerForChild = *box->conta inerForRepaint(); | 386 const RenderLayerModelObject& repaintContainerForChild = *box->conta inerForRepaint(); |
| 383 | 387 |
| 388 // When a floating object is moved the children do not get layout bu t they get a new position. | |
| 389 // We have to make sure we invalidate the children if a floating par ent container moves. | |
| 390 if (isFloatingOrRelPositioned) { | |
| 391 if (box->previousPositionFromRepaintContainer() != box->position FromRepaintContainer(&repaintContainerForChild)) { | |
| 392 // Note, this has to be non-recursive. If we walk up the tre e we'll end up setting | |
| 393 // the flag on our parent who has already cleared their flag s for this invalidation | |
| 394 // walk. We also don't have to force them to walk as we're a lready there. | |
| 395 box->setSelfMayNeedInvalidation(true); | |
| 396 } | |
| 397 } | |
| 398 | |
| 384 // If the positioned renderer is absolutely positioned and it is ins ide | 399 // If the positioned renderer is absolutely positioned and it is ins ide |
| 385 // a relatively positioend inline element, we need to account for | 400 // a relatively positioend inline element, we need to account for |
| 386 // the inline elements position in LayoutState. | 401 // the inline elements position in LayoutState. |
| 387 if (box->style()->position() == AbsolutePosition) { | 402 if (box->style()->position() == AbsolutePosition) { |
| 388 RenderObject* container = box->container(&repaintContainerForChi ld, 0); | 403 RenderObject* container = box->container(&repaintContainerForChi ld, 0); |
| 389 if (container->isInFlowPositioned() && container->isRenderInline ()) { | 404 if (container->isInFlowPositioned() && container->isRenderInline ()) { |
| 390 // FIXME: We should be able to use layout-state for this. | 405 // FIXME: We should be able to use layout-state for this. |
| 391 // Currently, we will place absolutly positioned elements in side | 406 // Currently, we will place absolutly positioned elements in side |
| 392 // relatively positioned inline blocks in the wrong location . crbug.com/371485 | 407 // relatively positioned inline blocks in the wrong location . crbug.com/371485 |
| 393 LayoutStateDisabler disable(*this); | 408 LayoutStateDisabler disable(*this); |
| (...skipping 4623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5017 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const | 5032 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const |
| 5018 { | 5033 { |
| 5019 showRenderObject(); | 5034 showRenderObject(); |
| 5020 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) | 5035 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) |
| 5021 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); | 5036 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); |
| 5022 } | 5037 } |
| 5023 | 5038 |
| 5024 #endif | 5039 #endif |
| 5025 | 5040 |
| 5026 } // namespace WebCore | 5041 } // namespace WebCore |
| OLD | NEW |