RESOLVED WONTFIX 50398
Android would like to disable rounding hacks for TextRuns in text controls
https://bugs.webkit.org/show_bug.cgi?id=50398
Summary Android would like to disable rounding hacks for TextRuns in text controls
scroggo
Reported 2010-12-02 10:19:00 PST
Created attachment 75390 [details] git diff of the changes I'd like to make. Android would like to disable rounding hacks for TextRuns in text controls
Attachments
git diff of the changes I'd like to make. (8.17 KB, patch)
2010-12-02 10:19 PST, scroggo
no flags
A patch using svn diff (8.59 KB, patch)
2010-12-02 10:30 PST, scroggo
no flags
Disable rounding hacks for TextControls (7.74 KB, patch)
2010-12-02 12:08 PST, scroggo
steveblock: review-
ChangeLog (3.00 KB, text/plain)
2010-12-06 10:23 PST, scroggo
steveblock: review-
new patch taking previous advice into consideration (12.21 KB, patch)
2010-12-07 11:17 PST, scroggo
no flags
patch (12.62 KB, patch)
2010-12-08 10:26 PST, scroggo
no flags
patch (12.62 KB, patch)
2010-12-09 14:17 PST, scroggo
no flags
patch updated to tip of tree (5.43 KB, text/plain)
2010-12-10 11:34 PST, scroggo
no flags
patch updated to tip of tree (5.43 KB, patch)
2010-12-10 11:35 PST, scroggo
steveblock: review-
patch (12.60 KB, patch)
2010-12-13 06:35 PST, scroggo
hyatt: review-
scroggo
Comment 1 2010-12-02 10:30:57 PST
Created attachment 75391 [details] A patch using svn diff
scroggo
Comment 2 2010-12-02 12:08:36 PST
Created attachment 75401 [details] Disable rounding hacks for TextControls
scroggo
Comment 3 2010-12-06 10:23:39 PST
Created attachment 75710 [details] ChangeLog
WebKit Review Bot
Comment 4 2010-12-06 10:28:58 PST
Attachment 75710 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files']" exit_code: 1 Total errors found: 0 in 0 files If any of these errors are false positives, please file a bug against check-webkit-style.
Steve Block
Comment 5 2010-12-07 02:59:05 PST
Comment on attachment 75401 [details] Disable rounding hacks for TextControls View in context: https://bugs.webkit.org/attachment.cgi?id=75401&action=review I saw that you uploaded a ChangeLog entry separately. You'll have to merge it with the patch to allow this to be landed via the commit queue. Also, you need to update the ChangeLog tests line with how this is tested, or why it can't be tested. > WebCore/rendering/InlineTextBox.cpp:46 > +#ifdef DISABLE_ROUNDING_HACKS Looking at StringTruncator, which also uses TextRun::disableRoundingHacks(), the behaviour is triggered with a method argument with a default value. Is there a reason why we can't use the same approach here, to avoid ifdefs? Is it a lot of work to plumb such an argument through from WebKit? I've CC'ed hyatt and aroben who seemed to have worked on this code. If we do use an ifdef, I think it should probably be a WTF USE macro. > WebCore/rendering/InlineTextBox.cpp:47 > +static void disableRoundingForTextControls(const InlineTextBox* box, TextRun& tr) Use complete words for variable names
scroggo
Comment 6 2010-12-07 11:17:54 PST
Created attachment 75830 [details] new patch taking previous advice into consideration Although the changes look fine to me, and build in my normal environment, running build-webkit fails, but I don't understand the output: Checking Dependencies... ** BUILD FAILED ** The following build commands failed: JavaScriptCore: Ld /WebKitForPatches/WebKitBuild/Release/JavaScriptCore.framework/Versions/A/JavaScriptCore normal i386 jsc: Ld /WebKitForPatches/WebKitBuild/Release/jsc normal i386 testapi: Ld /WebKitForPatches/WebKitBuild/Release/testapi normal i386 (3 failures)
scroggo
Comment 7 2010-12-08 10:26:59 PST
Early Warning System Bot
Comment 8 2010-12-08 13:31:12 PST
scroggo
Comment 9 2010-12-09 14:17:44 PST
Steve Block
Comment 10 2010-12-10 04:08:59 PST
Comment on attachment 76121 [details] patch This looks reasonable to me. Would be good to get a review from aroben or hyatt before submitting. Also, it looks like you need to rebase your patch so the try-bots can process it.
Adam Roben (:aroben)
Comment 11 2010-12-10 08:10:27 PST
I don't know enough about this code to know whether this is the right approach. Hyatt should probably comment.
scroggo
Comment 12 2010-12-10 11:34:25 PST
Created attachment 76226 [details] patch updated to tip of tree
scroggo
Comment 13 2010-12-10 11:35:12 PST
Created attachment 76227 [details] patch updated to tip of tree
Steve Block
Comment 14 2010-12-13 04:14:57 PST
Comment on attachment 76227 [details] patch updated to tip of tree Missing InlineTextBox.cpp
scroggo
Comment 15 2010-12-13 06:35:00 PST
Steve Block
Comment 16 2010-12-14 06:15:05 PST
Comment on attachment 76380 [details] patch LGTM, hyatt can you take a look?
Dave Hyatt
Comment 17 2010-12-14 13:51:28 PST
Comment on attachment 76380 [details] patch I really don't think of this as a RenderTheme setting. I just think it's a Setting. That way it will be simple and non-virtual too. It's not ok to add a member to InlineTextBoxes for this either. That's too much of a memory hit. There's gotta be a way to avoid patching all of the text functions like that too.
Dave Hyatt
Comment 18 2010-12-14 13:59:10 PST
I don't really get how you can disable rounding hacks without everything breaking. Are you ok with mismatches in rendering when inlines like <spans> are used? I just want to make sure you're aware of what breaks if you do this.
scroggo
Comment 19 2010-12-14 15:54:20 PST
I just want to disable the rounding hacks for text controls. This is because we overlay a text input view from our view system, and I want it to line up with the text on the web page. The text doesn't line up after spaces though, due to the rounding hacks.
Dave Hyatt
Comment 20 2011-01-03 15:16:25 PST
I think the best way to accomplish this is to actually add a new CSS property for it.... probably something like -webkit-text-rounding: auto | integral | subpixel. Then you can set that in your Android UA sheet for text controls. The WebCore code can then be patched to just respect the CSS property. Not sure if others agree with this approach, but that's probably how I would do it. The CSS property support could even just be ifdefed out for platforms that don't care (similar to the Dashboard region CSS property).
mitz
Comment 21 2011-01-03 16:00:18 PST
I am not sure I agree with introducing a CSS property that inevitably results in rendering errors, but I guess it’s fine if ports that don’t want the broken behavior can disable it.
scroggo
Comment 22 2011-01-04 12:32:55 PST
(In reply to comment #20) > I think the best way to accomplish this is to actually add a new CSS property for it.... probably something like -webkit-text-rounding: auto | integral | subpixel. Then you can set that in your Android UA sheet for text controls. > > The WebCore code can then be patched to just respect the CSS property. > > Not sure if others agree with this approach, but that's probably how I would do it. The CSS property support could even just be ifdefed out for platforms that don't care (similar to the Dashboard region CSS property). Thanks for the advice, Dave. (In reply to comment #21) > I am not sure I agree with introducing a CSS property that inevitably results in rendering errors, but I guess it’s fine if ports that don’t want the broken behavior can disable it. What "rendering errors" will I run into? I know there will be errors when text changes styles, for links etc, but I am only trying to remove the rounding hacks inside text controls (<input> and <textarea>), where there won't be any links. Am I missing something? Thanks,
mitz
Comment 23 2011-01-05 16:18:33 PST
(In reply to comment #22) > (In reply to comment #21) > > I am not sure I agree with introducing a CSS property that inevitably results in rendering errors, but I guess it’s fine if ports that don’t want the broken behavior can disable it. > > What "rendering errors" will I run into? I know there will be errors when text changes styles, for links etc, Anywhere you end up with more than one text box on the line. In addition to the above, this includes bidirectional text and collapsed whitespace. > but I am only trying to remove the rounding hacks inside text controls (<input> and <textarea>), where there won't be any links. Am I missing something? So the CSS property could only apply to those elements?
scroggo
Comment 24 2011-01-06 09:56:20 PST
(In reply to comment #23) > So the CSS property could only apply to those elements? I am not sure how to do that using a CSS property, but yes, my goal is to only do this for <input> and <textarea>
Dave Hyatt
Comment 25 2011-02-10 14:12:08 PST
See https://bugs.webkit.org/show_bug.cgi?id=54244 Rounding hacks will be dying soon, so can probably just close this bug or dup it to that.
Eric Seidel (no email)
Comment 26 2012-02-13 14:45:26 PST
Android Chromium is the new future.
Note You need to log in before you can comment on or make changes to this bug.