提交 bfbf1431 编写于 作者: E Eric Seidel

Remove page-break properties and captions

We want some sort of per-screen breaking, but this
CSS is not the way to do it.  All of this was already
dead code.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1070313003
上级 9d8066aa
......@@ -27,11 +27,6 @@ protected:
}
};
TEST_F(AnimationDeferredLegacyStyleInterpolationTest, Inherit)
{
EXPECT_TRUE(test(CSSPropertyCaptionSide, "inherit"));
}
TEST_F(AnimationDeferredLegacyStyleInterpolationTest, Color)
{
EXPECT_FALSE(test(CSSPropertyColor, "rgb(10, 20, 30)"));
......
......@@ -107,7 +107,6 @@ static const CSSPropertyID staticComputableProperties[] = {
CSSPropertyBottom,
CSSPropertyBoxShadow,
CSSPropertyBoxSizing,
CSSPropertyCaptionSide,
CSSPropertyClip,
CSSPropertyColor,
CSSPropertyDirection,
......@@ -148,9 +147,6 @@ static const CSSPropertyID staticComputableProperties[] = {
CSSPropertyPaddingLeft,
CSSPropertyPaddingRight,
CSSPropertyPaddingTop,
CSSPropertyPageBreakAfter,
CSSPropertyPageBreakBefore,
CSSPropertyPageBreakInside,
CSSPropertyPointerEvents,
CSSPropertyPosition,
CSSPropertyRight,
......@@ -1361,8 +1357,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
case CSSPropertyBoxShadow:
case CSSPropertyWebkitBoxShadow:
return valueForShadowList(style->boxShadow(), *style, true);
case CSSPropertyCaptionSide:
return cssValuePool().createValue(style->captionSide());
case CSSPropertyColor:
return cssValuePool().createColorValue(m_allowVisitedStyle ? style->colorIncludingFallback(CSSPropertyColor).rgb() : style->color().rgb());
case CSSPropertyTabSize:
......@@ -1579,17 +1573,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
return pixelValueForLength(paddingLeft, *style);
return pixelValue(toRenderBox(renderer)->computedCSSPaddingLeft(), *style);
}
case CSSPropertyPageBreakAfter:
return cssValuePool().createValue(style->pageBreakAfter());
case CSSPropertyPageBreakBefore:
return cssValuePool().createValue(style->pageBreakBefore());
case CSSPropertyPageBreakInside: {
EPageBreak pageBreak = style->pageBreakInside();
ASSERT(pageBreak != PBALWAYS);
if (pageBreak == PBALWAYS)
return nullptr;
return cssValuePool().createValue(style->pageBreakInside());
}
case CSSPropertyPosition:
return cssValuePool().createValue(style->position());
case CSSPropertyRight:
......
......@@ -683,46 +683,6 @@ template<> inline CSSPrimitiveValue::operator EBoxOrient() const
return HORIZONTAL;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ECaptionSide e)
: CSSValue(PrimitiveClass)
{
m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case CAPLEFT:
m_value.valueID = CSSValueLeft;
break;
case CAPRIGHT:
m_value.valueID = CSSValueRight;
break;
case CAPTOP:
m_value.valueID = CSSValueTop;
break;
case CAPBOTTOM:
m_value.valueID = CSSValueBottom;
break;
}
}
template<> inline CSSPrimitiveValue::operator ECaptionSide() const
{
ASSERT(isValueID());
switch (m_value.valueID) {
case CSSValueLeft:
return CAPLEFT;
case CSSValueRight:
return CAPRIGHT;
case CSSValueTop:
return CAPTOP;
case CSSValueBottom:
return CAPBOTTOM;
default:
break;
}
ASSERT_NOT_REACHED();
return CAPTOP;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDisplay e)
: CSSValue(PrimitiveClass)
{
......@@ -1052,43 +1012,6 @@ template<> inline CSSPrimitiveValue::operator EOverflow() const
return OVISIBLE;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e)
: CSSValue(PrimitiveClass)
{
m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case PBAUTO:
m_value.valueID = CSSValueAuto;
break;
case PBALWAYS:
m_value.valueID = CSSValueAlways;
break;
case PBAVOID:
m_value.valueID = CSSValueAvoid;
break;
}
}
template<> inline CSSPrimitiveValue::operator EPageBreak() const
{
ASSERT(isValueID());
switch (m_value.valueID) {
case CSSValueAuto:
return PBAUTO;
case CSSValueLeft:
case CSSValueRight:
case CSSValueAlways:
return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right to always."
case CSSValueAvoid:
return PBAVOID;
default:
break;
}
ASSERT_NOT_REACHED();
return PBAUTO;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
: CSSValue(PrimitiveClass)
{
......
......@@ -152,9 +152,6 @@ box-shadow animatable, converter=convertShadow
// LAYOUT
box-sizing
// LAYOUT
caption-side inherited
clip animatable, converter=convertClip, custom_all
// LAYOUT
......@@ -248,15 +245,6 @@ padding-right animatable, initial=initialPadding, converter=convertLength
// LAYOUT
padding-top animatable, initial=initialPadding, converter=convertLength
// OBSOLETE
page-break-after type_name=EPageBreak, initial=initialPageBreak
// OBSOLETE
page-break-before type_name=EPageBreak, initial=initialPageBreak
// OBSOLETE
page-break-inside type_name=EPageBreak, initial=initialPageBreak
perspective animatable, custom_value
perspective-origin animatable, custom_all
......
......@@ -282,9 +282,6 @@ String StylePropertySet::asText() const
static const CSSPropertyID staticBlockProperties[] = {
CSSPropertyOverflow, // This can be also be applied to replaced elements
CSSPropertyWebkitAspectRatio,
CSSPropertyPageBreakAfter,
CSSPropertyPageBreakBefore,
CSSPropertyPageBreakInside,
CSSPropertyTextAlign,
CSSPropertyTextAlignLast,
CSSPropertyTextIndent,
......
......@@ -330,8 +330,6 @@ bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID
return valueID >= CSSValueNone && valueID <= CSSValueDouble;
case CSSPropertyBoxSizing:
return valueID == CSSValueBorderBox || valueID == CSSValueContentBox;
case CSSPropertyCaptionSide: // top | bottom | left | right
return valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueTop || valueID == CSSValueBottom;
case CSSPropertyDirection: // ltr | rtl
return valueID == CSSValueLtr || valueID == CSSValueRtl;
case CSSPropertyDisplay:
......@@ -360,9 +358,6 @@ bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID
return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueAuto || valueID == CSSValueOverlay;
case CSSPropertyOverflowY: // visible | hidden | auto | overlay | -webkit-paged-x | -webkit-paged-y
return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY;
case CSSPropertyPageBreakAfter: // auto | always | avoid | left | right
case CSSPropertyPageBreakBefore:
case CSSPropertyPageBreakInside: // avoid | auto
case CSSPropertyPointerEvents:
// none | visiblePainted | visibleFill | visibleStroke | visible |
// painted | fill | stroke | auto | all | bounding-box
......@@ -457,7 +452,6 @@ bool isKeywordPropertyID(CSSPropertyID propertyId)
case CSSPropertyBorderRightStyle:
case CSSPropertyBorderTopStyle:
case CSSPropertyBoxSizing:
case CSSPropertyCaptionSide:
case CSSPropertyDirection:
case CSSPropertyDisplay:
case CSSPropertyEmptyCells:
......@@ -469,9 +463,6 @@ bool isKeywordPropertyID(CSSPropertyID propertyId)
case CSSPropertyOverflowWrap:
case CSSPropertyOverflowX:
case CSSPropertyOverflowY:
case CSSPropertyPageBreakAfter:
case CSSPropertyPageBreakBefore:
case CSSPropertyPageBreakInside:
case CSSPropertyPointerEvents:
case CSSPropertyPosition:
case CSSPropertyTableLayout:
......
......@@ -1113,9 +1113,6 @@ PositionWithAffinity RenderBlock::positionForPointWithInlineChildren(const Layou
if (!firstRootBoxWithChildren)
firstRootBoxWithChildren = root;
if (root->isFirstAfterPageBreak() && (pointInLogicalContents.y() < root->lineTopWithLeading()))
break;
lastRootBoxWithChildren = root;
// check if this root line box is located at this y coordinate
......
......@@ -54,9 +54,6 @@ public:
LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; }
LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; }
bool isFirstAfterPageBreak() const { return m_fragmentationData ? m_fragmentationData->m_isFirstAfterPageBreak : false; }
void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { ensureLineFragmentationData()->m_isFirstAfterPageBreak = isFirstAfterPageBreak; }
LayoutUnit paginatedLineWidth() const { return m_fragmentationData ? m_fragmentationData->m_paginatedLineWidth : LayoutUnit(0); }
void setPaginatedLineWidth(LayoutUnit width) { ensureLineFragmentationData()->m_paginatedLineWidth = width; }
......@@ -197,13 +194,11 @@ private:
public:
LineFragmentationData()
: m_paginatedLineWidth(0)
, m_isFirstAfterPageBreak(false)
{
}
LayoutUnit m_paginatedLineWidth;
bool m_isFirstAfterPageBreak;
};
OwnPtr<LineFragmentationData> m_fragmentationData;
......
......@@ -180,9 +180,6 @@ void RenderStyle::copyNonInheritedFrom(const RenderStyle* other)
noninherited_flags.position = other->noninherited_flags.position;
noninherited_flags.tableLayout = other->noninherited_flags.tableLayout;
noninherited_flags.unicodeBidi = other->noninherited_flags.unicodeBidi;
noninherited_flags.pageBreakBefore = other->noninherited_flags.pageBreakBefore;
noninherited_flags.pageBreakAfter = other->noninherited_flags.pageBreakAfter;
noninherited_flags.pageBreakInside = other->noninherited_flags.pageBreakInside;
noninherited_flags.explicitInheritance = other->noninherited_flags.explicitInheritance;
noninherited_flags.currentColor = other->noninherited_flags.currentColor;
noninherited_flags.hasViewportUnits = other->noninherited_flags.hasViewportUnits;
......
......@@ -132,7 +132,6 @@ protected:
bool operator==(const InheritedFlags& other) const
{
return (_empty_cells == other._empty_cells)
&& (_caption_side == other._caption_side)
&& (_visibility == other._visibility)
&& (_text_align == other._text_align)
&& (m_textUnderline == other.m_textUnderline)
......@@ -145,7 +144,6 @@ protected:
bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
unsigned _empty_cells : 1; // EEmptyCell
unsigned _caption_side : 2; // ECaptionSide
unsigned _visibility : 2; // EVisibility
unsigned _text_align : 4; // ETextAlign
unsigned m_textUnderline : 1;
......@@ -170,9 +168,6 @@ protected:
&& verticalAlign == other.verticalAlign
&& position == other.position
&& tableLayout == other.tableLayout
&& pageBreakBefore == other.pageBreakBefore
&& pageBreakAfter == other.pageBreakAfter
&& pageBreakInside == other.pageBreakInside
&& styleType == other.styleType
&& affectedByFocus == other.affectedByFocus
&& affectedByHover == other.affectedByHover
......@@ -204,10 +199,6 @@ protected:
// 32 bits
unsigned pageBreakBefore : 2; // EPageBreak
unsigned pageBreakAfter : 2; // EPageBreak
unsigned pageBreakInside : 2; // EPageBreak
unsigned styleType : 6; // PseudoId
unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property
unsigned currentColor : 1; // At least one color has the value 'currentColor'
......@@ -232,7 +223,6 @@ protected:
void setBitDefaults()
{
inherited_flags._empty_cells = initialEmptyCells();
inherited_flags._caption_side = initialCaptionSide();
inherited_flags._visibility = initialVisibility();
inherited_flags._text_align = initialTextAlign();
inherited_flags.m_textUnderline = false;
......@@ -248,9 +238,6 @@ protected:
noninherited_flags.position = initialPosition();
noninherited_flags.tableLayout = initialTableLayout();
noninherited_flags.unicodeBidi = initialUnicodeBidi();
noninherited_flags.pageBreakBefore = initialPageBreak();
noninherited_flags.pageBreakAfter = initialPageBreak();
noninherited_flags.pageBreakInside = initialPageBreak();
noninherited_flags.explicitInheritance = false;
noninherited_flags.currentColor = false;
noninherited_flags.unique = false;
......@@ -554,7 +541,6 @@ public:
short horizontalBorderSpacing() const;
short verticalBorderSpacing() const;
EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
const Length& marginTop() const { return surround->margin.top(); }
const Length& marginBottom() const { return surround->margin.bottom(); }
......@@ -581,10 +567,6 @@ public:
bool isLink() const { return noninherited_flags.isLink; }
EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags.pageBreakInside); }
EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninherited_flags.pageBreakBefore); }
EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninherited_flags.pageBreakAfter); }
// CSS3 Getter Methods
int outlineOffset() const
......@@ -883,7 +865,6 @@ public:
void setHorizontalBorderSpacing(short);
void setVerticalBorderSpacing(short);
void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRatio, b); }
void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); }
......@@ -910,11 +891,6 @@ public:
unsigned zIndex() const { return m_box->zIndex(); }
void setZIndex(unsigned v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v); }
// For valid values of page-break-inside see http://www.w3.org/TR/CSS21/page.html#page-break-props
void setPageBreakInside(EPageBreak b) { ASSERT(b == PBAUTO || b == PBAVOID); noninherited_flags.pageBreakInside = b; }
void setPageBreakBefore(EPageBreak b) { noninherited_flags.pageBreakBefore = b; }
void setPageBreakAfter(EPageBreak b) { noninherited_flags.pageBreakAfter = b; }
// CSS3 Setters
void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v); }
void setTextShadow(PassRefPtr<ShadowList>);
......@@ -1064,7 +1040,6 @@ public:
static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
static ECaptionSide initialCaptionSide() { return CAPTOP; }
static LengthBox initialClip() { return LengthBox(); }
static TextDirection initialDirection() { return LTR; }
static TextOrientation initialTextOrientation() { return TextOrientationVerticalRight; }
......@@ -1074,7 +1049,6 @@ public:
static EEmptyCell initialEmptyCells() { return SHOW; }
static EOverflow initialOverflowX() { return OVISIBLE; }
static EOverflow initialOverflowY() { return OVISIBLE; }
static EPageBreak initialPageBreak() { return PBAUTO; }
static EPosition initialPosition() { return StaticPosition; }
static ETableLayout initialTableLayout() { return TAUTO; }
static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
......
......@@ -195,18 +195,10 @@ enum TextUnderlinePosition {
TextUnderlinePositionUnder
};
enum EPageBreak {
PBAUTO, PBALWAYS, PBAVOID
};
enum EEmptyCell {
SHOW, HIDE
};
enum ECaptionSide {
CAPTOP, CAPBOTTOM, CAPLEFT, CAPRIGHT
};
enum EVisibility { VISIBLE, HIDDEN, COLLAPSE };
// The order of this enum must match the order of the display values in CSSValueKeywords.in.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册