RESOLVED FIXED 87328
Move allowRoundingHacks to Internals interface
https://bugs.webkit.org/show_bug.cgi?id=87328
Summary Move allowRoundingHacks to Internals interface
Gyuyoung Kim
Reported 2012-05-23 18:15:09 PDT
Adjust allowRoundingHacks() tests into use Internals instead of LayoutTestController interface. In my humble opinion, allowRoundingHacks() is able to be supported by Internals because it looks this function is implemented by WebCore layer, not WebKit layer. It seems allowRoundingHacks() is just to turn TextRun::s_allowsRoundingHacks variable on. If reviewers think this moving is not able to be moved to Internals, I'm willing to close this bug.
Attachments
Patch (16.66 KB, patch)
2012-05-23 18:18 PDT, Gyuyoung Kim
no flags
Patch (17.71 KB, patch)
2012-05-23 20:22 PDT, Gyuyoung Kim
no flags
Patch (15.62 KB, patch)
2012-05-23 21:15 PDT, Gyuyoung Kim
no flags
Patch (17.14 KB, patch)
2012-05-27 22:14 PDT, Gyuyoung Kim
no flags
Patch (16.48 KB, patch)
2012-05-27 22:25 PDT, Gyuyoung Kim
no flags
Gyuyoung Kim
Comment 1 2012-05-23 18:18:54 PDT
Gyuyoung Kim
Comment 2 2012-05-23 18:20:09 PDT
CC'ing Alexey, could you take a look this patch when you have time ?
Build Bot
Comment 3 2012-05-23 19:15:02 PDT
Gyuyoung Kim
Comment 4 2012-05-23 20:22:46 PDT
mitz
Comment 5 2012-05-23 20:32:45 PDT
Comment on attachment 143715 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143715&action=review > Source/WebKit/mac/WebView/WebViewPrivate.h:-347 > -+ (void)_setAllowsRoundingHacks:(BOOL)allowsRoundingHacks; > -+ (BOOL)_allowsRoundingHacks; Do not remove this WebKit API.
Gyuyoung Kim
Comment 6 2012-05-23 21:15:42 PDT
Gyuyoung Kim
Comment 7 2012-05-23 21:16:48 PDT
(In reply to comment #5) > (From update of attachment 143715 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=143715&action=review > > > Source/WebKit/mac/WebView/WebViewPrivate.h:-347 > > -+ (void)_setAllowsRoundingHacks:(BOOL)allowsRoundingHacks; > > -+ (BOOL)_allowsRoundingHacks; > > Do not remove this WebKit API. Ok, I restore WebKit API for mac.
Eric Seidel (no email)
Comment 8 2012-05-24 09:05:40 PDT
Comment on attachment 143723 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143723&action=review > Source/WebCore/testing/Internals.cpp:1057 > +void Internals::allowRoundingHacks() const > +{ > + TextRun::setAllowsRoundingHacks(true); > +} How does this get reset between test runs?
Gyuyoung Kim
Comment 9 2012-05-25 00:02:25 PDT
Comment on attachment 143723 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=143723&action=review >> Source/WebCore/testing/Internals.cpp:1057 >> +} > > How does this get reset between test runs? Currently, this LTC function is implemented by Mac. As you can see in LayoutTestControllerMac.mm, LayoutTestController::allowRoundingHacks() just sets true. void LayoutTestController::allowRoundingHacks() { [WebView _setAllowsRoundingHacks:YES]; } It looks there is no reset function in LTC now. This patch is just to move from LTC function to Internals. Do you think I need to modify it together with this patch ?
Eric Seidel (no email)
Comment 10 2012-05-25 18:27:25 PDT
Yes, but it's reset between tests in DRT: http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm#L1271 I believe Internals has a similar concept, w/o doing such, we'll end up bleeding this setting between tests.
Gyuyoung Kim
Comment 11 2012-05-25 18:49:53 PDT
(In reply to comment #10) > Yes, but it's reset between tests in DRT: > http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm#L1271 > > I believe Internals has a similar concept, w/o doing such, we'll end up bleeding this setting between tests. Ok, I will check if Internals has similar concept to reset settings. If internals has similar one, I think we can move more LTC functions to Internals.
Gyuyoung Kim
Comment 12 2012-05-27 22:14:43 PDT
Gyuyoung Kim
Comment 13 2012-05-27 22:25:55 PDT
Gyuyoung Kim
Comment 14 2012-05-27 22:29:29 PDT
I add a function to Internals in order to reset default consistent values like each port's LTC. I think Internals also needs to have reset function.
Hajime Morrita
Comment 15 2012-05-27 23:13:31 PDT
Comment on attachment 144268 [details] Patch I'm wondering a bit if this need to be cross platform since the tests are under platform/mac. But it's fine to have this on Internals even if so.
Gyuyoung Kim
Comment 16 2012-05-27 23:24:36 PDT
(In reply to comment #15) > (From update of attachment 144268 [details]) > I'm wondering a bit if this need to be cross platform since the tests are under platform/mac. I expect other ports will support allowRoundingHacks() testing in future. So, in my humble opinion, to move allowRoundingHacks() to Internals is valid. In addition, Internals also needs to have reset functions for other test cases. Thank you for your review.
WebKit Review Bot
Comment 17 2012-05-28 02:06:09 PDT
Comment on attachment 144268 [details] Patch Clearing flags on attachment: 144268 Committed r118657: <http://trac.webkit.org/changeset/118657>
WebKit Review Bot
Comment 18 2012-05-28 02:06:16 PDT
All reviewed patches have been landed. Closing bug.
Simon Fraser (smfr)
Comment 19 2012-10-08 13:34:53 PDT
allowRoundingHacks() is a terrible name for a method on internals, because: 1. It's not clear if it's querying state (areRoundingHacksAllowed()) or setting state (setRoundingHacksAllowed()). If the latter, why doesn't it take a bool? 2. I've no idea what rounding hacks are. The name should be more specific.
Gyuyoung Kim
Comment 20 2012-10-08 21:25:35 PDT
(In reply to comment #19) > allowRoundingHacks() is a terrible name for a method on internals, because: > 1. It's not clear if it's querying state (areRoundingHacksAllowed()) or setting state (setRoundingHacksAllowed()). If the latter, why doesn't it take a bool? > 2. I've no idea what rounding hacks are. The name should be more specific. Simon, your comment looks reasonable. How about changing allowRoundingHacks() with setAllowRoundingHacks(bool) ?
Jessie Berlin
Comment 21 2013-04-17 14:45:40 PDT
*** Bug 63477 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.