Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2753013004: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text
Patch Set: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index dd686597bdff2afb4b06c8140f040842bc7f7919..5844c31af5c32c9e517147c2e883b41939b9ef62 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -61,6 +61,8 @@
namespace blink {
+static const int kPaintOrderBitwidth = 2;
+
struct SameSizeAsBorderValue {
RGBA32 m_color;
unsigned m_bitfield;
@@ -785,6 +787,14 @@ bool ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation(
if (!m_rareInheritedData->quotesDataEquivalent(
*other.m_rareInheritedData.get()))
return true;
+
+ // These properties affect the cached stroke bounding box rects.
+ if (m_rareInheritedData->capStyle != other.m_rareInheritedData->capStyle ||
+ m_rareInheritedData->joinStyle !=
+ other.m_rareInheritedData->joinStyle ||
+ m_rareInheritedData->strokeWidth !=
+ other.m_rareInheritedData->strokeWidth)
+ return true;
}
if (m_styleInheritedData->textAutosizingMultiplier !=
@@ -945,7 +955,9 @@ bool ComputedStyle::diffNeedsPaintInvalidationObject(
m_rareInheritedData->userSelect !=
other.m_rareInheritedData->userSelect ||
m_rareInheritedData->m_imageRendering !=
- other.m_rareInheritedData->m_imageRendering)
+ other.m_rareInheritedData->m_imageRendering ||
+ m_rareInheritedData->paintOrder !=
+ other.m_rareInheritedData->paintOrder)
return true;
}
@@ -2474,6 +2486,43 @@ bool ComputedStyle::shadowListHasCurrentColor(const ShadowList* shadowList) {
return false;
}
+unsigned paintOrderSequence(EPaintOrderType first,
+ EPaintOrderType second,
+ EPaintOrderType third) {
+ return (((third << kPaintOrderBitwidth) | second) << kPaintOrderBitwidth) |
+ first;
+}
+
+EPaintOrderType ComputedStyle::paintOrderType(unsigned index) const {
+ unsigned pt = 0;
+ DCHECK_LT(index, static_cast<unsigned>((1 << kPaintOrderBitwidth) - 1));
+ switch (this->paintOrder()) {
+ case PaintOrderNormal:
+ case PaintOrderFillStrokeMarkers:
+ pt = paintOrderSequence(PT_FILL, PT_STROKE, PT_MARKERS);
+ break;
+ case PaintOrderFillMarkersStroke:
+ pt = paintOrderSequence(PT_FILL, PT_MARKERS, PT_STROKE);
+ break;
+ case PaintOrderStrokeFillMarkers:
+ pt = paintOrderSequence(PT_STROKE, PT_FILL, PT_MARKERS);
+ break;
+ case PaintOrderStrokeMarkersFill:
+ pt = paintOrderSequence(PT_STROKE, PT_MARKERS, PT_FILL);
+ break;
+ case PaintOrderMarkersFillStroke:
+ pt = paintOrderSequence(PT_MARKERS, PT_FILL, PT_STROKE);
+ break;
+ case PaintOrderMarkersStrokeFill:
+ pt = paintOrderSequence(PT_MARKERS, PT_STROKE, PT_FILL);
+ break;
+ }
+
+ pt =
+ (pt >> (kPaintOrderBitwidth * index)) & ((1u << kPaintOrderBitwidth) - 1);
+ return (EPaintOrderType)pt;
+}
+
static inline Vector<GridTrackSize> initialGridAutoTracks() {
Vector<GridTrackSize> trackSizeList;
trackSizeList.reserveInitialCapacity(1);
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/ComputedStyleTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698