Closed Bug 1949325 Opened 24 days ago Closed 17 days ago

Update WPTs under `editing/` to assume the other browsers' like white-space sequence

Categories

(Core :: DOM: Editor, task)

task

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

We use <br> (ASCII white-space and a padding <br>) before a block boundary to make the last white-space visible. However, the other browsers use &nbsp; without <br>. This makes sense because it guarantees that the white-space is always visible even if the following visible content is removed by the web apps. And also we can reduce the mutations managing the padding <br>s once we follow their behavior. Therefore, we should do that in bug 1940377.

On the other hand, some WPTs expect the Gecko's behavior, and we need more tests to check the compatibility with Chrome. So, we need to update WPTs under editing/.

According to the test results, Chrome normalizes collapsible white-spaces with
the following rules:

  1. a collapsible white-space at start or end of a Text is always an NBSP.
  2. a collapsible white-space immediately before or after a preformatted line
    break is always an NBSP.
  3. a collapsible white-space followed by a non-collapsible chars is always an
    ASCII white-space.
  4. repeat the pair of an ASCII white-space and an NBSP between the first and
    the last white-spaces considered by the above rules.

For avoiding to update the tests when we change the behavior, this patch updates
some expectations in the WPTs.

Additionally, this stops checking "auto link" behavior when you type a
white-space after URL since no browser implements such behavior and it must
break web apps in the wild a lot.

Finally, this adds new WPTs to check the compatibility with Chrome and groups
such tests into editing/whitespaces/chrome-compat directory.

Attachment #9467572 - Attachment description: Bug 1949325 - Update WPTs under `editing/` never assume Gecko's tricky trailing white-spaces r=m_kato! → Bug 1949325 - Make WPTs never assume Gecko's tricky trailing white-spaces r=m_kato!
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/36a1c94ba24e Make WPTs never assume Gecko's tricky trailing white-spaces r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50959 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 17 days ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
Upstream PR merged by moz-wptsync-bot
Upstream PR was closed without merging
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: