summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/style
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-09-28 16:39:37 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:31:01 +0000
commit9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c (patch)
tree322337ad0acbc75732f916376ec6d36e7ec0e5bc /Source/WebCore/rendering/style
parent6882a04fb36642862b11efe514251d32070c3d65 (diff)
downloadqtwebkit-9daf1655d7e4eaaa6ed5f44055a4b4fd399fd25c.tar.gz
Imported WebKit commit eb954cdcf58f9b915b2fcb6f8e4cb3a60650a4f3
Change-Id: I8dda875c38075d43b76fe3a21acb0ffa102bb82d Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/rendering/style')
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.cpp1
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.h8
-rw-r--r--Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp3
-rw-r--r--Source/WebCore/rendering/style/StyleRareNonInheritedData.h2
-rw-r--r--Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp4
-rw-r--r--Source/WebCore/rendering/style/WillChangeData.cpp26
-rw-r--r--Source/WebCore/rendering/style/WillChangeData.h2
7 files changed, 42 insertions, 4 deletions
diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp
index ebd4c9142..39c43ee15 100644
--- a/Source/WebCore/rendering/style/RenderStyle.cpp
+++ b/Source/WebCore/rendering/style/RenderStyle.cpp
@@ -811,6 +811,7 @@ bool RenderStyle::changeRequiresRepaint(const RenderStyle& other, unsigned& chan
|| rareNonInheritedData->userDrag != other.rareNonInheritedData->userDrag
|| rareNonInheritedData->m_borderFit != other.rareNonInheritedData->m_borderFit
|| rareNonInheritedData->m_objectFit != other.rareNonInheritedData->m_objectFit
+ || rareNonInheritedData->m_objectPosition != other.rareNonInheritedData->m_objectPosition
|| rareInheritedData->m_imageRendering != other.rareInheritedData->m_imageRendering)
return true;
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index 559df8182..7f84a0754 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -40,6 +40,7 @@
#include "Length.h"
#include "LengthBox.h"
#include "LengthFunctions.h"
+#include "LengthPoint.h"
#include "LengthSize.h"
#include "LineClampValue.h"
#include "NinePieceImage.h"
@@ -1035,8 +1036,9 @@ public:
TextOrientation textOrientation() const { return static_cast<TextOrientation>(rareInheritedData->m_textOrientation); }
ObjectFit objectFit() const { return static_cast<ObjectFit>(rareNonInheritedData->m_objectFit); }
-
- // Return true if any transform related property (currently transform, transformStyle3D or perspective)
+ LengthPoint objectPosition() const { return rareNonInheritedData->m_objectPosition; }
+
+ // Return true if any transform related property (currently transform, transformStyle3D or perspective)
// indicates that we are transforming
bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
@@ -1606,6 +1608,7 @@ public:
bool setTextOrientation(TextOrientation);
void setObjectFit(ObjectFit fit) { SET_VAR(rareNonInheritedData, m_objectFit, fit); }
+ void setObjectPosition(const LengthPoint& position) { SET_VAR(rareNonInheritedData, m_objectPosition, position); }
void setRubyPosition(RubyPosition position) { SET_VAR(rareInheritedData, m_rubyPosition, position); }
@@ -1896,6 +1899,7 @@ public:
static TextOrientation initialTextOrientation() { return TextOrientation::
Mixed; }
static ObjectFit initialObjectFit() { return ObjectFitFill; }
+ static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0f, Percent), Length(50.0f, Percent)); }
static EEmptyCell initialEmptyCells() { return SHOW; }
static EListStylePosition initialListStylePosition() { return OUTSIDE; }
static EListStyleType initialListStyleType() { return Disc; }
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
index 24ae59cf2..120bd5f5a 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
@@ -63,6 +63,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
#endif
, m_willChange(RenderStyle::initialWillChange())
, m_mask(FillLayer(MaskFillLayer))
+ , m_objectPosition(RenderStyle::initialObjectPosition())
#if ENABLE(CSS_SHAPES)
, m_shapeOutside(RenderStyle::initialShapeOutside())
, m_shapeMargin(RenderStyle::initialShapeMargin())
@@ -149,6 +150,7 @@ inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn
, m_mask(o.m_mask)
, m_maskBoxImage(o.m_maskBoxImage)
, m_pageSize(o.m_pageSize)
+ , m_objectPosition(o.m_objectPosition)
#if ENABLE(CSS_SHAPES)
, m_shapeOutside(o.m_shapeOutside)
, m_shapeMargin(o.m_shapeMargin)
@@ -253,6 +255,7 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
&& m_mask == o.m_mask
&& m_maskBoxImage == o.m_maskBoxImage
&& m_pageSize == o.m_pageSize
+ && m_objectPosition == o.m_objectPosition
#if ENABLE(CSS_SHAPES)
&& arePointingToEqualData(m_shapeOutside, o.m_shapeOutside)
&& m_shapeMargin == o.m_shapeMargin
diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
index 9b1b2ad53..069b92878 100644
--- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
+++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
@@ -32,6 +32,7 @@
#include "CursorData.h"
#include "DataRef.h"
#include "FillLayer.h"
+#include "LengthPoint.h"
#include "LineClampValue.h"
#include "NinePieceImage.h"
#include "ShapeValue.h"
@@ -154,6 +155,7 @@ public:
NinePieceImage m_maskBoxImage;
LengthSize m_pageSize;
+ LengthPoint m_objectPosition;
#if ENABLE(CSS_SHAPES)
RefPtr<ShapeValue> m_shapeOutside;
diff --git a/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp b/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp
index 8d8858f84..854c3e25f 100644
--- a/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp
+++ b/Source/WebCore/rendering/style/StyleScrollSnapPoints.cpp
@@ -31,8 +31,8 @@
namespace WebCore {
ScrollSnapPoints::ScrollSnapPoints()
- : repeatOffset(100, Percent)
- , hasRepeat(true)
+ : repeatOffset(0, Fixed)
+ , hasRepeat(false)
, usesElements(false)
{
}
diff --git a/Source/WebCore/rendering/style/WillChangeData.cpp b/Source/WebCore/rendering/style/WillChangeData.cpp
index 77d4aa871..cff2e7cd3 100644
--- a/Source/WebCore/rendering/style/WillChangeData.cpp
+++ b/Source/WebCore/rendering/style/WillChangeData.cpp
@@ -99,6 +99,30 @@ static bool propertyCreatesStackingContext(CSSPropertyID property)
}
}
+static bool propertyCreatesGraphicalGroup(CSSPropertyID property)
+{
+ switch (property) {
+ case CSSPropertyClipPath:
+ case CSSPropertyWebkitClipPath:
+ case CSSPropertyMask:
+ case CSSPropertyOpacity:
+#if ENABLE(CSS_COMPOSITING)
+ case CSSPropertyMixBlendMode:
+ case CSSPropertyIsolation:
+#endif
+ case CSSPropertyFilter:
+#if ENABLE(FILTERS_LEVEL_2)
+ case CSSPropertyWebkitBackdropFilter:
+#endif
+ case CSSPropertyWebkitMask:
+ case CSSPropertyWebkitMaskImage:
+ case CSSPropertyWebkitMaskBoxImage:
+ return true;
+ default:
+ return false;
+ }
+}
+
static bool propertyTriggersCompositing(CSSPropertyID property)
{
switch (property) {
@@ -137,6 +161,8 @@ void WillChangeData::addFeature(Feature feature, CSSPropertyID propertyID)
m_canTriggerCompositingOnInline |= propertyTriggersCompositing(propertyID);
m_canTriggerCompositing |= m_canTriggerCompositingOnInline | propertyTriggersCompositingOnBoxesOnly(propertyID);
+
+ m_canCreateGraphicalGroup |= propertyCreatesGraphicalGroup(propertyID);
}
WillChangeData::FeaturePropertyPair WillChangeData::featureAt(size_t index) const
diff --git a/Source/WebCore/rendering/style/WillChangeData.h b/Source/WebCore/rendering/style/WillChangeData.h
index 49e76089d..6bab28da6 100644
--- a/Source/WebCore/rendering/style/WillChangeData.h
+++ b/Source/WebCore/rendering/style/WillChangeData.h
@@ -57,6 +57,7 @@ public:
bool canCreateStackingContext() const { return m_canCreateStackingContext; }
bool canTriggerCompositing() const { return m_canTriggerCompositing; }
bool canTriggerCompositingOnInline() const { return m_canTriggerCompositingOnInline; }
+ bool canCreateGraphicalGroup() const { return m_canCreateGraphicalGroup; }
enum Feature {
ScrollPosition,
@@ -124,6 +125,7 @@ private:
bool m_canCreateStackingContext { false };
bool m_canTriggerCompositing { false };
bool m_canTriggerCompositingOnInline { false };
+ bool m_canCreateGraphicalGroup { false };
};