Hi all,

 


I am trying to implement https://bugs.webkit.org/show_bug.cgi?id=92801
"[css3-text] Add support for -webkit-text-decoration-skip" and have some doubts
about the best way to do it for all parsed values for
-webkit-text-decoration-skip (objects, spaces, ink) [1]

The attached patch implements "text-decoration-skip: objects". Now I am trying
to implement "text-decoration-skip: spaces". That one seems tricky since I need
to identify all white spaces in a phrase, skip the decoration for all white
spaces but keep it for the words (and other objects). I was reading [2] and one
though I could enclose all white spaces in a block (or inline) and then use what
I did for "decoration-skip: objects", but that seems like a lot of overhead to
render the text. Anybody have a better suggestion about how to implement it? 




[1] http://www.w3.org/TR/css3-text/#text-decoration-skip0
[2] https://www.webkit.org/blog/115/webcore-rendering-ii-blocks-and-inlines/
Cheers,

Lamarque V. Souza
diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp
index 03d12d2..ed4bbf9 100644
--- a/Source/WebCore/css/StyleResolver.cpp
+++ b/Source/WebCore/css/StyleResolver.cpp
@@ -1845,9 +1845,15 @@ static EDisplay equivalentBlockDisplay(EDisplay display, bool isFloating, bool s
 // and absolute or relatively positioned elements.
 static bool doesNotInheritTextDecoration(RenderStyle* style, Element* e)
 {
+    // Lamarque 31/10/2012: use this as basis for text-decoration-skip
     return style->display() == TABLE || style->display() == INLINE_TABLE || style->display() == RUN_IN
         || style->display() == INLINE_BLOCK || style->display() == INLINE_BOX || isAtShadowBoundary(e)
-        || style->isFloating() || style->hasOutOfFlowPosition();
+        || style->isFloating() || style->hasOutOfFlowPosition()
+#if ENABLE(CSS3_TEXT)
+        || (style->textDecorationSkip() == TextDecorationSkipObjects
+		    && (style->display() == INLINE || style->display() == INLINE_FLEX || style->display() == INLINE_GRID));
+#endif // CSS3_TEXT
+        ;
 }
 
 static bool isDisplayFlexibleBox(EDisplay display)
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to