[Webkit-unassigned] [Bug 187204] Split InlineTextBox::emphasisMarkExistsAndIsAbove() into two methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 29 16:40:38 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=187204

--- Comment #1 from David Kilzer (:ddkilzer) <ddkilzer at webkit.org> ---
After giving it a try, this makes the code much more readable:

-    bool emphasisMarkExistsAndIsAbove(const RenderStyle&, std::optional<bool>& isAbove) const;
+    bool emphasisMarkExists(const RenderStyle&) const;
+    bool emphasisMarkIsAbove(const RenderStyle&) const;

I also tried doing this:

-    bool emphasisMarkExistsAndIsAbove(const RenderStyle&) const;
+    std::optional<bool> emphasisMarkExistsAndIsAbove(const RenderStyle&) const;

However, naming the variable that was the result of that method was hard, and the code that called the method read pretty poorly.  It was also more difficult to reason about how the code in the original method should be broken up.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180629/625a0de9/attachment.html>


More information about the webkit-unassigned mailing list