mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove position:relative.
The use-cases we care about are met better by translate2d. Remove the parsing so that people writing on sky don't depend on it. Followup patches will remove the functionality. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/904613005
This commit is contained in:
parent
6ee8440f27
commit
effdf28e11
@ -1528,9 +1528,6 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
|
||||
case StaticPosition:
|
||||
m_value.valueID = CSSValueStatic;
|
||||
break;
|
||||
case RelativePosition:
|
||||
m_value.valueID = CSSValueRelative;
|
||||
break;
|
||||
case AbsolutePosition:
|
||||
m_value.valueID = CSSValueAbsolute;
|
||||
break;
|
||||
@ -1543,8 +1540,6 @@ template<> inline CSSPrimitiveValue::operator EPosition() const
|
||||
switch (m_value.valueID) {
|
||||
case CSSValueStatic:
|
||||
return StaticPosition;
|
||||
case CSSValueRelative:
|
||||
return RelativePosition;
|
||||
case CSSValueAbsolute:
|
||||
return AbsolutePosition;
|
||||
default:
|
||||
|
||||
@ -365,7 +365,6 @@ portrait
|
||||
pre
|
||||
pre-line
|
||||
pre-wrap
|
||||
relative
|
||||
separate
|
||||
show
|
||||
static
|
||||
|
||||
@ -376,8 +376,8 @@ bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID
|
||||
// none | visiblePainted | visibleFill | visibleStroke | visible |
|
||||
// painted | fill | stroke | auto | all | bounding-box
|
||||
return valueID == CSSValueVisible || valueID == CSSValueNone || valueID == CSSValueAll || valueID == CSSValueAuto || (valueID >= CSSValueVisiblepainted && valueID <= CSSValueBoundingBox);
|
||||
case CSSPropertyPosition: // static | relative | absolute | fixed
|
||||
return valueID == CSSValueStatic || valueID == CSSValueRelative || valueID == CSSValueAbsolute || valueID == CSSValueFixed;
|
||||
case CSSPropertyPosition: // static | absolute
|
||||
return valueID == CSSValueStatic || valueID == CSSValueAbsolute;
|
||||
case CSSPropertySpeak: // none | normal | spell-out | digits | literal-punctuation | no-punctuation
|
||||
return valueID == CSSValueNone || valueID == CSSValueNormal || valueID == CSSValueSpellOut || valueID == CSSValueDigits || valueID == CSSValueLiteralPunctuation || valueID == CSSValueNoPunctuation;
|
||||
case CSSPropertyTableLayout: // auto | fixed
|
||||
|
||||
@ -177,10 +177,6 @@ void RenderBlock::styleWillChange(StyleDifference diff, const RenderStyle& newSt
|
||||
// They will be inserted into our positioned objects list during layout.
|
||||
RenderObject* cb = parent();
|
||||
while (cb && (cb->style()->position() == StaticPosition || (cb->isInline() && !cb->isReplaced())) && !cb->isRenderView()) {
|
||||
if (cb->style()->position() == RelativePosition && cb->isInline() && !cb->isReplaced()) {
|
||||
cb = cb->containingBlock();
|
||||
break;
|
||||
}
|
||||
cb = cb->parent();
|
||||
}
|
||||
|
||||
|
||||
@ -51,10 +51,7 @@ namespace blink {
|
||||
|
||||
static void adjustClipRectsForChildren(const RenderObject& renderer, ClipRects& clipRects)
|
||||
{
|
||||
EPosition position = renderer.style()->position();
|
||||
if (position == RelativePosition) {
|
||||
clipRects.setPosClipRect(clipRects.overflowClipRect());
|
||||
} else if (position == AbsolutePosition) {
|
||||
if (renderer.style()->position() == AbsolutePosition) {
|
||||
clipRects.setOverflowClipRect(clipRects.posClipRect());
|
||||
}
|
||||
}
|
||||
|
||||
@ -726,8 +726,7 @@ private:
|
||||
// FIXME(sky): Remove this enum and just use EPosition directly.
|
||||
enum PositionedState {
|
||||
IsStaticallyPositioned = 0,
|
||||
IsRelativelyPositioned = 1,
|
||||
IsOutOfFlowPositioned = 2,
|
||||
IsOutOfFlowPositioned = 1,
|
||||
};
|
||||
|
||||
public:
|
||||
@ -791,12 +790,13 @@ private:
|
||||
ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForRenderInline, AlwaysCreateLineBoxesForRenderInline);
|
||||
|
||||
private:
|
||||
unsigned m_positionedState : 2; // PositionedState
|
||||
unsigned m_positionedState : 1; // PositionedState
|
||||
unsigned m_selectionState : 3; // SelectionState
|
||||
|
||||
public:
|
||||
bool isOutOfFlowPositioned() const { return m_positionedState == IsOutOfFlowPositioned; }
|
||||
bool isRelPositioned() const { return m_positionedState == IsRelativelyPositioned; }
|
||||
// FIXME(sky): Remove
|
||||
bool isRelPositioned() const { return false; }
|
||||
bool isPositioned() const { return m_positionedState != IsStaticallyPositioned; }
|
||||
|
||||
void setPositionedState(int positionState)
|
||||
|
||||
@ -199,7 +199,7 @@ protected:
|
||||
unsigned overflowX : 3; // EOverflow
|
||||
unsigned overflowY : 3; // EOverflow
|
||||
unsigned verticalAlign : 4; // EVerticalAlign
|
||||
unsigned position : 3; // EPosition
|
||||
unsigned position : 1; // EPosition
|
||||
unsigned tableLayout : 1; // ETableLayout
|
||||
unsigned unicodeBidi : 3; // EUnicodeBidi
|
||||
|
||||
@ -374,7 +374,8 @@ public:
|
||||
|
||||
EPosition position() const { return static_cast<EPosition>(noninherited_flags.position); }
|
||||
bool hasOutOfFlowPosition() const { return position() == AbsolutePosition; }
|
||||
bool hasInFlowPosition() const { return position() == RelativePosition; }
|
||||
// FIXME(sky): Remove
|
||||
bool hasInFlowPosition() const { return false; }
|
||||
|
||||
const Length& width() const { return m_box->width(); }
|
||||
const Length& height() const { return m_box->height(); }
|
||||
|
||||
@ -49,8 +49,7 @@ enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON };
|
||||
|
||||
enum EPosition {
|
||||
StaticPosition = 0,
|
||||
RelativePosition = 1,
|
||||
AbsolutePosition = 2,
|
||||
AbsolutePosition = 1,
|
||||
};
|
||||
|
||||
// Box decoration attributes. Not inherited.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user