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

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

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.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 043e2233a9150af7460166166e09b755e054d71a..3b0dfcc2fb91479526e0efa451a9cf5284693073 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -2235,6 +2235,49 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
float wordSpacing() const;
void setWordSpacing(float);
+ // Support for paint-order, stroke-linecap, and stroke-linejoin from
+ // https://drafts.fxtf.org/paint/
+
+ // paint-order
+ static EPaintOrder initialPaintOrder() { return PaintOrderNormal; }
+ void setPaintOrder(EPaintOrder order) {
+ SET_VAR(m_rareInheritedData, paintOrder, order);
+ }
+ EPaintOrder paintOrder() const {
+ return (EPaintOrder)m_rareInheritedData->paintOrder;
+ }
+ EPaintOrderType paintOrderType(unsigned index) const;
+
+ // stroke-linecap
+ static LineCap initialCapStyle() { return ButtCap; }
+ void setCapStyle(LineCap val) { SET_VAR(m_rareInheritedData, capStyle, val); }
+ LineCap capStyle() const { return (LineCap)m_rareInheritedData->capStyle; }
+ bool hasSquareCapStyle() const { return capStyle() == SquareCap; }
+
+ // stroke-linejoin
+ static LineJoin initialJoinStyle() { return MiterJoin; }
+ void setJoinStyle(LineJoin val) {
+ SET_VAR(m_rareInheritedData, joinStyle, val);
+ }
+ LineJoin joinStyle() const {
+ return (LineJoin)(m_rareInheritedData->joinStyle);
+ }
+ bool hasMiterJoinStyle() const { return joinStyle() == MiterJoin; }
+
+ // stroke-width
+ static UnzoomedLength initialStrokeWidth() {
+ return UnzoomedLength(Length(1, Fixed));
+ }
+ void setStrokeWidth(const UnzoomedLength& w) {
+ SET_VAR(m_rareInheritedData, strokeWidth, w);
+ }
+ const UnzoomedLength& strokeWidth() const {
+ return m_rareInheritedData->strokeWidth;
+ }
+ bool hasVisibleStroke() const {
+ return svgStyle().hasStroke() && !strokeWidth().isZero();
+ }
+
// SVG properties.
const SVGComputedStyle& svgStyle() const { return *m_svgStyle.get(); }
SVGComputedStyle& accessSVGStyle() { return *m_svgStyle.access(); }
@@ -2331,12 +2374,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
float strokeOpacity() const { return svgStyle().strokeOpacity(); }
void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); }
- // stroke-width
- const UnzoomedLength& strokeWidth() const { return svgStyle().strokeWidth(); }
- void setStrokeWidth(const UnzoomedLength& w) {
- accessSVGStyle().setStrokeWidth(w);
- }
-
// Comparison operators
// TODO(shend): Replace callers of operator== wth a named method instead, e.g.
// inheritedEquals().
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGShapePainter.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698