RESOLVED FIXED 111974
Text flow broken in elements with vertical align top/bottom and inline elements taller than line-height
https://bugs.webkit.org/show_bug.cgi?id=111974
Summary Text flow broken in elements with vertical align top/bottom and inline elemen...
Miguel Ventura
Reported 2013-03-11 04:42:15 PDT
See example URL for demo: http://jsfiddle.net/gqL5D/ In an element with vertical-align top or bottom, if there's an element in the line that's taller than line-height, the text nodes will be vertically aligned differently from the inline elements. IE and Firefox render correctly whereas in Safari and Chrome the example given seems like a roller coaster.
Attachments
Patch (4.82 KB, patch)
2013-03-17 08:52 PDT, Robert Hogan
no flags
Patch (8.21 KB, patch)
2013-04-15 10:52 PDT, Robert Hogan
no flags
Patch (9.84 KB, patch)
2013-05-05 02:04 PDT, Robert Hogan
no flags
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 (856.76 KB, application/zip)
2013-05-05 03:56 PDT, Build Bot
no flags
Patch (10.22 KB, patch)
2013-05-05 03:59 PDT, Robert Hogan
no flags
Patch (10.14 KB, patch)
2013-05-09 15:03 PDT, Robert Hogan
rniwa: review+
Robert Hogan
Comment 1 2013-03-17 08:52:51 PDT
Build Bot
Comment 2 2013-03-17 10:26:13 PDT
Comment on attachment 193467 [details] Patch Attachment 193467 [details] did not pass mac-ews (mac): Output: http://webkit-commit-queue.appspot.com/results/17145512 New failing tests: editing/execCommand/query-command-state.html
WebKit Review Bot
Comment 3 2013-03-17 10:37:45 PDT
Comment on attachment 193467 [details] Patch Attachment 193467 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/17181507 New failing tests: editing/execCommand/query-command-state.html
Build Bot
Comment 4 2013-03-17 12:20:45 PDT
Comment on attachment 193467 [details] Patch Attachment 193467 [details] did not pass mac-ews (mac): Output: http://webkit-commit-queue.appspot.com/results/17222259 New failing tests: editing/execCommand/query-command-state.html
Build Bot
Comment 5 2013-03-17 19:03:31 PDT
Comment on attachment 193467 [details] Patch Attachment 193467 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-commit-queue.appspot.com/results/17174374 New failing tests: editing/execCommand/query-command-state.html
Robert Hogan
Comment 6 2013-04-15 10:52:39 PDT
Robert Hogan
Comment 7 2013-05-05 02:04:56 PDT
Build Bot
Comment 8 2013-05-05 03:56:20 PDT
Comment on attachment 200586 [details] Patch Attachment 200586 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/411032 New failing tests: tables/mozilla/bugs/bug14323.html
Build Bot
Comment 9 2013-05-05 03:56:22 PDT
Created attachment 200587 [details] Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-13 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.2
Robert Hogan
Comment 10 2013-05-05 03:59:04 PDT
Robert Hogan
Comment 11 2013-05-09 15:03:36 PDT
Glenn Adams
Comment 12 2013-05-09 15:56:28 PDT
Comment on attachment 201280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=201280&action=review > Source/WebCore/rendering/InlineFlowBox.cpp:486 > + return !(curr->isText() && !curr->parent()->isInline() && !curr->parent()->isTableCell()); Is this correct? i.e., what you have is the same as !curr->isText() || curr->parent()->isInline() || curr->parent()->isTableCell()
Robert Hogan
Comment 13 2013-05-10 10:46:17 PDT
(In reply to comment #12) > (From update of attachment 201280 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=201280&action=review > > > Source/WebCore/rendering/InlineFlowBox.cpp:486 > > + return !(curr->isText() && !curr->parent()->isInline() && !curr->parent()->isTableCell()); > > Is this correct? i.e., what you have is the same as !curr->isText() || curr->parent()->isInline() || curr->parent()->isTableCell() Well they're both correct - but yours is better. :)
Glenn Adams
Comment 14 2013-05-10 10:55:40 PDT
(In reply to comment #13) > (In reply to comment #12) > > (From update of attachment 201280 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=201280&action=review > > > > > Source/WebCore/rendering/InlineFlowBox.cpp:486 > > > + return !(curr->isText() && !curr->parent()->isInline() && !curr->parent()->isTableCell()); > > > > Is this correct? i.e., what you have is the same as !curr->isText() || curr->parent()->isInline() || curr->parent()->isTableCell() > > Well they're both correct - but yours is better. :) Yes, it's best to use De Morgan's laws to simplify, but I also wanted to check that when !curr->isText() is true that it's always something to which vertical position applies. For example, there is nothing stopping curr from being RenderBlock, yes?
Ryosuke Niwa
Comment 15 2013-05-10 11:03:08 PDT
Comment on attachment 201280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=201280&action=review > Source/WebCore/rendering/InlineFlowBox.cpp:485 > + // The vertical-align property only applies to inline elements and table cells. Instead of repeating the code, refer to http://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#line-height. Should we also check this condition in RenderStyle::diff (for optimization)?
Robert Hogan
Comment 16 2013-05-11 05:09:15 PDT
Glenn Adams
Comment 17 2013-05-11 09:52:27 PDT
(In reply to comment #14) > (In reply to comment #13) > > (In reply to comment #12) > > > (From update of attachment 201280 [details] [details] [details]) > > > View in context: https://bugs.webkit.org/attachment.cgi?id=201280&action=review > > > > > > > Source/WebCore/rendering/InlineFlowBox.cpp:486 > > > > + return !(curr->isText() && !curr->parent()->isInline() && !curr->parent()->isTableCell()); > > > > > > Is this correct? i.e., what you have is the same as !curr->isText() || curr->parent()->isInline() || curr->parent()->isTableCell() > > > > Well they're both correct - but yours is better. :) > > Yes, it's best to use De Morgan's laws to simplify, but I also wanted to check that when !curr->isText() is true that it's always something to which vertical position applies. > > For example, there is nothing stopping curr from being RenderBlock, yes? It would have been nice if you'd simplified the logic and added an assert on curr being an inline renderer before committing.
Robert Hogan
Comment 18 2013-05-11 12:32:02 PDT
(In reply to comment #17) > (In reply to comment #14) > > (In reply to comment #13) > > > (In reply to comment #12) > > > > (From update of attachment 201280 [details] [details] [details] [details]) > > > > View in context: https://bugs.webkit.org/attachment.cgi?id=201280&action=review > > > > > > > > > Source/WebCore/rendering/InlineFlowBox.cpp:486 > > > > > + return !(curr->isText() && !curr->parent()->isInline() && !curr->parent()->isTableCell()); > > > > > > > > Is this correct? i.e., what you have is the same as !curr->isText() || curr->parent()->isInline() || curr->parent()->isTableCell() > > > > > > Well they're both correct - but yours is better. :) > > > > Yes, it's best to use De Morgan's laws to simplify, but I also wanted to check that when !curr->isText() is true that it's always something to which vertical position applies. > > > > For example, there is nothing stopping curr from being RenderBlock, yes? > > It would have been nice if you'd simplified the logic and added an assert on curr being an inline renderer before committing. I implemented your suggestion before landing!
Robert Hogan
Comment 19 2013-05-11 12:33:11 PDT
(In reply to comment #14) > (In reply to comment #13) > > (In reply to comment #12) > > > (From update of attachment 201280 [details] [details] [details]) > > > View in context: https://bugs.webkit.org/attachment.cgi?id=201280&action=review > > > > > > > Source/WebCore/rendering/InlineFlowBox.cpp:486 > > > > + return !(curr->isText() && !curr->parent()->isInline() && !curr->parent()->isTableCell()); > > > > > > Is this correct? i.e., what you have is the same as !curr->isText() || curr->parent()->isInline() || curr->parent()->isTableCell() > > > > Well they're both correct - but yours is better. :) > > Yes, it's best to use De Morgan's laws to simplify, but I also wanted to check that when !curr->isText() is true that it's always something to which vertical position applies. > > For example, there is nothing stopping curr from being RenderBlock, yes? Correct but it will be an inline block so that's alright.
Glenn Adams
Comment 20 2013-05-11 13:50:42 PDT
(In reply to comment #19) > (In reply to comment #14) > > (In reply to comment #13) > > > (In reply to comment #12) > > > > (From update of attachment 201280 [details] [details] [details] [details]) > > > > View in context: https://bugs.webkit.org/attachment.cgi?id=201280&action=review > > > > > > > > > Source/WebCore/rendering/InlineFlowBox.cpp:486 > > > > > + return !(curr->isText() && !curr->parent()->isInline() && !curr->parent()->isTableCell()); > > > > > > > > Is this correct? i.e., what you have is the same as !curr->isText() || curr->parent()->isInline() || curr->parent()->isTableCell() > > > > > > Well they're both correct - but yours is better. :) > > > > Yes, it's best to use De Morgan's laws to simplify, but I also wanted to check that when !curr->isText() is true that it's always something to which vertical position applies. > > > > For example, there is nothing stopping curr from being RenderBlock, yes? > > Correct but it will be an inline block so that's alright. In that case, an assert would have been useful, since it in fact assumes that. Thanks for implementing the simplification. I looked at the last patch, which didn't have it. It would be useful for you to use land-safely if you make a change so that at least the final form of the commit is uploaded as a patch to the bug.
Note You need to log in before you can comment on or make changes to this bug.