WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
177327
Implement white-space:break-spaces value
https://bugs.webkit.org/show_bug.cgi?id=177327
Summary
Implement white-space:break-spaces value
Javier Fernandez
Reported
2017-09-21 15:39:20 PDT
The CSS Text 3 spec defines the 'overflow-wrap' property as property:
https://drafts.csswg.org/css-text-3/#overflow-wrap-property
"Value: normal | break-word || break-spaces"
Attachments
Patch
(6.84 KB, patch)
2018-05-16 08:58 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Patch
(55.60 KB, patch)
2018-07-12 06:41 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews102 for mac-sierra
(2.46 MB, application/zip)
2018-07-12 07:57 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews116 for mac-sierra
(3.18 MB, application/zip)
2018-07-12 08:29 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews121 for ios-simulator-wk2
(13.06 MB, application/zip)
2018-07-12 08:39 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews106 for mac-sierra-wk2
(2.90 MB, application/zip)
2018-07-12 10:06 PDT
,
EWS Watchlist
no flags
Details
Patch
(45.66 KB, patch)
2019-03-29 18:30 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews102 for mac-highsierra
(2.51 MB, application/zip)
2019-03-29 19:44 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews107 for mac-highsierra-wk2
(3.02 MB, application/zip)
2019-03-29 19:47 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews205 for win-future
(12.98 MB, application/zip)
2019-03-29 21:54 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews115 for mac-highsierra
(2.30 MB, application/zip)
2019-03-29 22:17 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews124 for ios-simulator-wk2
(2.95 MB, application/zip)
2019-03-29 22:46 PDT
,
EWS Watchlist
no flags
Details
Patch
(45.72 KB, patch)
2019-04-01 14:48 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews103 for mac-highsierra
(2.44 MB, application/zip)
2019-04-01 16:02 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews105 for mac-highsierra-wk2
(2.97 MB, application/zip)
2019-04-01 16:06 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews113 for mac-highsierra
(2.25 MB, application/zip)
2019-04-01 16:41 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews204 for win-future
(12.88 MB, application/zip)
2019-04-01 17:00 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews124 for ios-simulator-wk2
(3.18 MB, application/zip)
2019-04-01 17:11 PDT
,
EWS Watchlist
no flags
Details
Patch
(45.72 KB, patch)
2019-04-02 04:12 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews124 for ios-simulator-wk2
(2.62 MB, application/zip)
2019-04-02 06:26 PDT
,
EWS Watchlist
no flags
Details
Patch
(46.69 KB, patch)
2019-04-02 08:13 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews121 for ios-simulator-wk2
(2.56 MB, application/zip)
2019-04-02 10:21 PDT
,
EWS Watchlist
no flags
Details
Patch
(46.90 KB, patch)
2019-04-03 06:36 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews122 for ios-simulator-wk2
(2.56 MB, application/zip)
2019-04-03 08:43 PDT
,
EWS Watchlist
no flags
Details
Patch
(47.65 KB, patch)
2019-04-08 04:23 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews121 for ios-simulator-wk2
(2.61 MB, application/zip)
2019-04-08 06:28 PDT
,
EWS Watchlist
no flags
Details
Patch
(47.60 KB, patch)
2019-04-08 06:46 PDT
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(22)
View All
Add attachment
proposed patch, testcase, etc.
Javier Fernandez
Comment 1
2017-09-27 04:21:02 PDT
I'm asking Blink and Gecko engineers about the plans to implement this feature. It'd be great to have an idea about the WebKit position and its level of support to implement this.
Myles C. Maxfield
Comment 2
2017-10-03 12:44:38 PDT
(In reply to Javier Fernandez from
comment #1
)
> I'm asking Blink and Gecko engineers about the plans to implement this > feature. It'd be great to have an idea about the WebKit position and its > level of support to implement this.
It would be really great if we could rely on ICU more to handle more cases of line breaking. As I understand it, ICU aspires to handle all the line-breaking situations that are describable in CSS. Given this, I think we'd be happy to pass more information to ICU to describe the environment about how to do line breaking. If ICU doesn't currently support overflow-wrap:break-spaces behavior, we shouldn't implement it in WebKit; we should instead either wait for ICU or specifically ask ICU to support it. If ICU thinks that they will never support overflow-wrap:break-spaces behavior, we should push against it in the W3C. Regardless of what ICU's stance or current support level is, we should start on the task of deleting more of WebKit's line breaking code in favor of using ICU. This involves a few different tasks: 1) Discovering which parts of CSS-Text ICU already supports 2) Measuring the performance of their line breaking algorithms, and, if necessary implement some system (caching?) to try to speed it up. This project is something I'd like to do in the coming years.
Myles C. Maxfield
Comment 3
2017-11-20 13:36:02 PST
(In reply to Myles C. Maxfield from
comment #2
)
> (In reply to Javier Fernandez from
comment #1
) > > I'm asking Blink and Gecko engineers about the plans to implement this > > feature. It'd be great to have an idea about the WebKit position and its > > level of support to implement this. > > It would be really great if we could rely on ICU more to handle more cases > of line breaking. As I understand it, ICU aspires to handle all the > line-breaking situations that are describable in CSS. Given this, I think > we'd be happy to pass more information to ICU to describe the environment > about how to do line breaking. If ICU doesn't currently support > overflow-wrap:break-spaces behavior, we shouldn't implement it in WebKit; we > should instead either wait for ICU or specifically ask ICU to support it. If > ICU thinks that they will never support overflow-wrap:break-spaces behavior, > we should push against it in the W3C. > > Regardless of what ICU's stance or current support level is, we should start > on the task of deleting more of WebKit's line breaking code in favor of > using ICU. This involves a few different tasks: > 1) Discovering which parts of CSS-Text ICU already supports > 2) Measuring the performance of their line breaking algorithms, and, if > necessary implement some system (caching?) to try to speed it up. > > This project is something I'd like to do in the coming years.
I started looking at this more deeply, and I realized you are talking about a different property than the one I thought you were talking about. overflow-wrap doesn't create a new pattern of line-breaking opportunities; instead it says "if you didn't find any opportunities using one kind of iterator, use another kind of iterator." The novel piece here is the handoff from one iterator to another iterator; ICU already implements both kinds of iterators correctly. Therefore, we don't need to get involved with ICU for this feature. Sorry for the misdirection. The break-spaces value of overflow-wrap only interacts with whitespace, and because there are only a few whitespace characters, handling this logic directly inside WebKit seems fine. You could probably do this quickly by hacking on BreakingContext::handleText() (and either opting out of simple line layout or implementing it there too). However, this function is probably the least maintainable function relating to text in the entire codebase, so rather than implementing support directly here, a better approach would be to put the implementation behind the TextBreakIterator API, and to try to implement the kind of handoff structure that we could use for overflow-wrap: break-word. Eventually, overflow-wrap: break-word and word-break: break-all should use the same grapheme-cluster-based iterator (and overflow-wrap: break-word would hand-off between this and a regular iterator, where word-break: break-all wouldn't). This would be a fantastic first step toward the long-term plan to make BreakingContext::handleText() more understandable and maintainable. Does this sound okay? What do you think about it?
Javier Fernandez
Comment 4
2018-05-02 13:24:49 PDT
(In reply to Myles C. Maxfield from
comment #3
)
> (In reply to Myles C. Maxfield from
comment #2
) > > (In reply to Javier Fernandez from
comment #1
) > > > I'm asking Blink and Gecko engineers about the plans to implement this > > > feature. It'd be great to have an idea about the WebKit position and its > > > level of support to implement this. > > > > It would be really great if we could rely on ICU more to handle more cases > > of line breaking. As I understand it, ICU aspires to handle all the > > line-breaking situations that are describable in CSS. Given this, I think > > we'd be happy to pass more information to ICU to describe the environment > > about how to do line breaking. If ICU doesn't currently support > > overflow-wrap:break-spaces behavior, we shouldn't implement it in WebKit; we > > should instead either wait for ICU or specifically ask ICU to support it. If > > ICU thinks that they will never support overflow-wrap:break-spaces behavior, > > we should push against it in the W3C. > > > > Regardless of what ICU's stance or current support level is, we should start > > on the task of deleting more of WebKit's line breaking code in favor of > > using ICU. This involves a few different tasks: > > 1) Discovering which parts of CSS-Text ICU already supports > > 2) Measuring the performance of their line breaking algorithms, and, if > > necessary implement some system (caching?) to try to speed it up. > > > > This project is something I'd like to do in the coming years. > > I started looking at this more deeply, and I realized you are talking about > a different property than the one I thought you were talking about. > overflow-wrap doesn't create a new pattern of line-breaking opportunities; > instead it says "if you didn't find any opportunities using one kind of > iterator, use another kind of iterator." The novel piece here is the handoff > from one iterator to another iterator; ICU already implements both kinds of > iterators correctly. Therefore, we don't need to get involved with ICU for > this feature. Sorry for the misdirection. > > The break-spaces value of overflow-wrap only interacts with whitespace, and > because there are only a few whitespace characters, handling this logic > directly inside WebKit seems fine. You could probably do this quickly by > hacking on BreakingContext::handleText() (and either opting out of simple > line layout or implementing it there too). However, this function is > probably the least maintainable function relating to text in the entire > codebase, so rather than implementing support directly here, a better > approach would be to put the implementation behind the TextBreakIterator > API, and to try to implement the kind of handoff structure that we could use > for overflow-wrap: break-word. Eventually, overflow-wrap: break-word and > word-break: break-all should use the same grapheme-cluster-based iterator > (and overflow-wrap: break-word would hand-off between this and a regular > iterator, where word-break: break-all wouldn't). > > This would be a fantastic first step toward the long-term plan to make > BreakingContext::handleText() more understandable and maintainable. > > Does this sound okay? What do you think about it?
Sorry for the very late reply. I've been waiting for the spec to stabilize and it seems that after the F2F in Berlin it's in a good state now. I'll start working on this now, but I still have to learn about this new codebase and the spec, which I'm not familiar with.
Myles C. Maxfield
Comment 5
2018-05-02 21:08:57 PDT
(In reply to Javier Fernandez from
comment #4
)
> (In reply to Myles C. Maxfield from
comment #3
) > > (In reply to Myles C. Maxfield from
comment #2
) > > > (In reply to Javier Fernandez from
comment #1
) > > > > I'm asking Blink and Gecko engineers about the plans to implement this > > > > feature. It'd be great to have an idea about the WebKit position and its > > > > level of support to implement this. > > > > > > It would be really great if we could rely on ICU more to handle more cases > > > of line breaking. As I understand it, ICU aspires to handle all the > > > line-breaking situations that are describable in CSS. Given this, I think > > > we'd be happy to pass more information to ICU to describe the environment > > > about how to do line breaking. If ICU doesn't currently support > > > overflow-wrap:break-spaces behavior, we shouldn't implement it in WebKit; we > > > should instead either wait for ICU or specifically ask ICU to support it. If > > > ICU thinks that they will never support overflow-wrap:break-spaces behavior, > > > we should push against it in the W3C. > > > > > > Regardless of what ICU's stance or current support level is, we should start > > > on the task of deleting more of WebKit's line breaking code in favor of > > > using ICU. This involves a few different tasks: > > > 1) Discovering which parts of CSS-Text ICU already supports > > > 2) Measuring the performance of their line breaking algorithms, and, if > > > necessary implement some system (caching?) to try to speed it up. > > > > > > This project is something I'd like to do in the coming years. > > > > I started looking at this more deeply, and I realized you are talking about > > a different property than the one I thought you were talking about. > > overflow-wrap doesn't create a new pattern of line-breaking opportunities; > > instead it says "if you didn't find any opportunities using one kind of > > iterator, use another kind of iterator." The novel piece here is the handoff > > from one iterator to another iterator; ICU already implements both kinds of > > iterators correctly. Therefore, we don't need to get involved with ICU for > > this feature. Sorry for the misdirection. > > > > The break-spaces value of overflow-wrap only interacts with whitespace, and > > because there are only a few whitespace characters, handling this logic > > directly inside WebKit seems fine. You could probably do this quickly by > > hacking on BreakingContext::handleText() (and either opting out of simple > > line layout or implementing it there too). However, this function is > > probably the least maintainable function relating to text in the entire > > codebase, so rather than implementing support directly here, a better > > approach would be to put the implementation behind the TextBreakIterator > > API, and to try to implement the kind of handoff structure that we could use > > for overflow-wrap: break-word. Eventually, overflow-wrap: break-word and > > word-break: break-all should use the same grapheme-cluster-based iterator > > (and overflow-wrap: break-word would hand-off between this and a regular > > iterator, where word-break: break-all wouldn't). > > > > This would be a fantastic first step toward the long-term plan to make > > BreakingContext::handleText() more understandable and maintainable. > > > > Does this sound okay? What do you think about it? > > Sorry for the very late reply. I've been waiting for the spec to stabilize > and it seems that after the F2F in Berlin it's in a good state now. > > I'll start working on this now, but I still have to learn about this new > codebase and the spec, which I'm not familiar with.
Okay. Please let me know how I can help. I'm very interested in this!
Javier Fernandez
Comment 6
2018-05-16 08:58:42 PDT
Created
attachment 340493
[details]
Patch
Javier Fernandez
Comment 7
2018-05-16 09:06:32 PDT
The patch in
attachment #340493
[details]
is a very preliminary approach to implement the new 'break-spaces' value for the 'overflow-wrap' CSS property. The parsing logic is still uncompleted, since the new syntax allow a combination of 'break-word' and 'break-spaces' values (in any oder), but while still discussing about the best approach to implement this, I'd rather keep it simple. So, I've spent a few days trying to understand the codebase involved in inline-level boxes layout and the line-braking logic. I think I've got an overall idea of the general design and the classes involved. However, I still have doubts about where to implement the new line-breaking features. As far I understand the spec [1] and the prose about the new value, the following points are the ones supporting my current (preliminary) approach. The new 'break-spaces' value does not introduce new breaking opportunities, but just forbids collapsing [2] to let the current line-breaking logic to handle those spaces as preserved white-spaces: "However, if overflow-wrap is set to break-spaces, collapsing their advance width is not allowed, as this would prevent the preserved spaces from wrapping. " Additionally, it introduces some restrictions [3] to where this preserved sequence of white spaces can be broken: " ... after the last white space character that would fit the line, or after the first white space in the sequence if none would fit, or before the first space in the sequence if none would fit and both break-word and break-spaces are specified." Comments and feedback are really welcome.
Javier Fernandez
Comment 8
2018-05-23 03:46:43 PDT
@Myles could you add some feedback about the general design of the patch ? I'm already discussing these details in the Blink CL, but perhaps we can share some ideas here as well. The patch is in a very early state, specially regarding the parsing logic, which for now only parses single values. However, I'd like to focus now on the new 'break-spaces' value alone; how it avoid the white-spaces to collapse, whether it introduces new breaking opportunities (or forbid ones already implemented) and where (which class/function) these should be implemented: LazyLineBreakIterator(ICU) or LineBreaker/BrakingContext.
Myles C. Maxfield
Comment 9
2018-05-24 14:35:14 PDT
(In reply to Javier Fernandez from
comment #8
)
> @Myles could you add some feedback about the general design of the patch ? > I'm already discussing these details in the Blink CL, but perhaps we can > share some ideas here as well. > > The patch is in a very early state, specially regarding the parsing logic, > which for now only parses single values. However, I'd like to focus now on > the new 'break-spaces' value alone; how it avoid the white-spaces to > collapse, whether it introduces new breaking opportunities (or forbid ones > already implemented) and where (which class/function) these should be > implemented: LazyLineBreakIterator(ICU) or LineBreaker/BrakingContext.
Yeah, I'll look at it today.
Myles C. Maxfield
Comment 10
2018-05-25 18:38:03 PDT
Comment on
attachment 340493
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=340493&action=review
I think this is a fine direction to start with. How much more complicated do you think the full feature will be? If it's not super complicated, we can probably just keep hacking on BreakingContext.h, but if this turns too complicated, we probably want to rip up BreakingContext.h together and redesign it. How comprehensive are the WPT tests for this?
> Source/WebCore/css/parser/CSSParserFastPaths.cpp:606 > + return valueID == CSSValueNormal || valueID == CSSValueBreakWord || valueID == CSSValueBreakSpaces;
https://drafts.csswg.org/css-text-3/#propdef-word-wrap
says that the syntax is normal | break-word || break-spaces
> Source/WebCore/rendering/line/BreakingContext.h:985 > + if (m_currentCharacterIsSpace && !previousCharacterIsSpace && !m_currentStyle->canBreakBeforeFirstWhiteSpace()) > + return false;
I think this is fine for now, but is there a more elegant way we can do this? I don't know, this whole function is smelly.
> Source/WebCore/rendering/line/LineInlineHeaders.h:71 > + || (whitespacePosition == TrailingWhitespace && style->whiteSpace() == PRE_WRAP && style->overflowWrap() != BreakSpacesOverflowWrap && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
I don't think breaking spaces controls collapsing. I think it means "if whitespace isn't collapsed, then a sequence of spaces can have breaking opportunities within the sequence of whitespace." Unless there is some part of the spec I don't understand?
> Source/WebCore/rendering/style/RenderStyleConstants.h:311 > + NormalOverflowWrap, BreakOverflowWrap, BreakSpacesOverflowWrap
Because of the syntax, this has to be a bitfield.
Javier Fernandez
Comment 11
2018-05-28 06:59:12 PDT
Thanks for taking the time to review this, despite the early stage of the patch. (In reply to Myles C. Maxfield from
comment #10
)
> Comment on
attachment 340493
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=340493&action=review
> > I think this is a fine direction to start with. How much more complicated do > you think the full feature will be? If it's not super complicated, we can > probably just keep hacking on BreakingContext.h, but if this turns too > complicated, we probably want to rip up BreakingContext.h together and > redesign it. >
I think that's the key point. My impression is that the feature is relatively simple, as it doesn't introduce new breaking opportunities, but limiting some of the ones we already have implemented in other line-breaking properties. There was some discussion [1] about the combination 'break-word break-spaces', which would allow breaking the white-spaces sequence before the first space, but I don't think it'll increase the complexity too much. However, during the discussion in the blink CL, there is always the request to move any new braking opportunity to the ICU implementation, which if I understood it correctly, relies on the LazyLineBrakingIterator. We can follow a similar approach eventually, but I think we can start trying to implement it via smalls changes in the BrakingContext class.
> How comprehensive are the WPT tests for this? >
I think that Forian did a good initial effort in the test suite and there are a around 20 or 30 tests to verify the basic behavior of the break-spaces value and the combination with the break-word value. There are also tests to verify how it behaves when combined with the white-space property, mainly with the pre-wrap value, which I think it's one of the main use cases for this new value. However, and this is also a concern raised during the blink CL discussion, the test suite lack of tests with other combinations of line-braking properties, as 'line-break: anywhere' or break-word: break-all. Anyway, Florian commented about his intention to continue working on adding tests and I'll also devote a considerable part of my work to this task.
Javier Fernandez
Comment 12
2018-05-28 07:09:51 PDT
Comment on
attachment 340493
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=340493&action=review
>> Source/WebCore/css/parser/CSSParserFastPaths.cpp:606 >> + return valueID == CSSValueNormal || valueID == CSSValueBreakWord || valueID == CSSValueBreakSpaces; > >
https://drafts.csswg.org/css-text-3/#propdef-word-wrap
says that the syntax is normal | break-word || break-spaces
Yes, I preferred to keep the simple CSS syntax for now, to focus the discussion on the line-breaking logic and figure out whether it's enough to touch the BrakingContext class or we'll need a new design. Anyway, I'm already working on a patch to implement the new parsing logic to allow complex values.
>> Source/WebCore/rendering/line/BreakingContext.h:985 >> + return false; > > I think this is fine for now, but is there a more elegant way we can do this? > > I don't know, this whole function is smelly.
I agree with you that this should indeed be a temporary change. I'm still trying to understand the whole logic, but this change helped me to point out that this new value should forbid breaking at the first white space, unless break-word is used in combination with break-spaces. I'll think about better ways to implement it.
>> Source/WebCore/rendering/line/LineInlineHeaders.h:71 >> + || (whitespacePosition == TrailingWhitespace && style->whiteSpace() == PRE_WRAP && style->overflowWrap() != BreakSpacesOverflowWrap && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly())); > > I don't think breaking spaces controls collapsing. I think it means "if whitespace isn't collapsed, then a sequence of spaces can have breaking opportunities within the sequence of whitespace." > > Unless there is some part of the spec I don't understand?
My understanding is that while it's true that break-spaces doesn't control spaces collapsing, it indeed prevents it in some situations:
https://drafts.csswg.org/css-text-3/#white-space-phase-2
4. If spaces or tabs at the end of a line are non-collapsible but have white-space set to pre-wrap: * If overflow-wrap does not specify break-spaces the UA must either hang the white space or visually collapse the character advance widths of any overflowing spaces such that they don’t take up space in the line. * Otherwise (i.e. overflow-wrap property specifies break-spaces), hanging or collapsing the advance width of spaces at the end of the line is not allowed.
>> Source/WebCore/rendering/style/RenderStyleConstants.h:311 >> + NormalOverflowWrap, BreakOverflowWrap, BreakSpacesOverflowWrap > > Because of the syntax, this has to be a bitfield.
Indeed, but let's leaving aside this until I'll provide a patch with the new CSS parsing logic.
Javier Fernandez
Comment 13
2018-05-28 07:14:25 PDT
I forgot to add the mentioned link to the discussion, which you started some time ago :)
https://github.com/w3c/csswg-drafts/issues/2003
(In reply to Javier Fernandez from
comment #11
)
> Thanks for taking the time to review this, despite the early stage of the > patch. > > (In reply to Myles C. Maxfield from
comment #10
) > > Comment on
attachment 340493
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=340493&action=review
> > > > I think this is a fine direction to start with. How much more complicated do > > you think the full feature will be? If it's not super complicated, we can > > probably just keep hacking on BreakingContext.h, but if this turns too > > complicated, we probably want to rip up BreakingContext.h together and > > redesign it. > > > > I think that's the key point. My impression is that the feature is > relatively simple, as it doesn't introduce new breaking opportunities, but > limiting some of the ones we already have implemented in other line-breaking > properties. There was some discussion [1] about the combination 'break-word > break-spaces', which would allow breaking the white-spaces sequence before > the first space, but I don't think it'll increase the complexity too much.
Myles C. Maxfield
Comment 14
2018-06-18 14:53:01 PDT
We should also make sure the minimum and maximum intrinsic widths are correctly affected (or not affected)
Myles C. Maxfield
Comment 15
2018-06-18 15:02:12 PDT
(In reply to Javier Fernandez from
comment #11
)
> Thanks for taking the time to review this, despite the early stage of the > patch. > > (In reply to Myles C. Maxfield from
comment #10
) > > Comment on
attachment 340493
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=340493&action=review
> > > > I think this is a fine direction to start with. How much more complicated do > > you think the full feature will be? If it's not super complicated, we can > > probably just keep hacking on BreakingContext.h, but if this turns too > > complicated, we probably want to rip up BreakingContext.h together and > > redesign it. > > > > I think that's the key point. My impression is that the feature is > relatively simple, as it doesn't introduce new breaking opportunities, but > limiting some of the ones we already have implemented in other line-breaking > properties. There was some discussion [1] about the combination 'break-word > break-spaces', which would allow breaking the white-spaces sequence before > the first space, but I don't think it'll increase the complexity too much.
Okay, if you're comfortable with this direction, then it seems fine to me.
> > However, during the discussion in the blink CL, there is always the request > to move any new braking opportunity to the ICU implementation
Yeah, this is what my comment in
https://bugs.webkit.org/show_bug.cgi?id=177327#c3
is about. This property is about the interaction between two types of line breaking, both of which already exist in ICU. Therefore, I don't think ICU is the right place to implement this.
> , which if I > understood it correctly, relies on the LazyLineBrakingIterator. We can > follow a similar approach eventually, but I think we can start trying to > implement it via smalls changes in the BrakingContext class.
Right. LazyLineBreakIterator conceptually represents an ICU UBreakIterator. BreakingContext uses the lower-level breaking iterators. Because break-spaces is about the relationship between two different breaking iterators, it belongs in the higher level.
> > > How comprehensive are the WPT tests for this? > > > > I think that Forian did a good initial effort in the test suite and there > are a around 20 or 30 tests to verify the basic behavior of the break-spaces > value and the combination with the break-word value. There are also tests to > verify how it behaves when combined with the white-space property, mainly > with the pre-wrap value, which I think it's one of the main use cases for > this new value. > > However, and this is also a concern raised during the blink CL discussion, > the test suite lack of tests with other combinations of line-braking > properties, as 'line-break: anywhere' or break-word: break-all. > > Anyway, Florian commented about his intention to continue working on adding > tests and I'll also devote a considerable part of my work to this task.
Javier Fernandez
Comment 16
2018-07-12 06:17:19 PDT
The CSS WG has resolved [1] that the new 'break-spaces' value should belong to the 'white-space' property, instead of 'overflow-wrap'. [1]|
https://github.com/w3c/csswg-drafts/issues/2465#issuecomment-400757345
Javier Fernandez
Comment 17
2018-07-12 06:41:25 PDT
Created
attachment 344840
[details]
Patch
EWS Watchlist
Comment 18
2018-07-12 07:57:00 PDT
Comment on
attachment 344840
[details]
Patch
Attachment 344840
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/8515246
New failing tests: imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-010.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-001.html imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html imported/w3c/web-platform-tests/css/css-text/white-space/trailing-space-before-br-001.html imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-008.html imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-010.html
EWS Watchlist
Comment 19
2018-07-12 07:57:02 PDT
Created
attachment 344844
[details]
Archive of layout-test-results from ews102 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 20
2018-07-12 08:29:20 PDT
Comment on
attachment 344840
[details]
Patch
Attachment 344840
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/8515356
New failing tests: imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-010.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-001.html imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html imported/w3c/web-platform-tests/css/css-text/white-space/trailing-space-before-br-001.html imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-008.html imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-010.html
EWS Watchlist
Comment 21
2018-07-12 08:29:22 PDT
Created
attachment 344846
[details]
Archive of layout-test-results from ews116 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 22
2018-07-12 08:39:44 PDT
Comment on
attachment 344840
[details]
Patch
Attachment 344840
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/8515380
New failing tests: imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-010.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-001.html imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-009.html imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html imported/w3c/web-platform-tests/css/css-text/white-space/trailing-space-before-br-001.html imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-008.html imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-010.html
EWS Watchlist
Comment 23
2018-07-12 08:39:46 PDT
Created
attachment 344847
[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
EWS Watchlist
Comment 24
2018-07-12 10:06:11 PDT
Comment on
attachment 344840
[details]
Patch
Attachment 344840
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
https://webkit-queues.webkit.org/results/8516009
New failing tests: imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-010.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-001.html imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html imported/w3c/web-platform-tests/css/css-text/white-space/trailing-space-before-br-001.html imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-008.html imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-010.html
EWS Watchlist
Comment 25
2018-07-12 10:06:13 PDT
Created
attachment 344852
[details]
Archive of layout-test-results from ews106 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Javier Fernandez
Comment 26
2019-03-29 18:30:43 PDT
Created
attachment 366339
[details]
Patch
EWS Watchlist
Comment 27
2019-03-29 19:44:24 PDT
Comment on
attachment 366339
[details]
Patch
Attachment 366339
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/11709147
New failing tests: editing/deleting/delete-to-select-table.html editing/style/table-selection.html fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html editing/deleting/delete-block-table.html fast/css/font-face-zero-hash-key.html
EWS Watchlist
Comment 28
2019-03-29 19:44:26 PDT
Created
attachment 366343
[details]
Archive of layout-test-results from ews102 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 29
2019-03-29 19:47:26 PDT
Comment on
attachment 366339
[details]
Patch
Attachment 366339
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
https://webkit-queues.webkit.org/results/11709112
New failing tests: editing/deleting/delete-to-select-table.html editing/style/table-selection.html fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html editing/deleting/delete-block-table.html fast/css/font-face-zero-hash-key.html
EWS Watchlist
Comment 30
2019-03-29 19:47:27 PDT
Created
attachment 366344
[details]
Archive of layout-test-results from ews107 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 31
2019-03-29 21:54:38 PDT
Comment on
attachment 366339
[details]
Patch
Attachment 366339
[details]
did not pass win-ews (win): Output:
https://webkit-queues.webkit.org/results/11709686
New failing tests: editing/deleting/delete-to-select-table.html editing/style/table-selection.html fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html fast/css/font-face-zero-hash-key.html editing/deleting/delete-block-table.html
EWS Watchlist
Comment 32
2019-03-29 21:54:50 PDT
Created
attachment 366354
[details]
Archive of layout-test-results from ews205 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews205 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
EWS Watchlist
Comment 33
2019-03-29 22:17:27 PDT
Comment on
attachment 366339
[details]
Patch
Attachment 366339
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/11709846
New failing tests: editing/deleting/delete-to-select-table.html editing/style/table-selection.html fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html editing/deleting/delete-block-table.html fast/css/font-face-zero-hash-key.html
EWS Watchlist
Comment 34
2019-03-29 22:17:29 PDT
Created
attachment 366355
[details]
Archive of layout-test-results from ews115 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 35
2019-03-29 22:46:31 PDT
Comment on
attachment 366339
[details]
Patch
Attachment 366339
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/11710083
New failing tests: editing/deleting/delete-to-select-table.html editing/style/table-selection.html fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html imported/w3c/web-platform-tests/css/css-text/white-space/textarea-break-spaces-001.html editing/deleting/delete-block-table.html fast/inline/trailing-floats-inline-crash.html fast/inline/crash-when-inline-box-has-invalid-float.html fast/css/font-face-zero-hash-key.html
EWS Watchlist
Comment 36
2019-03-29 22:46:33 PDT
Created
attachment 366358
[details]
Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Javier Fernandez
Comment 37
2019-04-01 14:48:52 PDT
Created
attachment 366425
[details]
Patch
EWS Watchlist
Comment 38
2019-04-01 16:02:55 PDT
Comment on
attachment 366425
[details]
Patch
Attachment 366425
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/11731921
New failing tests: fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html fast/css/font-face-zero-hash-key.html
EWS Watchlist
Comment 39
2019-04-01 16:02:57 PDT
Created
attachment 366433
[details]
Archive of layout-test-results from ews103 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 40
2019-04-01 16:06:07 PDT
Comment on
attachment 366425
[details]
Patch
Attachment 366425
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
https://webkit-queues.webkit.org/results/11731888
New failing tests: fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html fast/css/font-face-zero-hash-key.html
EWS Watchlist
Comment 41
2019-04-01 16:06:09 PDT
Created
attachment 366434
[details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 42
2019-04-01 16:41:51 PDT
Comment on
attachment 366425
[details]
Patch
Attachment 366425
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/11732018
New failing tests: fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html fast/css/font-face-zero-hash-key.html
EWS Watchlist
Comment 43
2019-04-01 16:41:53 PDT
Created
attachment 366441
[details]
Archive of layout-test-results from ews113 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 44
2019-04-01 17:00:12 PDT
Comment on
attachment 366425
[details]
Patch
Attachment 366425
[details]
did not pass win-ews (win): Output:
https://webkit-queues.webkit.org/results/11732232
New failing tests: fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html fast/css/font-face-zero-hash-key.html
EWS Watchlist
Comment 45
2019-04-01 17:00:24 PDT
Created
attachment 366444
[details]
Archive of layout-test-results from ews204 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews204 Port: win-future Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
EWS Watchlist
Comment 46
2019-04-01 17:11:47 PDT
Comment on
attachment 366425
[details]
Patch
Attachment 366425
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/11732221
New failing tests: fast/text/simple-line-layout-multiple-trailingwhitespace-crash.html imported/w3c/web-platform-tests/css/css-text/white-space/textarea-break-spaces-001.html fast/css/font-face-zero-hash-key.html imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html
EWS Watchlist
Comment 47
2019-04-01 17:11:49 PDT
Created
attachment 366446
[details]
Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Javier Fernandez
Comment 48
2019-04-02 04:12:11 PDT
Created
attachment 366484
[details]
Patch
EWS Watchlist
Comment 49
2019-04-02 06:26:01 PDT
Comment on
attachment 366484
[details]
Patch
Attachment 366484
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/11738413
New failing tests: imported/w3c/web-platform-tests/css/css-text/white-space/textarea-break-spaces-001.html imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html
EWS Watchlist
Comment 50
2019-04-02 06:26:03 PDT
Created
attachment 366490
[details]
Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Javier Fernandez
Comment 51
2019-04-02 08:13:16 PDT
Created
attachment 366495
[details]
Patch
EWS Watchlist
Comment 52
2019-04-02 10:21:56 PDT
Comment on
attachment 366495
[details]
Patch
Attachment 366495
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/11740022
New failing tests: imported/w3c/web-platform-tests/css/css-text/white-space/textarea-break-spaces-001.html
EWS Watchlist
Comment 53
2019-04-02 10:21:58 PDT
Created
attachment 366500
[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Myles C. Maxfield
Comment 54
2019-04-02 16:49:20 PDT
Comment on
attachment 366495
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=366495&action=review
r+ but Alan should look at the SimpleLineLayout changes.
> Source/WebCore/css/parser/CSSParserFastPaths.cpp:730 > + case CSSPropertyLineBreak: // auto | loose | normal | strict | after-white-space | break-spacess
s/break-spacess/break-spaces/ Also, shouldn't this new value be on "white-space" instead of "line-break"?
> LayoutTests/platform/ios/TestExpectations:3061 > +
webkit.org/b/196169
imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html [ ImageOnlyFailure ]
This is surprising, and I don't see anything in the ChangeLog about it.
> LayoutTests/platform/mac/TestExpectations:1690 > +
webkit.org/b/196169
imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html [ ImageOnlyFailure ]
Ditto.
Javier Fernandez
Comment 55
2019-04-03 03:28:26 PDT
Comment on
attachment 366495
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=366495&action=review
>> Source/WebCore/css/parser/CSSParserFastPaths.cpp:730 >> + case CSSPropertyLineBreak: // auto | loose | normal | strict | after-white-space | break-spacess > > s/break-spacess/break-spaces/ > > Also, shouldn't this new value be on "white-space" instead of "line-break"?
Opps, notice that it's just a comment, which is in the wrong place in any case. The actual new value is added in the 'white-space' property.
>> LayoutTests/platform/ios/TestExpectations:3061 >> +
webkit.org/b/196169
imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-003.html [ ImageOnlyFailure ] > > This is surprising, and I don't see anything in the ChangeLog about it.
Well, the bug is pretty clear, I'd say. Actually, I had to send a PR [1] to change some tests to use Ahem instead of monospace precisely because
bug #196353
which I think it's the root cause of
webkit.org/b/196169
. Additionally, I created another PR [2] to define two new tests, identical to this one failing in mac and ios platforms, but using the Ahem font. However, it's true that I should have add some lines to the ChangeLog explaining the issue. [1]
https://github.com/web-platform-tests/wpt/pull/16137
[2]
https://github.com/web-platform-tests/wpt/pull/16124
Javier Fernandez
Comment 56
2019-04-03 06:36:26 PDT
Created
attachment 366596
[details]
Patch
Javier Fernandez
Comment 57
2019-04-03 08:17:26 PDT
(In reply to Build Bot from
comment #52
)
> Comment on
attachment 366495
[details]
> Patch > >
Attachment 366495
[details]
did not pass ios-sim-ews (ios-simulator-wk2): > Output:
https://webkit-queues.webkit.org/results/11740022
> > New failing tests: > imported/w3c/web-platform-tests/css/css-text/white-space/textarea-break- > spaces-001.html
I'm not sure how to get rid of this test failure. It seems a weird rendering of the expected file, which instead of a perfect green square it shows the left corners slightly round.
EWS Watchlist
Comment 58
2019-04-03 08:43:15 PDT
Comment on
attachment 366596
[details]
Patch
Attachment 366596
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/11751207
New failing tests: imported/w3c/web-platform-tests/css/css-text/white-space/textarea-break-spaces-001.html
EWS Watchlist
Comment 59
2019-04-03 08:43:17 PDT
Created
attachment 366609
[details]
Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Javier Fernandez
Comment 60
2019-04-04 03:25:21 PDT
Hi @zalan, could you please take a look at this patch ? Specially to the changes in the SimpleLineLayout class. Also, if you could give me some advice on how to deal with the iOS regression it'd be really helpful.
zalan
Comment 61
2019-04-07 22:03:42 PDT
(In reply to Javier Fernandez from
comment #60
)
> Hi @zalan, could you please take a look at this patch ? Specially to the > changes in the SimpleLineLayout class. Also, if you could give me some > advice on how to deal with the iOS regression it'd be really helpful.
Not sure why that's there but it clearly comes from html.css. I'd just fix it with border-radius: 0px;
Javier Fernandez
Comment 62
2019-04-08 04:23:47 PDT
Created
attachment 366925
[details]
Patch
EWS Watchlist
Comment 63
2019-04-08 06:28:13 PDT
Comment on
attachment 366925
[details]
Patch
Attachment 366925
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
https://webkit-queues.webkit.org/results/11804763
New failing tests: imported/w3c/web-platform-tests/css/css-text/white-space/textarea-break-spaces-001.html
EWS Watchlist
Comment 64
2019-04-08 06:28:15 PDT
Created
attachment 366930
[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Javier Fernandez
Comment 65
2019-04-08 06:46:18 PDT
Created
attachment 366931
[details]
Patch
WebKit Commit Bot
Comment 66
2019-04-08 13:31:12 PDT
Comment on
attachment 366931
[details]
Patch Clearing flags on attachment: 366931 Committed
r244036
: <
https://trac.webkit.org/changeset/244036
>
WebKit Commit Bot
Comment 67
2019-04-08 13:31:14 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 68
2019-04-08 13:32:42 PDT
<
rdar://problem/49708962
>
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