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

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

Issue 1658643002: LayoutBox cannot be non-atomic inline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | 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 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 if (LayoutMultiColumnSpannerPlaceholder* placeholder = this->spannerPlacehol der()) 266 if (LayoutMultiColumnSpannerPlaceholder* placeholder = this->spannerPlacehol der())
267 placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle); 267 placeholder->layoutObjectInFlowThreadStyleDidChange(oldStyle);
268 268
269 updateBackgroundAttachmentFixedStatusAfterStyleChange(); 269 updateBackgroundAttachmentFixedStatusAfterStyleChange();
270 270
271 if (oldStyle) { 271 if (oldStyle) {
272 LayoutFlowThread* flowThread = flowThreadContainingBlock(); 272 LayoutFlowThread* flowThread = flowThreadContainingBlock();
273 if (flowThread && flowThread != this) 273 if (flowThread && flowThread != this)
274 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle ); 274 flowThread->flowThreadDescendantStyleDidChange(this, diff, *oldStyle );
275 } 275 }
276
277 ASSERT(!isInline() || isAtomicInlineLevel()); // Non-atomic inlines should b e LayoutInline or LayoutText, not LayoutBox.
276 } 278 }
277 279
278 void LayoutBox::updateBackgroundAttachmentFixedStatusAfterStyleChange() 280 void LayoutBox::updateBackgroundAttachmentFixedStatusAfterStyleChange()
279 { 281 {
280 if (!frameView()) 282 if (!frameView())
281 return; 283 return;
282 284
283 // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays 285 // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
284 // when scrolling a page with a fixed background image. As an optimization, assuming there are 286 // when scrolling a page with a fixed background image. As an optimization, assuming there are
285 // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we 287 // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 } 1725 }
1724 1726
1725 LayoutSize LayoutBox::offsetFromContainer(const LayoutObject* o, const LayoutPoi nt& point, bool* offsetDependsOnPoint) const 1727 LayoutSize LayoutBox::offsetFromContainer(const LayoutObject* o, const LayoutPoi nt& point, bool* offsetDependsOnPoint) const
1726 { 1728 {
1727 ASSERT(o == container()); 1729 ASSERT(o == container());
1728 1730
1729 LayoutSize offset; 1731 LayoutSize offset;
1730 if (isInFlowPositioned()) 1732 if (isInFlowPositioned())
1731 offset += offsetForInFlowPosition(); 1733 offset += offsetForInFlowPosition();
1732 1734
1733 if (!isInline() || isAtomicInlineLevel()) { 1735 offset += topLeftLocationOffset();
1734 offset += topLeftLocationOffset(); 1736 if (o->isLayoutFlowThread()) {
1735 if (o->isLayoutFlowThread()) { 1737 // So far the point has been in flow thread coordinates (i.e. as if ever ything in
1736 // So far the point has been in flow thread coordinates (i.e. as if everything in 1738 // the fragmentation context lived in one tall single column). Convert i t to a
1737 // the fragmentation context lived in one tall single column). Conve rt it to a 1739 // visual point now.
1738 // visual point now. 1740 LayoutPoint pointInContainer = point + offset;
1739 LayoutPoint pointInContainer = point + offset; 1741 offset += o->columnOffset(pointInContainer);
1740 offset += o->columnOffset(pointInContainer); 1742 if (offsetDependsOnPoint)
1741 if (offsetDependsOnPoint) 1743 *offsetDependsOnPoint = true;
1742 *offsetDependsOnPoint = true;
1743 }
1744 } 1744 }
1745 1745
1746 if (o->hasOverflowClip()) 1746 if (o->hasOverflowClip())
1747 offset -= toLayoutBox(o)->scrolledContentOffset(); 1747 offset -= toLayoutBox(o)->scrolledContentOffset();
1748 1748
1749 if (style()->position() == AbsolutePosition && o->isInFlowPositioned() && o- >isLayoutInline()) 1749 if (style()->position() == AbsolutePosition && o->isInFlowPositioned() && o- >isLayoutInline())
1750 offset += toLayoutInline(o)->offsetForInFlowPositionedInline(*this); 1750 offset += toLayoutInline(o)->offsetForInFlowPositionedInline(*this);
1751 1751
1752 return offset; 1752 return offset;
1753 } 1753 }
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 setLogicalTop(computedValues.m_position); 2385 setLogicalTop(computedValues.m_position);
2386 setMarginBefore(computedValues.m_margins.m_before); 2386 setMarginBefore(computedValues.m_margins.m_before);
2387 setMarginAfter(computedValues.m_margins.m_after); 2387 setMarginAfter(computedValues.m_margins.m_after);
2388 } 2388 }
2389 2389
2390 void LayoutBox::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logica lTop, LogicalExtentComputedValues& computedValues) const 2390 void LayoutBox::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logica lTop, LogicalExtentComputedValues& computedValues) const
2391 { 2391 {
2392 computedValues.m_extent = logicalHeight; 2392 computedValues.m_extent = logicalHeight;
2393 computedValues.m_position = logicalTop; 2393 computedValues.m_position = logicalTop;
2394 2394
2395 // Cell height is managed by the table and non-atomic inline-level elements do not support a height property. 2395 // Cell height is managed by the table.
2396 if (isTableCell() || (isInline() && !isAtomicInlineLevel())) 2396 if (isTableCell())
2397 return; 2397 return;
2398 2398
2399 Length h; 2399 Length h;
2400 if (isOutOfFlowPositioned()) { 2400 if (isOutOfFlowPositioned()) {
2401 computePositionedLogicalHeight(computedValues); 2401 computePositionedLogicalHeight(computedValues);
2402 } else { 2402 } else {
2403 LayoutBlock* cb = containingBlock(); 2403 LayoutBlock* cb = containingBlock();
2404 2404
2405 // If we are perpendicular to our containing block then we need to resol ve our block-start and block-end margins so that if they 2405 // If we are perpendicular to our containing block then we need to resol ve our block-start and block-end margins so that if they
2406 // are 'auto' we are centred or aligned within the inline flow containin g block: this is done by computing the margins as though they are inline. 2406 // are 'auto' we are centred or aligned within the inline flow containin g block: this is done by computing the margins as though they are inline.
(...skipping 2236 matching lines...) Expand 10 before | Expand all | Expand 10 after
4643 4643
4644 void LayoutBox::clearPercentHeightDescendants() 4644 void LayoutBox::clearPercentHeightDescendants()
4645 { 4645 {
4646 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4646 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4647 if (curr->isBox()) 4647 if (curr->isBox())
4648 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4648 toLayoutBox(curr)->removeFromPercentHeightContainer();
4649 } 4649 }
4650 } 4650 }
4651 4651
4652 } // namespace blink 4652 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698