Bug 144791 - Rename Length::isPercent() and Length::isPercentNotCalculated()
Summary: Rename Length::isPercent() and Length::isPercentNotCalculated()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sungmann Cho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-08 01:32 PDT by Sungmann Cho
Modified: 2015-05-10 17:54 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.55 KB, patch)
2015-05-08 01:57 PDT, Sungmann Cho
no flags Details | Formatted Diff | Diff
Patch (63.61 KB, patch)
2015-05-08 13:38 PDT, Sungmann Cho
no flags Details | Formatted Diff | Diff
Patch (65.92 KB, patch)
2015-05-08 13:58 PDT, Sungmann Cho
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sungmann Cho 2015-05-08 01:32:25 PDT
Fix the wrong condition check at the first line of SVGLengthContext::valueForLength().
Comment 1 Sungmann Cho 2015-05-08 01:57:24 PDT
We can replace "length.isPercent() && !length.isCalculated()" with "length.isPercentNotCalculated()" for simplicity and clarity.
Comment 2 Sungmann Cho 2015-05-08 01:57:44 PDT
Created attachment 252703 [details]
Patch
Comment 3 Said Abou-Hallawa 2015-05-08 09:59:17 PDT
Comment on attachment 252703 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=252703&action=review

> Source/WebCore/svg/SVGLengthContext.cpp:92
> +    if (length.isPercentNotCalculated())

It will be beneficial if we can rename:

Length::isPercentNotCalculated() => Length::isPercent()
Length::isPercent() => Length::isPercentOrCalculated()  // Or something similar

Then we can remove the following FIXME from Length.h

    bool isPercentNotCalculated() const; // FIXME: Rename to isPercent.

And the above condition will be simpler and clearer.
Comment 4 Sungmann Cho 2015-05-08 13:38:38 PDT
Created attachment 252744 [details]
Patch
Comment 5 Sungmann Cho 2015-05-08 13:39:58 PDT
Addressed Said Abou-Hallawa's comments.
Comment 6 Sungmann Cho 2015-05-08 13:58:25 PDT
Created attachment 252746 [details]
Patch
Comment 7 Darin Adler 2015-05-10 14:12:28 PDT
Comment on attachment 252746 [details]
Patch

It’s dangerous to do this all in one pass. If we missed any call site, the behavior will become wrong and the compiler won’t catch it for us.

The safe way to do this is to do the rename of isPercent to isPercentOrCalculated in a first patch, then do the rest in a second patch after we know all platforms compile.
Comment 8 WebKit Commit Bot 2015-05-10 14:44:52 PDT
Comment on attachment 252746 [details]
Patch

Clearing flags on attachment: 252746

Committed r184055: <http://trac.webkit.org/changeset/184055>
Comment 9 WebKit Commit Bot 2015-05-10 14:44:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Sungmann Cho 2015-05-10 17:54:05 PDT
@Darin Adler: Oops, but the patch has already been committed. Next time, I will be sure to follow your advice. Thank you for your thoughtful review.