mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove more float machinery.
Also removed the clear property since it's only purpose was to clear floats. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/700703002
This commit is contained in:
parent
00a2de6490
commit
29ff7e21fd
@ -111,14 +111,12 @@ static const CSSPropertyID staticComputableProperties[] = {
|
||||
CSSPropertyBoxShadow,
|
||||
CSSPropertyBoxSizing,
|
||||
CSSPropertyCaptionSide,
|
||||
CSSPropertyClear,
|
||||
CSSPropertyClip,
|
||||
CSSPropertyColor,
|
||||
CSSPropertyCursor,
|
||||
CSSPropertyDirection,
|
||||
CSSPropertyDisplay,
|
||||
CSSPropertyEmptyCells,
|
||||
CSSPropertyFloat,
|
||||
CSSPropertyFontFamily,
|
||||
CSSPropertyFontKerning,
|
||||
CSSPropertyFontSize,
|
||||
@ -1502,8 +1500,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
|
||||
return valueForShadowList(style->boxShadow(), *style, true);
|
||||
case CSSPropertyCaptionSide:
|
||||
return cssValuePool().createValue(style->captionSide());
|
||||
case CSSPropertyClear:
|
||||
return cssValuePool().createValue(style->clear());
|
||||
case CSSPropertyColor:
|
||||
return cssValuePool().createColorValue(m_allowVisitedStyle ? style->colorIncludingFallback(CSSPropertyColor).rgb() : style->color().rgb());
|
||||
case CSSPropertyWebkitPrintColorAdjust:
|
||||
@ -1556,10 +1552,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
|
||||
return cssValuePool().createValue(style->justifyContent());
|
||||
case CSSPropertyOrder:
|
||||
return cssValuePool().createValue(style->order(), CSSPrimitiveValue::CSS_NUMBER);
|
||||
case CSSPropertyFloat:
|
||||
if (style->display() != NONE && style->hasOutOfFlowPosition())
|
||||
return cssValuePool().createIdentifierValue(CSSValueNone);
|
||||
return cssValuePool().createValue(style->floating());
|
||||
case CSSPropertyFont: {
|
||||
RefPtr<CSSFontValue> computedFont = CSSFontValue::create();
|
||||
computedFont->style = valueForFontStyle(*style);
|
||||
|
||||
@ -785,46 +785,6 @@ template<> inline CSSPrimitiveValue::operator ECaptionSide() const
|
||||
return CAPTOP;
|
||||
}
|
||||
|
||||
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EClear e)
|
||||
: CSSValue(PrimitiveClass)
|
||||
{
|
||||
m_primitiveUnitType = CSS_VALUE_ID;
|
||||
switch (e) {
|
||||
case CNONE:
|
||||
m_value.valueID = CSSValueNone;
|
||||
break;
|
||||
case CLEFT:
|
||||
m_value.valueID = CSSValueLeft;
|
||||
break;
|
||||
case CRIGHT:
|
||||
m_value.valueID = CSSValueRight;
|
||||
break;
|
||||
case CBOTH:
|
||||
m_value.valueID = CSSValueBoth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
template<> inline CSSPrimitiveValue::operator EClear() const
|
||||
{
|
||||
ASSERT(isValueID());
|
||||
switch (m_value.valueID) {
|
||||
case CSSValueNone:
|
||||
return CNONE;
|
||||
case CSSValueLeft:
|
||||
return CLEFT;
|
||||
case CSSValueRight:
|
||||
return CRIGHT;
|
||||
case CSSValueBoth:
|
||||
return CBOTH;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ASSERT_NOT_REACHED();
|
||||
return CNONE;
|
||||
}
|
||||
|
||||
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECursor e)
|
||||
: CSSValue(PrimitiveClass)
|
||||
{
|
||||
@ -1195,42 +1155,6 @@ template<> inline CSSPrimitiveValue::operator EFlexWrap() const
|
||||
return FlexNoWrap;
|
||||
}
|
||||
|
||||
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFloat e)
|
||||
: CSSValue(PrimitiveClass)
|
||||
{
|
||||
m_primitiveUnitType = CSS_VALUE_ID;
|
||||
switch (e) {
|
||||
case NoFloat:
|
||||
m_value.valueID = CSSValueNone;
|
||||
break;
|
||||
case LeftFloat:
|
||||
m_value.valueID = CSSValueLeft;
|
||||
break;
|
||||
case RightFloat:
|
||||
m_value.valueID = CSSValueRight;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
template<> inline CSSPrimitiveValue::operator EFloat() const
|
||||
{
|
||||
ASSERT(isValueID());
|
||||
switch (m_value.valueID) {
|
||||
case CSSValueLeft:
|
||||
return LeftFloat;
|
||||
case CSSValueRight:
|
||||
return RightFloat;
|
||||
case CSSValueNone:
|
||||
case CSSValueCenter: // Non-standard CSS value.
|
||||
return NoFloat;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ASSERT_NOT_REACHED();
|
||||
return NoFloat;
|
||||
}
|
||||
|
||||
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineBreak e)
|
||||
: CSSValue(PrimitiveClass)
|
||||
{
|
||||
|
||||
@ -140,7 +140,6 @@ bottom animatable, initial=initialOffset, converter=convertLengthOrAuto
|
||||
box-shadow animatable, converter=convertShadow
|
||||
box-sizing
|
||||
caption-side inherited
|
||||
clear
|
||||
clip animatable, converter=convertClip, custom_all
|
||||
content custom_all
|
||||
cursor inherited, custom_all
|
||||
@ -151,7 +150,6 @@ flex-direction
|
||||
flex-grow animatable, type_name=float
|
||||
flex-shrink animatable, type_name=float
|
||||
flex-wrap
|
||||
float type_name=EFloat, name_for_methods=Floating
|
||||
height animatable, initial=initialSize, converter=convertLengthSizing
|
||||
image-rendering inherited
|
||||
isolation runtime_flag=CSSCompositing
|
||||
|
||||
@ -368,8 +368,6 @@ bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID
|
||||
return valueID == CSSValueBorderBox || valueID == CSSValueContentBox;
|
||||
case CSSPropertyCaptionSide: // top | bottom | left | right
|
||||
return valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueTop || valueID == CSSValueBottom;
|
||||
case CSSPropertyClear: // none | left | right | both
|
||||
return valueID == CSSValueNone || valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueBoth;
|
||||
case CSSPropertyDirection: // ltr | rtl
|
||||
return valueID == CSSValueLtr || valueID == CSSValueRtl;
|
||||
case CSSPropertyDisplay:
|
||||
@ -380,8 +378,6 @@ bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID
|
||||
return (valueID >= CSSValueInline && valueID <= CSSValueInlineFlex) || valueID == CSSValueNone;
|
||||
case CSSPropertyEmptyCells: // show | hide
|
||||
return valueID == CSSValueShow || valueID == CSSValueHide;
|
||||
case CSSPropertyFloat: // left | right | none | center (for buggy CSS, maps to none)
|
||||
return valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueNone || valueID == CSSValueCenter;
|
||||
case CSSPropertyFontStyle: // normal | italic | oblique
|
||||
return valueID == CSSValueNormal || valueID == CSSValueItalic || valueID == CSSValueOblique;
|
||||
case CSSPropertyFontStretch: // normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded
|
||||
@ -531,11 +527,9 @@ bool isKeywordPropertyID(CSSPropertyID propertyId)
|
||||
case CSSPropertyBorderTopStyle:
|
||||
case CSSPropertyBoxSizing:
|
||||
case CSSPropertyCaptionSide:
|
||||
case CSSPropertyClear:
|
||||
case CSSPropertyDirection:
|
||||
case CSSPropertyDisplay:
|
||||
case CSSPropertyEmptyCells:
|
||||
case CSSPropertyFloat:
|
||||
case CSSPropertyFontStyle:
|
||||
case CSSPropertyFontStretch:
|
||||
case CSSPropertyImageRendering:
|
||||
|
||||
@ -108,9 +108,6 @@ void StyleAdjuster::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
|
||||
{
|
||||
ASSERT(parentStyle);
|
||||
|
||||
// FIXME(sky): Remove floats.
|
||||
style->setFloating(NoFloat);
|
||||
|
||||
if (style->display() != NONE) {
|
||||
// Absolute/fixed positioned elements, floating elements and the document element need block-like outside display.
|
||||
if (style->hasOutOfFlowPosition() || element.document().documentElement() == element)
|
||||
|
||||
@ -397,13 +397,6 @@ bool isSpecialHTMLElement(const Node* n)
|
||||
if (n->isLink())
|
||||
return true;
|
||||
|
||||
RenderObject* renderer = n->renderer();
|
||||
if (!renderer)
|
||||
return false;
|
||||
|
||||
if (renderer->style()->isFloating())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -98,12 +98,10 @@ namespace blink {
|
||||
|
||||
class StyledMarkupAccumulator final : public MarkupAccumulator {
|
||||
public:
|
||||
enum RangeFullySelectsNode { DoesFullySelectNode, DoesNotFullySelectNode };
|
||||
|
||||
StyledMarkupAccumulator(Vector<RawPtr<Node> >* nodes, EAbsoluteURLs, EAnnotateForInterchange, RawPtr<const Range>, Node* highestNodeToBeSerialized = 0);
|
||||
Node* serializeNodes(Node* startNode, Node* pastEnd);
|
||||
void appendString(const String& s) { return MarkupAccumulator::appendString(s); }
|
||||
void wrapWithNode(ContainerNode&, bool convertBlocksToInlines = false, RangeFullySelectsNode = DoesFullySelectNode);
|
||||
void wrapWithNode(ContainerNode&, bool convertBlocksToInlines = false);
|
||||
void wrapWithStyleNode(StylePropertySet*, const Document&, bool isBlock = false);
|
||||
String takeResults();
|
||||
|
||||
@ -113,8 +111,8 @@ private:
|
||||
virtual void appendText(StringBuilder& out, Text&) override;
|
||||
String renderedText(Node&, const Range*);
|
||||
String stringValueForRange(const Node&, const Range*);
|
||||
void appendElement(StringBuilder& out, Element&, bool addDisplayInline, RangeFullySelectsNode);
|
||||
virtual void appendElement(StringBuilder& out, Element& element, Namespaces*) override { appendElement(out, element, false, DoesFullySelectNode); }
|
||||
void appendElement(StringBuilder& out, Element&, bool addDisplayInline);
|
||||
virtual void appendElement(StringBuilder& out, Element& element, Namespaces*) override { appendElement(out, element, false); }
|
||||
|
||||
enum NodeTraversalMode { EmitString, DoNotEmitString };
|
||||
Node* traverseNodesForSerialization(Node* startNode, Node* pastEnd, NodeTraversalMode);
|
||||
@ -139,11 +137,11 @@ inline StyledMarkupAccumulator::StyledMarkupAccumulator(Vector<RawPtr<Node> >* n
|
||||
{
|
||||
}
|
||||
|
||||
void StyledMarkupAccumulator::wrapWithNode(ContainerNode& node, bool convertBlocksToInlines, RangeFullySelectsNode rangeFullySelectsNode)
|
||||
void StyledMarkupAccumulator::wrapWithNode(ContainerNode& node, bool convertBlocksToInlines)
|
||||
{
|
||||
StringBuilder markup;
|
||||
if (node.isElementNode())
|
||||
appendElement(markup, toElement(node), convertBlocksToInlines && isBlock(&node), rangeFullySelectsNode);
|
||||
appendElement(markup, toElement(node), convertBlocksToInlines && isBlock(&node));
|
||||
else
|
||||
appendStartMarkup(markup, node, 0);
|
||||
m_reversedPrecedingMarkup.append(markup.toString());
|
||||
@ -231,7 +229,7 @@ String StyledMarkupAccumulator::stringValueForRange(const Node& node, const Rang
|
||||
return text;
|
||||
}
|
||||
|
||||
void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element, bool addDisplayInline, RangeFullySelectsNode rangeFullySelectsNode)
|
||||
void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element, bool addDisplayInline)
|
||||
{
|
||||
const bool documentIsHTML = element.document().isHTMLDocument();
|
||||
appendOpenTag(out, element, 0);
|
||||
@ -270,11 +268,6 @@ void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element
|
||||
|
||||
if (addDisplayInline)
|
||||
newInlineStyle->forceInline();
|
||||
|
||||
// If the node is not fully selected by the range, then we don't want to keep styles that affect its relationship to the nodes around it
|
||||
// only the ones that affect it and the nodes within it.
|
||||
if (rangeFullySelectsNode == DoesNotFullySelectNode && newInlineStyle->style())
|
||||
newInlineStyle->style()->removeProperty(CSSPropertyFloat);
|
||||
}
|
||||
|
||||
if (!newInlineStyle->isEmpty()) {
|
||||
@ -500,9 +493,7 @@ static String createMarkupInternal(Document& document, const Range* range, const
|
||||
accumulator.wrapWithStyleNode(fullySelectedRootStyle->style(), document, true);
|
||||
}
|
||||
} else {
|
||||
// Since this node and all the other ancestors are not in the selection we want to set RangeFullySelectsNode to DoesNotFullySelectNode
|
||||
// so that styles that affect the exterior of the node are not included.
|
||||
accumulator.wrapWithNode(*ancestor, convertBlocksToInlines, StyledMarkupAccumulator::DoesNotFullySelectNode);
|
||||
accumulator.wrapWithNode(*ancestor, convertBlocksToInlines);
|
||||
}
|
||||
if (nodes)
|
||||
nodes->append(ancestor);
|
||||
|
||||
@ -176,7 +176,7 @@ static inline void notifyObserverWillExitObject(Observer* observer, RenderObject
|
||||
static inline bool isIteratorTarget(RenderObject* object)
|
||||
{
|
||||
ASSERT(object); // The iterator will of course return 0, but its not an expected argument to this function.
|
||||
return object->isText() || object->isFloating() || object->isOutOfFlowPositioned() || object->isReplaced();
|
||||
return object->isText() || object->isOutOfFlowPositioned() || object->isReplaced();
|
||||
}
|
||||
|
||||
// This enum is only used for bidiNextShared()
|
||||
|
||||
@ -90,7 +90,6 @@ RenderBlock::RenderBlock(ContainerNode* node)
|
||||
, m_hasMarkupTruncation(false)
|
||||
, m_hasBorderOrPaddingLogicalWidthChanged(false)
|
||||
, m_hasOnlySelfCollapsingChildren(false)
|
||||
, m_descendantsWithFloatsMarkedForLayout(false)
|
||||
{
|
||||
// RenderBlockFlow calls setChildrenInline(true).
|
||||
// By default, subclasses do not have inline children.
|
||||
@ -807,16 +806,6 @@ void RenderBlock::removeChild(RenderObject* oldChild)
|
||||
// box. We can go ahead and pull the content right back up into our
|
||||
// box.
|
||||
collapseAnonymousBlockChild(this, toRenderBlock(child));
|
||||
} else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousBlock())) && canCollapseAnonymousBlockChild()) {
|
||||
// It's possible that the removal has knocked us down to a single anonymous
|
||||
// block with pseudo-style element siblings (e.g. first-letter). If these
|
||||
// are floating, then we need to pull the content up also.
|
||||
RenderBlock* anonymousBlock = toRenderBlock((prev && prev->isAnonymousBlock()) ? prev : next);
|
||||
if ((anonymousBlock->previousSibling() || anonymousBlock->nextSibling())
|
||||
&& (!anonymousBlock->previousSibling() || (anonymousBlock->previousSibling()->style()->styleType() != NOPSEUDO && anonymousBlock->previousSibling()->isFloating() && !anonymousBlock->previousSibling()->previousSibling()))
|
||||
&& (!anonymousBlock->nextSibling() || (anonymousBlock->nextSibling()->style()->styleType() != NOPSEUDO && anonymousBlock->nextSibling()->isFloating() && !anonymousBlock->nextSibling()->nextSibling()))) {
|
||||
collapseAnonymousBlockChild(this, anonymousBlock);
|
||||
}
|
||||
}
|
||||
|
||||
if (!firstChild()) {
|
||||
@ -1099,7 +1088,7 @@ void RenderBlock::simplifiedNormalFlowLayout()
|
||||
ListHashSet<RootInlineBox*> lineBoxes;
|
||||
for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) {
|
||||
RenderObject* o = walker.current();
|
||||
if (!o->isOutOfFlowPositioned() && (o->isReplaced() || o->isFloating())) {
|
||||
if (!o->isOutOfFlowPositioned() && o->isReplaced()) {
|
||||
o->layoutIfNeeded();
|
||||
if (toRenderBox(o)->inlineBoxWrapper()) {
|
||||
RootInlineBox& box = toRenderBox(o)->inlineBoxWrapper()->root();
|
||||
@ -1302,13 +1291,13 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOf
|
||||
|
||||
void RenderBlock::paintChild(RenderBox* child, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
||||
{
|
||||
if (!child->hasSelfPaintingLayer() && !child->isFloating())
|
||||
if (!child->hasSelfPaintingLayer())
|
||||
child->paint(paintInfo, paintOffset);
|
||||
}
|
||||
|
||||
void RenderBlock::paintChildAsInlineBlock(RenderBox* child, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
||||
{
|
||||
if (!child->hasSelfPaintingLayer() && !child->isFloating())
|
||||
if (!child->hasSelfPaintingLayer())
|
||||
paintAsInlineBlock(child, paintInfo, paintOffset);
|
||||
}
|
||||
|
||||
@ -1534,7 +1523,7 @@ bool RenderBlock::isSelectionRoot() const
|
||||
ASSERT(node() || isAnonymous());
|
||||
|
||||
if (isDocumentElement() || hasOverflowClip()
|
||||
|| isPositioned() || isFloating()
|
||||
|| isPositioned()
|
||||
|| isInlineBlock()
|
||||
|| hasTransform() || hasMask()
|
||||
|| isFlexItemIncludingDeprecated())
|
||||
@ -2189,7 +2178,7 @@ bool RenderBlock::hitTestContents(const HitTestRequest& request, HitTestResult&
|
||||
if (hitTestAction == HitTestChildBlockBackgrounds)
|
||||
childHitTest = HitTestChildBlockBackground;
|
||||
for (RenderBox* child = lastChildBox(); child; child = child->previousSiblingBox()) {
|
||||
if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, locationInContainer, accumulatedOffset, childHitTest))
|
||||
if (!child->hasSelfPaintingLayer() && child->nodeAtPoint(request, result, locationInContainer, accumulatedOffset, childHitTest))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -2444,8 +2433,6 @@ void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
|
||||
bool nowrap = styleToUse->whiteSpace() == NOWRAP;
|
||||
|
||||
RenderObject* child = firstChild();
|
||||
RenderBlock* containingBlock = this->containingBlock();
|
||||
LayoutUnit floatLeftWidth = 0, floatRightWidth = 0;
|
||||
while (child) {
|
||||
// Positioned children don't affect the min/max width
|
||||
if (child->isOutOfFlowPositioned()) {
|
||||
@ -2454,17 +2441,6 @@ void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
|
||||
}
|
||||
|
||||
RefPtr<RenderStyle> childStyle = child->style();
|
||||
if (child->isFloating() || (child->isBox() && toRenderBox(child)->avoidsFloats())) {
|
||||
LayoutUnit floatTotalWidth = floatLeftWidth + floatRightWidth;
|
||||
if (childStyle->clear() & CLEFT) {
|
||||
maxLogicalWidth = std::max(floatTotalWidth, maxLogicalWidth);
|
||||
floatLeftWidth = 0;
|
||||
}
|
||||
if (childStyle->clear() & CRIGHT) {
|
||||
maxLogicalWidth = std::max(floatTotalWidth, maxLogicalWidth);
|
||||
floatRightWidth = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// A margin basically has three types: fixed, percentage, and auto (variable).
|
||||
// Auto and percentage margins simply become 0 when computing min/max width.
|
||||
@ -2492,32 +2468,7 @@ void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
|
||||
|
||||
w = childMaxPreferredLogicalWidth + margin;
|
||||
|
||||
if (!child->isFloating()) {
|
||||
if (child->isBox() && toRenderBox(child)->avoidsFloats()) {
|
||||
// Determine a left and right max value based off whether or not the floats can fit in the
|
||||
// margins of the object. For negative margins, we will attempt to overlap the float if the negative margin
|
||||
// is smaller than the float width.
|
||||
bool ltr = containingBlock ? containingBlock->style()->isLeftToRightDirection() : styleToUse->isLeftToRightDirection();
|
||||
LayoutUnit marginLogicalLeft = ltr ? marginStart : marginEnd;
|
||||
LayoutUnit marginLogicalRight = ltr ? marginEnd : marginStart;
|
||||
LayoutUnit maxLeft = marginLogicalLeft > 0 ? std::max(floatLeftWidth, marginLogicalLeft) : floatLeftWidth + marginLogicalLeft;
|
||||
LayoutUnit maxRight = marginLogicalRight > 0 ? std::max(floatRightWidth, marginLogicalRight) : floatRightWidth + marginLogicalRight;
|
||||
w = childMaxPreferredLogicalWidth + maxLeft + maxRight;
|
||||
w = std::max(w, floatLeftWidth + floatRightWidth);
|
||||
} else {
|
||||
maxLogicalWidth = std::max(floatLeftWidth + floatRightWidth, maxLogicalWidth);
|
||||
}
|
||||
floatLeftWidth = floatRightWidth = 0;
|
||||
}
|
||||
|
||||
if (child->isFloating()) {
|
||||
if (childStyle->floating() == LeftFloat)
|
||||
floatLeftWidth += w;
|
||||
else
|
||||
floatRightWidth += w;
|
||||
} else {
|
||||
maxLogicalWidth = std::max(w, maxLogicalWidth);
|
||||
}
|
||||
maxLogicalWidth = std::max(w, maxLogicalWidth);
|
||||
|
||||
child = child->nextSibling();
|
||||
}
|
||||
@ -2525,8 +2476,6 @@ void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
|
||||
// Always make sure these values are non-negative.
|
||||
minLogicalWidth = std::max<LayoutUnit>(0, minLogicalWidth);
|
||||
maxLogicalWidth = std::max<LayoutUnit>(0, maxLogicalWidth);
|
||||
|
||||
maxLogicalWidth = std::max(floatLeftWidth + floatRightWidth, maxLogicalWidth);
|
||||
}
|
||||
|
||||
bool RenderBlock::hasLineIfEmpty() const
|
||||
@ -2665,7 +2614,7 @@ RenderBlock* RenderBlock::firstLineBlock() const
|
||||
if (hasPseudo)
|
||||
break;
|
||||
RenderObject* parentBlock = firstLineBlock->parent();
|
||||
if (firstLineBlock->isReplaced() || firstLineBlock->isFloating()
|
||||
if (firstLineBlock->isReplaced()
|
||||
|| !parentBlock
|
||||
|| !parentBlock->isRenderBlockFlow())
|
||||
break;
|
||||
@ -2944,8 +2893,6 @@ bool RenderBlock::hasMarginAfterQuirk(const RenderBox* child) const
|
||||
|
||||
const char* RenderBlock::renderName() const
|
||||
{
|
||||
if (isFloating())
|
||||
return "RenderBlock (floating)";
|
||||
if (isOutOfFlowPositioned())
|
||||
return "RenderBlock (positioned)";
|
||||
if (isAnonymousBlock())
|
||||
|
||||
@ -328,8 +328,6 @@ private:
|
||||
|
||||
bool hasCaret() const;
|
||||
|
||||
virtual bool avoidsFloats() const override { return true; }
|
||||
|
||||
bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
|
||||
// FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
|
||||
virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&) { return false; }
|
||||
@ -405,7 +403,6 @@ protected:
|
||||
unsigned m_hasMarkupTruncation : 1;
|
||||
unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1;
|
||||
mutable unsigned m_hasOnlySelfCollapsingChildren : 1;
|
||||
mutable unsigned m_descendantsWithFloatsMarkedForLayout : 1;
|
||||
|
||||
// FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of RenderBlock
|
||||
friend class LineBreaker;
|
||||
|
||||
@ -239,8 +239,6 @@ inline void RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, SubtreeLayou
|
||||
|
||||
// Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
|
||||
computeOverflow(oldClientAfterEdge);
|
||||
|
||||
m_descendantsWithFloatsMarkedForLayout = false;
|
||||
}
|
||||
|
||||
void RenderBlockFlow::determineLogicalLeftPositionForChild(RenderBox* child)
|
||||
@ -260,17 +258,7 @@ void RenderBlockFlow::determineLogicalLeftPositionForChild(RenderBox* child)
|
||||
if (style()->textAlign() == WEBKIT_CENTER || child->style()->marginStartUsing(style()).isAuto())
|
||||
newPosition = std::max(newPosition, childMarginStart);
|
||||
|
||||
setLogicalLeftForChild(child, style()->isLeftToRightDirection() ? newPosition : totalAvailableLogicalWidth - newPosition - logicalWidthForChild(child));
|
||||
}
|
||||
|
||||
void RenderBlockFlow::setLogicalLeftForChild(RenderBox* child, LayoutUnit logicalLeft)
|
||||
{
|
||||
child->setX(logicalLeft);
|
||||
}
|
||||
|
||||
void RenderBlockFlow::setLogicalTopForChild(RenderBox* child, LayoutUnit logicalTop)
|
||||
{
|
||||
child->setY(logicalTop);
|
||||
child->setX(style()->isLeftToRightDirection() ? newPosition : totalAvailableLogicalWidth - newPosition - logicalWidthForChild(child));
|
||||
}
|
||||
|
||||
void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo)
|
||||
@ -282,7 +270,7 @@ void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo)
|
||||
// be correct. Only if we're wrong (when we compute the real logical top position)
|
||||
// will we have to potentially relayout.
|
||||
// Go ahead and position the child as though it didn't collapse with the top.
|
||||
setLogicalTopForChild(child, estimateLogicalTopPosition(child, marginInfo));
|
||||
child->setY(estimateLogicalTopPosition(child, marginInfo));
|
||||
|
||||
child->layoutIfNeeded();
|
||||
|
||||
@ -291,7 +279,7 @@ void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo)
|
||||
|
||||
// Now determine the correct ypos based off examination of collapsing margin
|
||||
// values.
|
||||
setLogicalTopForChild(child, collapseMargins(child, marginInfo, childIsSelfCollapsing));
|
||||
child->setY(collapseMargins(child, marginInfo, childIsSelfCollapsing));
|
||||
|
||||
// FIXME(sky): Is it still actually possible for the child to need layout here?
|
||||
// This used to be needed for floats and/or margin collapsing.
|
||||
@ -643,8 +631,7 @@ void RenderBlockFlow::marginBeforeEstimateForChild(RenderBox* child, LayoutUnit&
|
||||
break;
|
||||
}
|
||||
|
||||
// Give up if there is clearance on the box, since it probably won't collapse into us.
|
||||
if (!grandchildBox || grandchildBox->style()->clear() != CNONE)
|
||||
if (!grandchildBox)
|
||||
return;
|
||||
|
||||
// Make sure to update the block margins now for the grandchild box so that we're looking at current values.
|
||||
@ -1001,11 +988,6 @@ GapRects RenderBlockFlow::inlineSelectionGaps(RenderBlock* rootBlock, const Layo
|
||||
return result;
|
||||
}
|
||||
|
||||
bool RenderBlockFlow::avoidsFloats() const
|
||||
{
|
||||
return RenderBox::avoidsFloats();
|
||||
}
|
||||
|
||||
LayoutUnit RenderBlockFlow::logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position)
|
||||
{
|
||||
LayoutUnit logicalLeft = logicalLeftOffsetForLine(position, false);
|
||||
|
||||
@ -110,7 +110,7 @@ public:
|
||||
|
||||
static bool shouldSkipCreatingRunsForObject(RenderObject* obj)
|
||||
{
|
||||
return obj->isFloating() || (obj->isOutOfFlowPositioned() && !obj->style()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline());
|
||||
return obj->isOutOfFlowPositioned() && !obj->style()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline();
|
||||
}
|
||||
|
||||
void addOverflowFromInlineChildren();
|
||||
@ -121,8 +121,6 @@ public:
|
||||
GapRects inlineSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
|
||||
LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const PaintInfo*);
|
||||
|
||||
virtual bool avoidsFloats() const override;
|
||||
|
||||
protected:
|
||||
void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidationLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge);
|
||||
|
||||
@ -137,8 +135,6 @@ protected:
|
||||
|
||||
virtual bool updateLogicalWidthAndColumnWidth() override;
|
||||
|
||||
void setLogicalLeftForChild(RenderBox* child, LayoutUnit logicalLeft);
|
||||
void setLogicalTopForChild(RenderBox* child, LayoutUnit logicalTop);
|
||||
void determineLogicalLeftPositionForChild(RenderBox* child);
|
||||
|
||||
private:
|
||||
|
||||
@ -865,7 +865,7 @@ RenderObject* InlineMinMaxIterator::next()
|
||||
bool oldEndOfInline = endOfInline;
|
||||
endOfInline = false;
|
||||
while (current || current == parent) {
|
||||
if (!oldEndOfInline && (current == parent || (!current->isFloating() && !current->isReplaced() && !current->isOutOfFlowPositioned())))
|
||||
if (!oldEndOfInline && (current == parent || (!current->isReplaced() && !current->isOutOfFlowPositioned())))
|
||||
result = current->slowFirstChild();
|
||||
|
||||
if (!result) {
|
||||
@ -892,7 +892,7 @@ RenderObject* InlineMinMaxIterator::next()
|
||||
if (!result)
|
||||
break;
|
||||
|
||||
if (!result->isOutOfFlowPositioned() && (result->isText() || result->isFloating() || result->isReplaced() || result->isRenderInline()))
|
||||
if (!result->isOutOfFlowPositioned() && (result->isText() || result->isReplaced() || result->isRenderInline()))
|
||||
break;
|
||||
|
||||
current = result;
|
||||
@ -980,7 +980,6 @@ void RenderBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogical
|
||||
bool hasRemainingNegativeTextIndent = false;
|
||||
|
||||
LayoutUnit textIndent = minimumValueForLength(styleToUse->textIndent(), cw);
|
||||
RenderObject* prevFloat = 0;
|
||||
bool isPrevChildInlineFlow = false;
|
||||
bool shouldBreakLineAfterText = false;
|
||||
while (RenderObject* child = childIterator.next()) {
|
||||
@ -1062,30 +1061,14 @@ void RenderBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogical
|
||||
childMin += childMinPreferredLogicalWidth.ceilToFloat();
|
||||
childMax += childMaxPreferredLogicalWidth.ceilToFloat();
|
||||
|
||||
bool clearPreviousFloat;
|
||||
if (child->isFloating()) {
|
||||
clearPreviousFloat = (prevFloat
|
||||
&& ((prevFloat->style()->floating() == LeftFloat && (childStyle->clear() & CLEFT))
|
||||
|| (prevFloat->style()->floating() == RightFloat && (childStyle->clear() & CRIGHT))));
|
||||
prevFloat = child;
|
||||
} else {
|
||||
clearPreviousFloat = false;
|
||||
}
|
||||
|
||||
bool canBreakReplacedElement = true;
|
||||
if ((canBreakReplacedElement && (autoWrap || oldAutoWrap) && (!isPrevChildInlineFlow || shouldBreakLineAfterText)) || clearPreviousFloat) {
|
||||
if ((canBreakReplacedElement && (autoWrap || oldAutoWrap) && (!isPrevChildInlineFlow || shouldBreakLineAfterText))) {
|
||||
updatePreferredWidth(minLogicalWidth, inlineMin);
|
||||
inlineMin = 0;
|
||||
}
|
||||
|
||||
// If we're supposed to clear the previous float, then terminate maxwidth as well.
|
||||
if (clearPreviousFloat) {
|
||||
updatePreferredWidth(maxLogicalWidth, inlineMax);
|
||||
inlineMax = 0;
|
||||
}
|
||||
|
||||
// Add in text-indent. This is added in only once.
|
||||
if (!addedTextIndent && !child->isFloating()) {
|
||||
if (!addedTextIndent) {
|
||||
float ceiledTextIndent = textIndent.ceilToFloat();
|
||||
childMin += ceiledTextIndent;
|
||||
childMax += ceiledTextIndent;
|
||||
@ -1100,10 +1083,7 @@ void RenderBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogical
|
||||
inlineMax += std::max<float>(0, childMax);
|
||||
|
||||
if (!autoWrap || !canBreakReplacedElement || (isPrevChildInlineFlow && !shouldBreakLineAfterText)) {
|
||||
if (child->isFloating())
|
||||
updatePreferredWidth(minLogicalWidth, childMin);
|
||||
else
|
||||
inlineMin += childMin;
|
||||
inlineMin += childMin;
|
||||
} else {
|
||||
// Now check our line.
|
||||
updatePreferredWidth(minLogicalWidth, childMin);
|
||||
@ -1119,10 +1099,8 @@ void RenderBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogical
|
||||
|
||||
// We are no longer stripping whitespace at the start of
|
||||
// a line.
|
||||
if (!child->isFloating()) {
|
||||
stripFrontSpaces = false;
|
||||
trailingSpaceChild = 0;
|
||||
}
|
||||
stripFrontSpaces = false;
|
||||
trailingSpaceChild = 0;
|
||||
} else if (child->isText()) {
|
||||
// Case (3). Text.
|
||||
RenderText* t = toRenderText(child);
|
||||
@ -1273,16 +1251,14 @@ void RenderBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& pa
|
||||
if (!layoutState.hasInlineChild() && o->isInline())
|
||||
layoutState.setHasInlineChild(true);
|
||||
|
||||
if (o->isReplaced() || o->isFloating() || o->isOutOfFlowPositioned()) {
|
||||
if (o->isReplaced() || o->isOutOfFlowPositioned()) {
|
||||
RenderBox* box = toRenderBox(o);
|
||||
|
||||
updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, box);
|
||||
|
||||
if (o->isOutOfFlowPositioned())
|
||||
if (o->isOutOfFlowPositioned()) {
|
||||
o->containingBlock()->insertPositionedObject(box);
|
||||
else if (o->isFloating())
|
||||
layoutState.floats().append(FloatWithRect(box));
|
||||
else if (isFullLayout || o->needsLayout()) {
|
||||
} else if (isFullLayout || o->needsLayout()) {
|
||||
// Replaced element.
|
||||
box->dirtyLineBoxes(isFullLayout);
|
||||
if (isFullLayout)
|
||||
|
||||
@ -176,9 +176,6 @@ void RenderBox::updateShapeOutsideInfoAfterStyleChange(const RenderStyle& style,
|
||||
ShapeOutsideInfo::removeInfo(*this);
|
||||
else
|
||||
ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty();
|
||||
|
||||
if (shapeOutside || shapeOutside != oldShapeOutside)
|
||||
markShapeOutsideDependentsForLayout();
|
||||
}
|
||||
|
||||
void RenderBox::updateFromStyle()
|
||||
@ -193,8 +190,6 @@ void RenderBox::updateFromStyle()
|
||||
if (isRootObject || isViewObject)
|
||||
setHasBoxDecorationBackground(true);
|
||||
|
||||
setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating());
|
||||
|
||||
bool boxHasOverflowClip = false;
|
||||
if (!styleToUse->isOverflowVisible() && isRenderBlock() && !isViewObject) {
|
||||
// If overflow has been propagated to the viewport, it has no effect here.
|
||||
@ -1209,12 +1204,6 @@ void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*)
|
||||
return;
|
||||
}
|
||||
|
||||
ShapeValue* shapeOutsideValue = style()->shapeOutside();
|
||||
if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue && shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image) {
|
||||
ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty();
|
||||
markShapeOutsideDependentsForLayout();
|
||||
}
|
||||
|
||||
if (!paintInvalidationLayerRectsForImage(image, style()->backgroundLayers(), true))
|
||||
paintInvalidationLayerRectsForImage(image, style()->maskLayers(), false);
|
||||
}
|
||||
@ -1777,7 +1766,7 @@ void RenderBox::computeLogicalWidth(LogicalExtentComputedValues& computedValues)
|
||||
computedValues.m_margins.m_end, style()->marginStart(), style()->marginEnd());
|
||||
|
||||
if (!hasPerpendicularContainingBlock && containerLogicalWidth && containerLogicalWidth != (computedValues.m_extent + computedValues.m_margins.m_start + computedValues.m_margins.m_end)
|
||||
&& !isFloating() && !isInline() && !cb->isFlexibleBox()) {
|
||||
&& !isInline() && !cb->isFlexibleBox()) {
|
||||
LayoutUnit newMargin = containerLogicalWidth - computedValues.m_extent - cb->marginStartForChild(this);
|
||||
bool hasInvertedDirection = cb->style()->isLeftToRightDirection() != style()->isLeftToRightDirection();
|
||||
if (hasInvertedDirection)
|
||||
@ -1849,9 +1838,7 @@ static bool columnFlexItemHasStretchAlignment(const RenderObject* flexitem)
|
||||
|
||||
bool RenderBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const
|
||||
{
|
||||
// Marquees in WinIE are like a mixture of blocks and inline-blocks. They size as though they're blocks,
|
||||
// but they allow text to sit on the same line as the marquee.
|
||||
if (isFloating() || isInlineBlock())
|
||||
if (isInlineBlock())
|
||||
return true;
|
||||
|
||||
if (logicalWidth.type() == Intrinsic)
|
||||
@ -1873,7 +1860,7 @@ bool RenderBox::sizesLogicalWidthToFitContent(const Length& logicalWidth) const
|
||||
|
||||
void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd, Length marginStartLength, Length marginEndLength) const
|
||||
{
|
||||
if (flowDirection == BlockDirection || isFloating() || isInline()) {
|
||||
if (flowDirection == BlockDirection || isInline()) {
|
||||
// Margins are calculated with respect to the logical width of
|
||||
// the containing block (8.3)
|
||||
// Inline blocks/tables and floats don't have their margins increased.
|
||||
@ -3380,17 +3367,6 @@ PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point)
|
||||
return createPositionWithAffinity(firstPositionInOrBeforeNode(nonPseudoNode()));
|
||||
}
|
||||
|
||||
static bool isReplacedElement(Node* node)
|
||||
{
|
||||
// FIXME(sky): Remove this.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RenderBox::avoidsFloats() const
|
||||
{
|
||||
return isReplaced() || isReplacedElement(node()) || hasOverflowClip() || isFlexItemIncludingDeprecated();
|
||||
}
|
||||
|
||||
InvalidationReason RenderBox::getPaintInvalidationReason(const RenderLayerModelObject& paintInvalidationContainer,
|
||||
const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRect& newBounds, const LayoutPoint& newLocation)
|
||||
{
|
||||
|
||||
@ -505,8 +505,6 @@ public:
|
||||
virtual int firstLineBoxBaseline() const { return -1; }
|
||||
virtual int inlineBlockBaseline(LineDirectionMode) const { return -1; } // Returns -1 if we should skip this box when computing the baseline of an inline-block.
|
||||
|
||||
virtual bool avoidsFloats() const;
|
||||
|
||||
bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloatingOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBox(); }
|
||||
|
||||
virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
|
||||
@ -569,12 +567,6 @@ public:
|
||||
return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : 0;
|
||||
}
|
||||
|
||||
void markShapeOutsideDependentsForLayout()
|
||||
{
|
||||
if (isFloating())
|
||||
removeFloatingOrPositionedChildFromBlockLists();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void willBeDestroyed() override;
|
||||
|
||||
|
||||
@ -31,8 +31,6 @@
|
||||
|
||||
namespace blink {
|
||||
|
||||
bool RenderLayerModelObject::s_wasFloating = false;
|
||||
|
||||
RenderLayerModelObject::RenderLayerModelObject(ContainerNode* node)
|
||||
: RenderObject(node)
|
||||
{
|
||||
@ -77,8 +75,6 @@ void RenderLayerModelObject::willBeDestroyed()
|
||||
|
||||
void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
|
||||
{
|
||||
s_wasFloating = isFloating();
|
||||
|
||||
if (RenderStyle* oldStyle = style()) {
|
||||
if (parent() && diff.needsPaintInvalidationLayer()) {
|
||||
if (oldStyle->hasAutoClip() != newStyle.hasAutoClip()
|
||||
@ -100,8 +96,6 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
|
||||
LayerType type = layerTypeRequired();
|
||||
if (type != NoLayer) {
|
||||
if (!layer()) {
|
||||
if (s_wasFloating && isFloating())
|
||||
setChildNeedsLayout();
|
||||
createLayer(type);
|
||||
if (parent() && !needsLayout()) {
|
||||
// FIXME: This invalidation is overly broad. We should update to
|
||||
@ -114,8 +108,6 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
|
||||
} else if (layer() && layer()->parent()) {
|
||||
setHasTransform(false); // Either a transform wasn't specified or the object doesn't support transforms, so just null out the bit.
|
||||
layer()->removeOnlyThisLayer(); // calls destroyLayer() which clears m_layer
|
||||
if (s_wasFloating && isFloating())
|
||||
setChildNeedsLayout();
|
||||
if (hadTransform)
|
||||
setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
|
||||
}
|
||||
|
||||
@ -1805,23 +1805,18 @@ void RenderObject::setStyle(PassRefPtr<RenderStyle> style)
|
||||
void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
|
||||
{
|
||||
if (m_style) {
|
||||
if (isFloating() && (m_style->floating() != newStyle.floating()))
|
||||
// For changes in float styles, we need to conceivably remove ourselves
|
||||
// from the floating objects list.
|
||||
toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
|
||||
else if (isOutOfFlowPositioned() && (m_style->position() != newStyle.position()))
|
||||
if (isOutOfFlowPositioned() && (m_style->position() != newStyle.position()))
|
||||
// For changes in positioning styles, we need to conceivably remove ourselves
|
||||
// from the positioned objects list.
|
||||
toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
|
||||
|
||||
s_affectsParentBlock = isFloatingOrOutOfFlowPositioned()
|
||||
&& (!newStyle.isFloating() && !newStyle.hasOutOfFlowPosition())
|
||||
&& !newStyle.hasOutOfFlowPosition()
|
||||
&& parent() && (parent()->isRenderBlockFlow() || parent()->isRenderInline());
|
||||
|
||||
// Clearing these bits is required to avoid leaving stale renderers.
|
||||
// FIXME: We shouldn't need that hack if our logic was totally correct.
|
||||
if (diff.needsLayout()) {
|
||||
setFloating(false);
|
||||
clearPositionedState();
|
||||
}
|
||||
} else {
|
||||
@ -2320,7 +2315,7 @@ void RenderObject::insertedIntoTree()
|
||||
addLayers(layer);
|
||||
}
|
||||
|
||||
if (!isFloating() && parent()->childrenInline())
|
||||
if (parent()->childrenInline())
|
||||
parent()->dirtyLinesFromChangedChild(this);
|
||||
}
|
||||
|
||||
|
||||
@ -410,8 +410,6 @@ public:
|
||||
bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); }
|
||||
virtual RenderBoxModelObject* virtualContinuation() const { return 0; }
|
||||
|
||||
bool isFloating() const { return m_bitfields.floating(); }
|
||||
|
||||
bool isOutOfFlowPositioned() const { return m_bitfields.isOutOfFlowPositioned(); } // absolute or fixed positioning
|
||||
bool isRelPositioned() const { return m_bitfields.isRelPositioned(); } // relative positioning
|
||||
bool isPositioned() const { return m_bitfields.isPositioned(); }
|
||||
@ -546,7 +544,6 @@ public:
|
||||
}
|
||||
void clearPositionedState() { m_bitfields.clearPositionedState(); }
|
||||
|
||||
void setFloating(bool isFloating) { m_bitfields.setFloating(isFloating); }
|
||||
void setInline(bool isInline) { m_bitfields.setIsInline(isInline); }
|
||||
|
||||
void setHasBoxDecorationBackground(bool);
|
||||
@ -733,7 +730,8 @@ public:
|
||||
|
||||
virtual unsigned length() const { return 1; }
|
||||
|
||||
bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); }
|
||||
// FIXME(sky): Remove
|
||||
bool isFloatingOrOutOfFlowPositioned() const { return isOutOfFlowPositioned(); }
|
||||
|
||||
bool isTransparent() const { return style()->hasOpacity(); }
|
||||
float opacity() const { return style()->opacity(); }
|
||||
|
||||
@ -84,7 +84,7 @@ public:
|
||||
|
||||
void increment();
|
||||
|
||||
void handleBR(EClear&);
|
||||
void handleBR();
|
||||
void handleOutOfFlowPositioned(Vector<RenderBox*>& positionedObjects);
|
||||
void handleEmptyInline();
|
||||
void handleReplaced();
|
||||
@ -251,7 +251,7 @@ inline void BreakingContext::increment()
|
||||
m_atStart = false;
|
||||
}
|
||||
|
||||
inline void BreakingContext::handleBR(EClear& clear)
|
||||
inline void BreakingContext::handleBR()
|
||||
{
|
||||
if (m_width.fitsOnLine()) {
|
||||
RenderObject* br = m_current.object();
|
||||
@ -267,15 +267,6 @@ inline void BreakingContext::handleBR(EClear& clear)
|
||||
m_lineInfo.setEmpty(false, m_block, &m_width);
|
||||
m_trailingObjects.clear();
|
||||
m_lineInfo.setPreviousLineBrokeCleanly(true);
|
||||
|
||||
// A <br> with clearance always needs a linebox in case the lines below it get dirtied later and
|
||||
// need to check for floats to clear - so if we're ignoring spaces, stop ignoring them and add a
|
||||
// run for this object.
|
||||
if (m_ignoringSpaces && m_currentStyle->clear() != CNONE)
|
||||
m_lineMidpointState.ensureLineBoxInsideIgnoredSpaces(br);
|
||||
|
||||
if (!m_lineInfo.isEmpty())
|
||||
clear = m_currentStyle->clear();
|
||||
}
|
||||
m_atEnd = true;
|
||||
}
|
||||
|
||||
@ -48,7 +48,6 @@ void LineBreaker::reset()
|
||||
{
|
||||
m_positionedObjects.clear();
|
||||
m_hyphenated = false;
|
||||
m_clear = CNONE;
|
||||
}
|
||||
|
||||
InlineIterator LineBreaker::nextLineBreak(InlineBidiResolver& resolver, LineInfo& lineInfo,
|
||||
|
||||
@ -47,7 +47,6 @@ public:
|
||||
|
||||
bool lineWasHyphenated() { return m_hyphenated; }
|
||||
const Vector<RenderBox*>& positionedObjects() { return m_positionedObjects; }
|
||||
EClear clear() { return m_clear; }
|
||||
private:
|
||||
void reset();
|
||||
|
||||
@ -55,7 +54,6 @@ private:
|
||||
|
||||
RenderBlockFlow* m_block;
|
||||
bool m_hyphenated;
|
||||
EClear m_clear;
|
||||
Vector<RenderBox*> m_positionedObjects;
|
||||
};
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ LayoutUnit ShapeOutsideInfo::logicalLeftOffset() const
|
||||
bool ShapeOutsideInfo::isEnabledFor(const RenderBox& box)
|
||||
{
|
||||
ShapeValue* shapeValue = box.style()->shapeOutside();
|
||||
if (!box.isFloating() || !shapeValue)
|
||||
if (!shapeValue)
|
||||
return false;
|
||||
|
||||
switch (shapeValue->type()) {
|
||||
|
||||
@ -189,9 +189,7 @@ void RenderStyle::copyNonInheritedFrom(const RenderStyle* other)
|
||||
noninherited_flags.overflowX = other->noninherited_flags.overflowX;
|
||||
noninherited_flags.overflowY = other->noninherited_flags.overflowY;
|
||||
noninherited_flags.verticalAlign = other->noninherited_flags.verticalAlign;
|
||||
noninherited_flags.clear = other->noninherited_flags.clear;
|
||||
noninherited_flags.position = other->noninherited_flags.position;
|
||||
noninherited_flags.floating = other->noninherited_flags.floating;
|
||||
noninherited_flags.tableLayout = other->noninherited_flags.tableLayout;
|
||||
noninherited_flags.unicodeBidi = other->noninherited_flags.unicodeBidi;
|
||||
noninherited_flags.pageBreakBefore = other->noninherited_flags.pageBreakBefore;
|
||||
@ -413,10 +411,8 @@ bool RenderStyle::diffNeedsFullLayoutAndPaintInvalidation(const RenderStyle& oth
|
||||
|
||||
if (noninherited_flags.overflowX != other.noninherited_flags.overflowX
|
||||
|| noninherited_flags.overflowY != other.noninherited_flags.overflowY
|
||||
|| noninherited_flags.clear != other.noninherited_flags.clear
|
||||
|| noninherited_flags.unicodeBidi != other.noninherited_flags.unicodeBidi
|
||||
|| noninherited_flags.position != other.noninherited_flags.position
|
||||
|| noninherited_flags.floating != other.noninherited_flags.floating
|
||||
|| noninherited_flags.originalDisplay != other.noninherited_flags.originalDisplay)
|
||||
return true;
|
||||
|
||||
|
||||
@ -181,9 +181,7 @@ protected:
|
||||
&& overflowX == other.overflowX
|
||||
&& overflowY == other.overflowY
|
||||
&& verticalAlign == other.verticalAlign
|
||||
&& clear == other.clear
|
||||
&& position == other.position
|
||||
&& floating == other.floating
|
||||
&& tableLayout == other.tableLayout
|
||||
&& pageBreakBefore == other.pageBreakBefore
|
||||
&& pageBreakAfter == other.pageBreakAfter
|
||||
@ -209,9 +207,7 @@ protected:
|
||||
unsigned overflowX : 3; // EOverflow
|
||||
unsigned overflowY : 3; // EOverflow
|
||||
unsigned verticalAlign : 4; // EVerticalAlign
|
||||
unsigned clear : 2; // EClear
|
||||
unsigned position : 3; // EPosition
|
||||
unsigned floating : 2; // EFloat
|
||||
unsigned tableLayout : 1; // ETableLayout
|
||||
unsigned unicodeBidi : 3; // EUnicodeBidi
|
||||
|
||||
@ -267,9 +263,7 @@ protected:
|
||||
noninherited_flags.overflowX = initialOverflowX();
|
||||
noninherited_flags.overflowY = initialOverflowY();
|
||||
noninherited_flags.verticalAlign = initialVerticalAlign();
|
||||
noninherited_flags.clear = initialClear();
|
||||
noninherited_flags.position = initialPosition();
|
||||
noninherited_flags.floating = initialFloating();
|
||||
noninherited_flags.tableLayout = initialTableLayout();
|
||||
noninherited_flags.unicodeBidi = initialUnicodeBidi();
|
||||
noninherited_flags.pageBreakBefore = initialPageBreak();
|
||||
@ -332,7 +326,6 @@ public:
|
||||
|
||||
bool operator==(const RenderStyle& other) const;
|
||||
bool operator!=(const RenderStyle& other) const { return !(*this == other); }
|
||||
bool isFloating() const { return noninherited_flags.floating != NoFloat; }
|
||||
bool hasMargin() const { return surround->margin.nonZero(); }
|
||||
bool hasBorder() const { return surround->border.hasBorder(); }
|
||||
bool hasPadding() const { return surround->padding.nonZero(); }
|
||||
@ -402,7 +395,6 @@ public:
|
||||
EPosition position() const { return static_cast<EPosition>(noninherited_flags.position); }
|
||||
bool hasOutOfFlowPosition() const { return position() == AbsolutePosition; }
|
||||
bool hasInFlowPosition() const { return position() == RelativePosition; }
|
||||
EFloat floating() const { return static_cast<EFloat>(noninherited_flags.floating); }
|
||||
|
||||
const Length& width() const { return m_box->width(); }
|
||||
const Length& height() const { return m_box->height(); }
|
||||
@ -488,7 +480,6 @@ public:
|
||||
|
||||
EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninherited_flags.unicodeBidi); }
|
||||
|
||||
EClear clear() const { return static_cast<EClear>(noninherited_flags.clear); }
|
||||
ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags.tableLayout); }
|
||||
bool isFixedTableLayout() const { return tableLayout() == TFIXED && !logicalWidth().isAuto(); }
|
||||
|
||||
@ -836,7 +827,6 @@ public:
|
||||
void setDisplay(EDisplay v) { noninherited_flags.effectiveDisplay = v; }
|
||||
void setOriginalDisplay(EDisplay v) { noninherited_flags.originalDisplay = v; }
|
||||
void setPosition(EPosition v) { noninherited_flags.position = v; }
|
||||
void setFloating(EFloat v) { noninherited_flags.floating = v; }
|
||||
|
||||
void setLeft(const Length& v) { SET_VAR(surround, offset.m_left, v); }
|
||||
void setRight(const Length& v) { SET_VAR(surround, offset.m_right, v); }
|
||||
@ -962,7 +952,6 @@ public:
|
||||
|
||||
void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags.unicodeBidi = b; }
|
||||
|
||||
void setClear(EClear v) { noninherited_flags.clear = v; }
|
||||
void setTableLayout(ETableLayout v) { noninherited_flags.tableLayout = v; }
|
||||
|
||||
bool setFontDescription(const FontDescription&);
|
||||
@ -1292,7 +1281,6 @@ public:
|
||||
static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
|
||||
static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
|
||||
static ECaptionSide initialCaptionSide() { return CAPTOP; }
|
||||
static EClear initialClear() { return CNONE; }
|
||||
static LengthBox initialClip() { return LengthBox(); }
|
||||
static TextDirection initialDirection() { return LTR; }
|
||||
static TextOrientation initialTextOrientation() { return TextOrientationVerticalRight; }
|
||||
@ -1300,7 +1288,6 @@ public:
|
||||
static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); }
|
||||
static EDisplay initialDisplay() { return BLOCK; }
|
||||
static EEmptyCell initialEmptyCells() { return SHOW; }
|
||||
static EFloat initialFloating() { return NoFloat; }
|
||||
static EListStylePosition initialListStylePosition() { return OUTSIDE; }
|
||||
static EListStyleType initialListStyleType() { return Disc; }
|
||||
static EOverflow initialOverflowX() { return OVISIBLE; }
|
||||
|
||||
@ -75,10 +75,6 @@ enum EPosition {
|
||||
AbsolutePosition = 2,
|
||||
};
|
||||
|
||||
enum EFloat {
|
||||
NoFloat, LeftFloat, RightFloat
|
||||
};
|
||||
|
||||
enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
|
||||
|
||||
// Box decoration attributes. Not inherited.
|
||||
@ -100,10 +96,6 @@ enum EVerticalAlign {
|
||||
TEXT_BOTTOM, TOP, BOTTOM, BASELINE_MIDDLE, LENGTH
|
||||
};
|
||||
|
||||
enum EClear {
|
||||
CNONE = 0, CLEFT = 1, CRIGHT = 2, CBOTH = 3
|
||||
};
|
||||
|
||||
enum ETableLayout {
|
||||
TAUTO, TFIXED
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user