OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 // FIXME: Remove letter-spacing/word-spacing and replace them with respective | 2228 // FIXME: Remove letter-spacing/word-spacing and replace them with respective |
2229 // FontBuilder calls. letter-spacing | 2229 // FontBuilder calls. letter-spacing |
2230 static float initialLetterWordSpacing() { return 0.0f; } | 2230 static float initialLetterWordSpacing() { return 0.0f; } |
2231 float letterSpacing() const; | 2231 float letterSpacing() const; |
2232 void setLetterSpacing(float); | 2232 void setLetterSpacing(float); |
2233 | 2233 |
2234 // word-spacing | 2234 // word-spacing |
2235 float wordSpacing() const; | 2235 float wordSpacing() const; |
2236 void setWordSpacing(float); | 2236 void setWordSpacing(float); |
2237 | 2237 |
| 2238 // Support for paint-order, stroke-linecap, and stroke-linejoin from |
| 2239 // https://drafts.fxtf.org/paint/ |
| 2240 |
| 2241 // paint-order |
| 2242 static EPaintOrder initialPaintOrder() { return PaintOrderNormal; } |
| 2243 void setPaintOrder(EPaintOrder order) { |
| 2244 SET_VAR(m_rareInheritedData, paintOrder, order); |
| 2245 } |
| 2246 EPaintOrder paintOrder() const { |
| 2247 return (EPaintOrder)m_rareInheritedData->paintOrder; |
| 2248 } |
| 2249 EPaintOrderType paintOrderType(unsigned index) const; |
| 2250 |
| 2251 // stroke-linecap |
| 2252 static LineCap initialCapStyle() { return ButtCap; } |
| 2253 void setCapStyle(LineCap val) { SET_VAR(m_rareInheritedData, capStyle, val); } |
| 2254 LineCap capStyle() const { return (LineCap)m_rareInheritedData->capStyle; } |
| 2255 bool hasSquareCapStyle() const { return capStyle() == SquareCap; } |
| 2256 |
| 2257 // stroke-linejoin |
| 2258 static LineJoin initialJoinStyle() { return MiterJoin; } |
| 2259 void setJoinStyle(LineJoin val) { |
| 2260 SET_VAR(m_rareInheritedData, joinStyle, val); |
| 2261 } |
| 2262 LineJoin joinStyle() const { |
| 2263 return (LineJoin)(m_rareInheritedData->joinStyle); |
| 2264 } |
| 2265 bool hasMiterJoinStyle() const { return joinStyle() == MiterJoin; } |
| 2266 |
| 2267 // stroke-width |
| 2268 static UnzoomedLength initialStrokeWidth() { |
| 2269 return UnzoomedLength(Length(1, Fixed)); |
| 2270 } |
| 2271 void setStrokeWidth(const UnzoomedLength& w) { |
| 2272 SET_VAR(m_rareInheritedData, strokeWidth, w); |
| 2273 } |
| 2274 const UnzoomedLength& strokeWidth() const { |
| 2275 return m_rareInheritedData->strokeWidth; |
| 2276 } |
| 2277 bool hasVisibleStroke() const { |
| 2278 return svgStyle().hasStroke() && !strokeWidth().isZero(); |
| 2279 } |
| 2280 |
2238 // SVG properties. | 2281 // SVG properties. |
2239 const SVGComputedStyle& svgStyle() const { return *m_svgStyle.get(); } | 2282 const SVGComputedStyle& svgStyle() const { return *m_svgStyle.get(); } |
2240 SVGComputedStyle& accessSVGStyle() { return *m_svgStyle.access(); } | 2283 SVGComputedStyle& accessSVGStyle() { return *m_svgStyle.access(); } |
2241 | 2284 |
2242 // baseline-shift | 2285 // baseline-shift |
2243 EBaselineShift baselineShift() const { return svgStyle().baselineShift(); } | 2286 EBaselineShift baselineShift() const { return svgStyle().baselineShift(); } |
2244 const Length& baselineShiftValue() const { | 2287 const Length& baselineShiftValue() const { |
2245 return svgStyle().baselineShiftValue(); | 2288 return svgStyle().baselineShiftValue(); |
2246 } | 2289 } |
2247 void setBaselineShiftValue(const Length& value) { | 2290 void setBaselineShiftValue(const Length& value) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2324 } | 2367 } |
2325 | 2368 |
2326 // stroke-miterlimit | 2369 // stroke-miterlimit |
2327 float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); } | 2370 float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); } |
2328 void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); } | 2371 void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); } |
2329 | 2372 |
2330 // stroke-opacity | 2373 // stroke-opacity |
2331 float strokeOpacity() const { return svgStyle().strokeOpacity(); } | 2374 float strokeOpacity() const { return svgStyle().strokeOpacity(); } |
2332 void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); } | 2375 void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); } |
2333 | 2376 |
2334 // stroke-width | |
2335 const UnzoomedLength& strokeWidth() const { return svgStyle().strokeWidth(); } | |
2336 void setStrokeWidth(const UnzoomedLength& w) { | |
2337 accessSVGStyle().setStrokeWidth(w); | |
2338 } | |
2339 | |
2340 // Comparison operators | 2377 // Comparison operators |
2341 // TODO(shend): Replace callers of operator== wth a named method instead, e.g. | 2378 // TODO(shend): Replace callers of operator== wth a named method instead, e.g. |
2342 // inheritedEquals(). | 2379 // inheritedEquals(). |
2343 bool operator==(const ComputedStyle& other) const; | 2380 bool operator==(const ComputedStyle& other) const; |
2344 bool operator!=(const ComputedStyle& other) const { | 2381 bool operator!=(const ComputedStyle& other) const { |
2345 return !(*this == other); | 2382 return !(*this == other); |
2346 } | 2383 } |
2347 | 2384 |
2348 bool inheritedEqual(const ComputedStyle&) const; | 2385 bool inheritedEqual(const ComputedStyle&) const; |
2349 bool nonInheritedEqual(const ComputedStyle&) const; | 2386 bool nonInheritedEqual(const ComputedStyle&) const; |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3804 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); | 3841 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); |
3805 } | 3842 } |
3806 | 3843 |
3807 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3844 inline bool ComputedStyle::hasPseudoElementStyle() const { |
3808 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3845 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
3809 } | 3846 } |
3810 | 3847 |
3811 } // namespace blink | 3848 } // namespace blink |
3812 | 3849 |
3813 #endif // ComputedStyle_h | 3850 #endif // ComputedStyle_h |
OLD | NEW |