RESOLVED FIXED Bug 45020
Support "block-flow" and "writing-mode": interpret properties into RenderStyle
https://bugs.webkit.org/show_bug.cgi?id=45020
Summary Support "block-flow" and "writing-mode": interpret properties into RenderStyle
Takumi Takano
Reported 2010-09-01 00:07:33 PDT
This is a subtask bug of <https://bugs.webkit.org/show_bug.cgi?id=45019>. As the first step, add code that interprets "block-flow" property and "writing-mode" property settings into a RenderStyle object.
Attachments
Proposed patch file (9.08 KB, patch)
2010-09-01 00:28 PDT, Takumi Takano
hyatt: review-
Modified patch. Incorporated feedback from Adele and Dave. (10.35 KB, patch)
2010-09-05 21:17 PDT, Takumi Takano
hyatt: review-
Another modified patch (16.07 KB, patch)
2010-09-08 04:44 PDT, Takumi Takano
hyatt: review-
New patch file: incorporated Dave's feedback on computed style tests (19.05 KB, patch)
2010-09-15 02:24 PDT, Takumi Takano
hyatt: review+
hyatt: commit-queue+
Patch to fix the above SVG test regression (2.23 KB, patch)
2010-09-16 21:43 PDT, Takumi Takano
no flags
Takumi Takano
Comment 1 2010-09-01 00:28:57 PDT
Created attachment 66174 [details] Proposed patch file
WebKit Review Bot
Comment 2 2010-09-01 00:31:32 PDT
Attachment 66174 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebCore/rendering/style/RenderStyle.h:181: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] WebCore/rendering/style/RenderStyle.h:210: _block_flow is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Adele Peterson
Comment 3 2010-09-02 10:34:07 PDT
Comment on attachment 66174 [details] Proposed patch file Its not clear to me whether the style warnings are important here. I guess _block_flow should be _blockFlow, but the other warning goes against the existing style here, so I think we should leave it as is. This generally seems ok to me, but I'd like Dan or Hyatt to give it the once-over.
Dave Hyatt
Comment 4 2010-09-02 12:16:24 PDT
Comment on attachment 66174 [details] Proposed patch file This patch is missing the "bt" value for the block-flow property. I only see "tb", "rl" and "lr". I'd prefer descriptive names for the block flow direction rather than the abbreviations. Instead of BFLR, BFLR, BFTB, I'd prefer: LeftToRightBlockFlow, RightToLeftBlockFlow, TopToBottomBlockFlow, BottomToTopBlockFlow I would go ahead and add computed style support (see CSSComputedStyleDeclaration) for the new properties to this patch, since that will enable you to have actual tests that verify that the values are being parsed and inherited correctly.
Takumi Takano
Comment 5 2010-09-05 21:17:56 PDT
Created attachment 66604 [details] Modified patch. Incorporated feedback from Adele and Dave.
WebKit Review Bot
Comment 6 2010-09-05 21:20:29 PDT
Attachment 66604 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebCore/rendering/style/RenderStyle.h:181: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] WebCore/rendering/style/RenderStyle.h:210: _blockFlow is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 2 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Ryosuke Niwa
Comment 7 2010-09-06 12:29:05 PDT
(In reply to comment #5) > Created an attachment (id=66604) [details] > Modified patch. Incorporated feedback from Adele and Dave. It seems like this patch doesn't have any tests. Is that because this doesn't implement the feature but just adds support to the parser? As hyatt suggested, I think you can still test the parser by calling set property value and getting computed style back. Also, why are we only supporting -webkit-writing-mode and not writing-mode? Is that a standard procedure when we add a support for new feature?
Adele Peterson
Comment 8 2010-09-07 09:50:20 PDT
Its standard procedure if a property is in a draft specification and is likely to change in the future. (In reply to comment #7) > (In reply to comment #5) > > Created an attachment (id=66604) [details] [details] > > Modified patch. Incorporated feedback from Adele and Dave. > > It seems like this patch doesn't have any tests. Is that because this doesn't implement the feature but just adds support to the parser? As hyatt suggested, I think you can still test the parser by calling set property value and getting computed style back. Also, why are we only supporting -webkit-writing-mode and not writing-mode? Is that a standard procedure when we add a support for new feature?
Dave Hyatt
Comment 9 2010-09-07 10:11:05 PDT
Comment on attachment 66604 [details] Modified patch. Incorporated feedback from Adele and Dave. (1) You need to move all of the value keywords for writing-mode and block-flow out of SVGCSSValueKeywords.in, so that your code will compile even when ENABLE(SVG) is false. I'm not sure what some of them are doing in that file anyway. Just move them all over to the main CSS keywords file. (2) You need to patch the RenderStyle::diff() method to make sure changes in block-flow trigger a layout. (3) I'd still like to see computed style support added (CSSComputedStyleDeclaration.cpp). (4) Once you add computed style support in (3), you can add some layout tests to this patch as well. I'd suggest fast/text/vertical as a good place for new tests.
Adele Peterson
Comment 10 2010-09-07 10:13:20 PDT
You can read some general info about creating tests here: http://webkit.org/quality/testwriting.html
Takumi Takano
Comment 11 2010-09-08 04:44:32 PDT
Created attachment 66881 [details] Another modified patch Incorporated Dave's feedback. Added a test to check if the parser correctly write/retrieve block-flow values to/from RenderStyle object.
WebKit Review Bot
Comment 12 2010-09-08 04:47:08 PDT
Attachment 66881 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebCore/rendering/style/RenderStyle.h:181: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] WebCore/rendering/style/RenderStyle.h:210: _blockFlow is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 2 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dave Hyatt
Comment 13 2010-09-13 14:25:19 PDT
Comment on attachment 66881 [details] Another modified patch r=me
Dave Hyatt
Comment 14 2010-09-13 14:26:22 PDT
Keep in mind that all the computed style tests will start failing when you land this, so you'll need to fix those as well. There are 3-4 of them, and they'll be really obvious if you just run-webkit-tests before landing.
Dave Hyatt
Comment 15 2010-09-13 14:51:15 PDT
Comment on attachment 66881 [details] Another modified patch Changing this to a minus, since the patch needs the revised results for the various computed style tests before it can be landed via commit-queue.
Takumi Takano
Comment 16 2010-09-15 02:24:00 PDT
Created attachment 67659 [details] New patch file: incorporated Dave's feedback on computed style tests Incorporated Dave's feedback on computed style tests. I revised expected result files at the top level of LayoutTests directory but haven't changed results in each platform. Is this okay?
WebKit Review Bot
Comment 17 2010-09-15 02:29:39 PDT
Attachment 67659 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebCore/rendering/style/RenderStyle.h:181: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] WebCore/rendering/style/RenderStyle.h:210: _blockFlow is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 2 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Kent Tamura
Comment 18 2010-09-15 02:31:13 PDT
(In reply to comment #16) > I revised expected result files at the top level of LayoutTests directory but haven't changed results in each platform. Is this okay? It should be ok. These test results are platform-neutral. > Index: LayoutTests/fast/text/international/block-flow-parser-test.html > =================================================================== > --- LayoutTests/fast/text/international/block-flow-parser-test.html (revision 0) > +++ LayoutTests/fast/text/international/block-flow-parser-test.html (revision 0) > @@ -0,0 +1,39 @@ > +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > +"http://www.w3.org/TR/html4/loose.dtd"> > +<html> > +<head> > +<title>block-flow parser test</title> > +<script> > +function print(message) > +{ > + var paragraph = document.createElement("li"); > + paragraph.appendChild(document.createTextNode(message)); > + document.getElementById("console").appendChild(paragraph); > +} We have a lot of helper functions in LayoutTests/fast/js/resources/js-test-pre.js. You may use it in this test.
Dave Hyatt
Comment 19 2010-09-16 13:32:26 PDT
Comment on attachment 67659 [details] New patch file: incorporated Dave's feedback on computed style tests r=me
Dave Hyatt
Comment 20 2010-09-16 14:37:28 PDT
Landed in r67667.
WebKit Review Bot
Comment 21 2010-09-16 15:47:08 PDT
http://trac.webkit.org/changeset/67667 might have broken SnowLeopard Intel Release (Tests)
Eric Seidel (no email)
Comment 22 2010-09-16 17:10:41 PDT
Takumi Takano
Comment 23 2010-09-16 19:17:03 PDT
Oops, this is a side effect of moving svg writing-mode values to standard css value definition. Working on... (In reply to comment #22) > This resulted in a bunch of layout test failures: > > http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r67673%20(17683)/results.html
Takumi Takano
Comment 24 2010-09-16 21:43:21 PDT
Created attachment 67881 [details] Patch to fix the above SVG test regression
Kent Tamura
Comment 25 2010-09-16 23:08:52 PDT
Comment on attachment 67881 [details] Patch to fix the above SVG test regression The patch looks good. I'll confirm the patch fixes the tests and commit it.
Kent Tamura
Comment 26 2010-09-16 23:23:14 PDT
Comment on attachment 67881 [details] Patch to fix the above SVG test regression Landed as r67695.
John Gregg
Comment 27 2010-09-17 09:42:49 PDT
*** Bug 45947 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.