WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
93809
[CSS Regions] Setting region-break-after: always on a <br> element does not cause a region break
https://bugs.webkit.org/show_bug.cgi?id=93809
Summary
[CSS Regions] Setting region-break-after: always on a <br> element does not c...
Mihai Balan
Reported
2012-08-13 02:22:48 PDT
Setting region-break-before (or region-break-after) to always on a <br> element does not cause a break, no matter the value used for the display property.
Attachments
Ref test highlighting the problem
(1.61 KB, application/x-zip-compressed)
2012-08-13 02:26 PDT
,
Mihai Balan
no flags
Details
Example test fixing the issue adding an empty content
(829 bytes, text/html)
2013-06-26 15:39 PDT
,
Manuel Rego Casasnovas
no flags
Details
Patch
(3.28 KB, patch)
2013-07-09 09:35 PDT
,
Manuel Rego Casasnovas
beidson
: review-
buildbot
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion
(561.79 KB, application/zip)
2013-07-09 15:19 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion
(551.52 KB, application/zip)
2013-07-09 16:15 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2
(493.64 KB, application/zip)
2013-07-12 12:41 PDT
,
Build Bot
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Mihai Balan
Comment 1
2012-08-13 02:26:58 PDT
Created
attachment 157946
[details]
Ref test highlighting the problem
Mihai Balan
Comment 2
2012-08-20 10:24:29 PDT
As per the fragmentation spec and further discussions on www-style and IRC/whatwg, the code here should actually create a break.
Manuel Rego Casasnovas
Comment 3
2013-06-12 02:01:34 PDT
BTW, I've started to take a look to this issue. I've tested it changing <br> by <span> and it works properly. For the moment, I've been debugging the code and what I get is that the RenderBlock corresponding to the paragraph has no children while in the case of <span> it has children. I'll look deeper trying to understand why this RenderBlock is created without any children.
Manuel Rego Casasnovas
Comment 4
2013-06-13 14:20:33 PDT
(In reply to
comment #3
)
> For the moment, I've been debugging the code and what I get is that the RenderBlock corresponding to the paragraph has no children while in the case of <span> it has children. I'll look deeper trying to understand why this RenderBlock is created without any children.
I was wrong in my assumption, checking the code that creates the RenderObjects it actually creates the paragraph and its children. Them problem is that for the paragraph childrenInline() is TRUE (in the case of <br> and FALSE in the case of <span>) this causes that RenderBlock::layoutBlockChildren() is not called. You can see the if in RenderBlock::layoutBlock(): if (childrenInline()) layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogicalBottom); else layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom); The next step will be to understand why childrenInline() is TRUE in this situation.
Michelangelo De Simone
Comment 5
2013-06-13 20:28:23 PDT
Still repros on today's nightly (
r151543
)
Mihai Maerean
Comment 6
2013-06-14 02:15:24 PDT
Before anything else, fragmentation css style ([region|page|columns]-break) properties need to have bits that propagate to the containers to indicate the break situation between blocks.
Manuel Rego Casasnovas
Comment 7
2013-06-19 16:10:44 PDT
(In reply to
comment #4
)
> Them problem is that for the paragraph childrenInline() is TRUE (in the case of <br> and FALSE in the case of <span>) this causes that RenderBlock::layoutBlockChildren() is not called. You can see the if in RenderBlock::layoutBlock(): > > if (childrenInline()) > layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogicalBottom); > else > layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom); > > The next step will be to understand why childrenInline() is TRUE in this situation.
childrenInline() is TRUE for <br> and FALSE for <span> because in the case of <span> RenderObject::isInline() returns FALSE, which causes that RenderBlock::makeChildrenNonInline() is called inside RenderBlock::addChildIgnoringAnonymousColumnBlocks(). However, <br> RenderObject::isInline() returns TRUE. So all the children of <p> (the text nodes and the <br> nodes) have RenderObject::isInline() TRUE, so it's normal than childrenInline() is TRUE. Maybe in this case <br> elements with a region break should be marked as non-inline or something like that.
Manuel Rego Casasnovas
Comment 8
2013-06-26 15:39:14 PDT
Created
attachment 205530
[details]
Example test fixing the issue adding an empty content (In reply to
comment #7
)
> childrenInline() is TRUE for <br> and FALSE for <span> because in the case of <span> RenderObject::isInline() returns FALSE, which causes that RenderBlock::makeChildrenNonInline() is called inside RenderBlock::addChildIgnoringAnonymousColumnBlocks(). However, <br> RenderObject::isInline() returns TRUE.
Actually the reason why isInline() returns FALSE for <span> elements is because of they have "display:block", if you remove that line then the breaks don't work either with <span> tags. It seems that the breaks only work for blocks and not for inline elements.
> Maybe in this case <br> elements with a region break should be marked as non-inline or something like that.
On the other hand in order to fix the issue with <br> elements is enough with adding "content: "";" in the CSS (as in the attached example). Because of before/after pseudo-elements are not applied if they don't have content. This is not needed for <span> elements because of they always have a content (at least an empty string).
Mihnea Ovidenie
Comment 9
2013-07-08 02:42:50 PDT
(In reply to
comment #8
)
> Created an attachment (id=205530) [details] > Example test fixing the issue adding an empty content > > (In reply to
comment #7
) > > childrenInline() is TRUE for <br> and FALSE for <span> because in the case of <span> RenderObject::isInline() returns FALSE, which causes that RenderBlock::makeChildrenNonInline() is called inside RenderBlock::addChildIgnoringAnonymousColumnBlocks(). However, <br> RenderObject::isInline() returns TRUE. > > Actually the reason why isInline() returns FALSE for <span> elements is because of they have "display:block", if you remove that line then the breaks don't work either with <span> tags. > > It seems that the breaks only work for blocks and not for inline elements. >
Yes, this is the definition of forced breaks:
http://www.w3.org/TR/2012/WD-css3-break-20120823/#break-properties
> > Maybe in this case <br> elements with a region break should be marked as non-inline or something like that. > > On the other hand in order to fix the issue with <br> elements is enough with adding "content: "";" in the CSS (as in the attached example). Because of before/after pseudo-elements are not applied if they don't have content. This is not needed for <span> elements because of they always have a content (at least an empty string).
I am confused about your mention of pseudo-elements. I see the fix with the content but i would rather see what it takes to fix it in the code. Probably such a fix would also fix for multicolumn element in this case.
Manuel Rego Casasnovas
Comment 10
2013-07-09 09:30:05 PDT
(In reply to
comment #9
)
> (In reply to
comment #8
) > > It seems that the breaks only work for blocks and not for inline elements. > > > > Yes, this is the definition of forced breaks:
http://www.w3.org/TR/2012/WD-css3-break-20120823/#break-properties
Ok, thanks for the link.
> > On the other hand in order to fix the issue with <br> elements is enough with adding "content: "";" in the CSS (as in the attached example). Because of before/after pseudo-elements are not applied if they don't have content. This is not needed for <span> elements because of they always have a content (at least an empty string). > > I am confused about your mention of pseudo-elements. I see the fix with the content but i would rather see what it takes to fix it in the code. Probably such a fix would also fix for multicolumn element in this case.
Sorry for the comment about the pseudo-elements I read some information somewhere but I messed it up in my head. Anyway, I've been taking a look to the code related with content, and why the <br> is considered a block when content is added. The reason is in the following method where style->hasContent() is checked: RenderObject* HTMLBRElement::createRenderer(RenderArena* arena, RenderStyle* style) { if (style->hasContent()) return RenderObject::createObject(this, style); return new (arena) RenderBR(this); } If it hasn't content, it always create a RenderBR which is a RenderText, which is always inline, so breaks won't work in <br> elements without content. In order to change it we could add a new condition in this if. I'll provide an initial patch doing it to see if it's or not a valid approach.
Manuel Rego Casasnovas
Comment 11
2013-07-09 09:35:42 PDT
Created
attachment 206330
[details]
Patch This is an initial idea to fix the issue. If it's right I'll primprove the test case adding a link to the bug and some descripton and also provide a new baseline for some tests that are failing with this patch (fast/inline/inline-child-height-width-calc-crash.html and tables/mozilla/bugs/
bug275625
.html).
Build Bot
Comment 12
2013-07-09 15:19:12 PDT
Comment on
attachment 206330
[details]
Patch
Attachment 206330
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/1050112
New failing tests: fast/inline/inline-child-height-width-calc-crash.html fullscreen/full-screen-iframe-with-max-width-height.html tables/mozilla/bugs/
bug275625
.html
Build Bot
Comment 13
2013-07-09 15:19:14 PDT
Created
attachment 206354
[details]
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-01 Port: mac-mountainlion Platform: Mac OS X 10.8.3
Build Bot
Comment 14
2013-07-09 16:14:58 PDT
Comment on
attachment 206330
[details]
Patch
Attachment 206330
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/881741
New failing tests: fast/inline/inline-child-height-width-calc-crash.html tables/mozilla/bugs/
bug275625
.html
Build Bot
Comment 15
2013-07-09 16:15:02 PDT
Created
attachment 206357
[details]
Archive of layout-test-results from webkit-ews-04 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-04 Port: mac-mountainlion Platform: Mac OS X 10.8.3
Build Bot
Comment 16
2013-07-12 12:41:12 PDT
Comment on
attachment 206330
[details]
Patch
Attachment 206330
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/970497
New failing tests: fast/inline/inline-child-height-width-calc-crash.html tables/mozilla/bugs/
bug275625
.html
Build Bot
Comment 17
2013-07-12 12:41:15 PDT
Created
attachment 206567
[details]
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-12 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.3
Alexandru Chiculita
Comment 18
2013-07-16 03:12:30 PDT
(In reply to
comment #11
)
> Created an attachment (id=206330) [details] > Patch > > This is an initial idea to fix the issue. If it's right I'll primprove the test case adding a link to the bug and some descripton and also provide a new baseline for some tests that are failing with this patch (fast/inline/inline-child-height-width-calc-crash.html and tables/mozilla/bugs/
bug275625
.html).
I wouldn't change the way BR tags work when display: block is set. It seems like other browsers ignore that property on BR tags, too.
http://jsfiddle.net/PR9wb/1/
Might be worth looking at how RenderBlock::layoutRunsAndFloats treats inline BR tags that have "clear" set.
Brady Eidson
Comment 19
2016-05-24 22:01:42 PDT
Comment on
attachment 206330
[details]
Patch Assuming that patches for review since 2013 are stale, r-
Brent Fulgham
Comment 20
2022-07-12 17:15:15 PDT
CSS Regions were removed in
Bug 174978
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug