提交 3046acd9 编写于 作者: E Eric Seidel

Remove backface visibility

I made one edit in FrameView while looking at writing
RenderParagraph in Dart and then decided to look for
a slightly larger clean-up to justify committing it.
I found backface-visibility which I removed.

backface-visibility controls painting/hittesting of flipped objects.
https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility

It's mostly used as a hack to get layers however. :)

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1161623004
上级 ae7e807f
......@@ -179,8 +179,6 @@ static const CSSPropertyID staticComputableProperties[] = {
CSSPropertyWordWrap,
CSSPropertyZIndex,
CSSPropertyBackfaceVisibility,
CSSPropertyWebkitBackfaceVisibility,
CSSPropertyWebkitBackgroundClip,
CSSPropertyWebkitBackgroundComposite,
CSSPropertyWebkitBackgroundOrigin,
......@@ -1830,9 +1828,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
if (!style->hasAspectRatio())
return cssValuePool().createIdentifierValue(CSSValueNone);
return CSSAspectRatioValue::create(style->aspectRatioNumerator(), style->aspectRatioDenominator());
case CSSPropertyBackfaceVisibility:
case CSSPropertyWebkitBackfaceVisibility:
return cssValuePool().createIdentifierValue((style->backfaceVisibility() == BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible);
case CSSPropertyWebkitBorderImage:
return valueForNinePieceImage(style->borderImage(), *style);
case CSSPropertyBorderImageOutset:
......
......@@ -267,37 +267,6 @@ template<> inline CSSPrimitiveValue::operator CompositeOperator() const
return CompositeClear;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBackfaceVisibility e)
: CSSValue(PrimitiveClass)
{
m_primitiveUnitType = CSS_VALUE_ID;
switch (e) {
case BackfaceVisibilityVisible:
m_value.valueID = CSSValueVisible;
break;
case BackfaceVisibilityHidden:
m_value.valueID = CSSValueHidden;
break;
}
}
template<> inline CSSPrimitiveValue::operator EBackfaceVisibility() const
{
ASSERT(isValueID());
switch (m_value.valueID) {
case CSSValueVisible:
return BackfaceVisibilityVisible;
case CSSValueHidden:
return BackfaceVisibilityHidden;
default:
break;
}
ASSERT_NOT_REACHED();
return BackfaceVisibilityHidden;
}
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillAttachment e)
: CSSValue(PrimitiveClass)
{
......
......@@ -111,7 +111,6 @@ align-items custom_all
// LAYOUT
align-self custom_all
backface-visibility
background-attachment custom_all
background-clip custom_all
background-color animatable, custom_all
......@@ -311,7 +310,6 @@ animation-timing-function custom_all
filter animatable, custom_value
-webkit-aspect-ratio inherited, custom_all
-webkit-backface-visibility use_handlers_for=CSSPropertyBackfaceVisibility
-webkit-background-clip use_handlers_for=CSSPropertyBackgroundClip
-webkit-background-composite custom_all
-webkit-background-origin use_handlers_for=CSSPropertyBackgroundOrigin
......
......@@ -385,9 +385,6 @@ bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID
case CSSPropertyTouchActionDelay: // none | script
ASSERT(RuntimeEnabledFeatures::cssTouchActionDelayEnabled());
return valueID == CSSValueScript || valueID == CSSValueNone;
case CSSPropertyBackfaceVisibility:
case CSSPropertyWebkitBackfaceVisibility:
return valueID == CSSValueVisible || valueID == CSSValueHidden;
case CSSPropertyWebkitBoxDecorationBreak:
return valueID == CSSValueClone || valueID == CSSValueSlice;
case CSSPropertyAlignContent:
......@@ -465,8 +462,6 @@ bool isKeywordPropertyID(CSSPropertyID propertyId)
case CSSPropertyTextRendering:
case CSSPropertyTouchActionDelay:
case CSSPropertyUnicodeBidi:
case CSSPropertyBackfaceVisibility:
case CSSPropertyWebkitBackfaceVisibility:
case CSSPropertyWebkitBorderAfterStyle:
case CSSPropertyWebkitBorderBeforeStyle:
case CSSPropertyWebkitBorderEndStyle:
......
......@@ -316,7 +316,7 @@ void FrameView::layout(bool allowSubtree)
m_lastViewportSize = layoutSize();
}
m_size = LayoutSize(layoutSize().width(), layoutSize().height());
m_size = LayoutSize(layoutSize());
}
layer = rootForThisLayout->enclosingLayer();
......
......@@ -637,14 +637,6 @@ bool RenderBox::hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLayer
layer()->stackingNode()->updateLayerListsIfNeeded();
layer()->update3DTransformedDescendantStatus();
// Check for hit test on backface if backface-visibility is 'hidden'
if (localTransformState && style()->backfaceVisibility() == BackfaceVisibilityHidden) {
TransformationMatrix invertedMatrix = localTransformState->m_accumulatedTransform.inverse();
// If the z-vector of the matrix is negative, the back is facing towards the viewer.
if (invertedMatrix.m33() < 0)
return 0;
}
RefPtr<HitTestingTransformState> unflattenedTransformState = localTransformState;
if (localTransformState && !style()->preserves3D()) {
// Keep a copy of the pre-flattening state, for computing z-offsets for the container
......
......@@ -74,7 +74,7 @@ public:
// position:static elements that are not flex-items get their z-index coerced to auto.
virtual LayerType layerTypeRequired() const
{
if (isPositioned() || createsGroup() || hasClipPath() || hasTransform() || hasHiddenBackface() || !style()->hasAutoZIndex())
if (isPositioned() || createsGroup() || hasClipPath() || hasTransform() || !style()->hasAutoZIndex())
return NormalLayer;
if (hasOverflowClip())
return OverflowClipLayer;
......
......@@ -1875,11 +1875,6 @@ bool RenderObject::nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const
return false;
}
bool RenderObject::isRelayoutBoundaryForInspector() const
{
return objectIsRelayoutBoundary(this);
}
bool RenderObject::isAllowedToModifyRenderTreeStructure(Document& document)
{
return document.lifecycle().stateAllowsRenderTreeMutations();
......
......@@ -338,7 +338,6 @@ public:
bool hasTransform() const { return m_bitfields.hasTransform(); }
bool hasClipPath() const { return style() && style()->clipPath(); }
bool hasHiddenBackface() const { return style() && style()->backfaceVisibility() == BackfaceVisibilityHidden; }
inline bool preservesNewline() const;
......@@ -361,9 +360,6 @@ public:
// is true if the renderer returned is an ancestor of paintInvalidationContainer.
RenderObject* container(const RenderBox* paintInvalidationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const;
// TODO(esprehn): Remove this.
RenderObject* hoverAncestor() const { return parent(); }
Element* offsetParent() const;
void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObject* newRoot = 0, SubtreeLayoutScope* = 0);
......@@ -501,6 +497,7 @@ public:
const RenderView* containerForPaintInvalidation() const;
const RenderBox* adjustCompositedContainerForSpecialAncestors(const RenderBox* paintInvalidationContainer) const;
// Overriden by RenderText for character length, used in line layout code.
virtual unsigned length() const { return 1; }
// FIXME(sky): Remove
......@@ -592,8 +589,6 @@ public:
RespectImageOrientationEnum shouldRespectImageOrientation() const;
bool isRelayoutBoundaryForInspector() const;
bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNeededPositionedMovementLayout(); }
void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeededPositionedMovementLayout(b); }
......
......@@ -670,7 +670,6 @@ public:
ETransformStyle3D transformStyle3D() const { return static_cast<ETransformStyle3D>(rareNonInheritedData->m_transformStyle3D); }
bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; }
EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfaceVisibility>(rareNonInheritedData->m_backfaceVisibility); }
float perspective() const { return rareNonInheritedData->m_perspective; }
bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
const Length& perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
......@@ -953,7 +952,6 @@ public:
}
void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); }
void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); }
void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
void setPerspectiveOriginX(const Length& l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); }
void setPerspectiveOriginY(const Length& l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); }
......@@ -1107,7 +1105,6 @@ public:
static EPointerEvents initialPointerEvents() { return PE_AUTO; }
static float initialTransformOriginZ() { return 0; }
static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
static float initialPerspective() { return 0; }
static Length initialPerspectiveOriginX() { return Length(50.0, Percent); }
static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
......
......@@ -204,10 +204,6 @@ enum ETransformStyle3D {
TransformStyle3DFlat, TransformStyle3DPreserve3D
};
enum EBackfaceVisibility {
BackfaceVisibilityVisible, BackfaceVisibilityHidden
};
enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen };
......
......@@ -42,7 +42,6 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
, m_order(RenderStyle::initialOrder())
, m_objectPosition(RenderStyle::initialObjectPosition())
, m_transformStyle3D(RenderStyle::initialTransformStyle3D())
, m_backfaceVisibility(RenderStyle::initialBackfaceVisibility())
, m_alignContent(RenderStyle::initialAlignContent())
, m_alignItems(RenderStyle::initialAlignItems())
, m_alignItemsOverflowAlignment(RenderStyle::initialAlignItemsOverflowAlignment())
......@@ -85,7 +84,6 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
, m_order(o.m_order)
, m_objectPosition(o.m_objectPosition)
, m_transformStyle3D(o.m_transformStyle3D)
, m_backfaceVisibility(o.m_backfaceVisibility)
, m_alignContent(o.m_alignContent)
, m_alignItems(o.m_alignItems)
, m_alignItemsOverflowAlignment(o.m_alignItemsOverflowAlignment)
......@@ -132,7 +130,6 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
&& m_order == o.m_order
&& m_objectPosition == o.m_objectPosition
&& m_transformStyle3D == o.m_transformStyle3D
&& m_backfaceVisibility == o.m_backfaceVisibility
&& m_alignContent == o.m_alignContent
&& m_alignItems == o.m_alignItems
&& m_alignItemsOverflowAlignment == o.m_alignItemsOverflowAlignment
......
......@@ -100,7 +100,6 @@ public:
LengthPoint m_objectPosition;
unsigned m_transformStyle3D : 1; // ETransformStyle3D
unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
unsigned m_alignContent : 3; // EAlignContent
unsigned m_alignItems : 4; // ItemPosition
......
......@@ -94,15 +94,6 @@ public:
// position rather than their tree order.
virtual void setRenderingContext(int id) = 0;
// Mark that this layer should use its parent's transform and double-sided
// properties in determining this layer's backface visibility instead of
// using its own properties. If this property is set, this layer must
// have a parent, and the parent may not have this property set.
// Note: This API is to work around issues with visibility the handling of
// WebKit layers that have a contents layer (canvas, plugin, WebGL, video,
// etc).
virtual void setUseParentBackfaceVisibility(bool) = 0;
virtual void setBackgroundColor(WebColor) = 0;
virtual WebColor backgroundColor() const = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册