commit | 1f214d8ef92e0c16538e9d3ba5375199fc1579bf | [log] [tgz] |
---|---|---|
author | Masayuki Nakano <masayuki@d-toybox.com> | Tue Dec 20 00:24:35 2022 |
committer | moz-wptsync-bot <wptsync@mozilla.com> | Tue Dec 20 10:41:37 2022 |
tree | 72b7d16252b893e595f9541539c2cd93bd610a92 | |
parent | e76564cbe89ba98cc89a3096ebacd475357ec098 [diff] |
part 1: Make `HTMLEditor::SetInlinePropertiesAsSubAction` extend and/or shrink range smarter Blink's behavior is better than Gecko. That is, when selected range crosses an inline element boundary, Blink shrinks selected range to select only children, but Gecko extends selected range to cover all inline parents around the range. E.g., when setting `abc[<i>def]</i>ghi` to `<b>`, Chrome changes it to `abc<i><b>def</b></i>ghi`, but Gecko changes it to `abc<b><i>def</i></b>ghi`. The Gecko's behavior is odd especially when `abc<i>[def]</i>ghi` since user does not select the `<i>`, but Gecko wraps it in new `<b>`. However, if the range contains an inline element entirely, e.g., `abc[<i>def</i>]ghi`, Chrome changes it to `abc<b><i>def</i></b>ghi` without shrinking the range. This is reasonable too. On the other hand, there is a case that browsers need to extend the range. That is an parent inline element has the style of what we're setting a range to. E.g., `abc<span style="background-color: red"><b>[def]</b></span>ghi`, user wants to update the style attribute of the `<span>` element rather than wrapping the selected text node with new `<span>` element in the `<b>`. Therefore, if shrunken range starts from very beginning of a node or ends at very end of a node and the inline parents have same style, we need extend the range to wrap it. (Note that Gecko deletes same styles in range with `HTMLEditor::RemoveStyleInside`. Therefore, wrapping most distant inline element makes Gecko works as expected.) Finally, if the containers of range boundaries are not same one, we should extend the range to save the number of creating element. E.g., `<span>[abc</span> <span>def]</span>` should become `<b><span>abc</span> <span>def</span>` rather than `<span><b>abc</b></span><b> </b><span><b>def</b></span>`. Note that the new expected failures are caused by the difference of selection range after applying the style. That should be fixed by the following patch. Depends on D164521 Differential Revision: https://phabricator.services.mozilla.com/D164522 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1792386 gecko-commit: bde5b32f67622bbe8c6e2e1425a0af432ac77d28 gecko-reviewers: m_kato
The web-platform-tests Project is a cross-browser test suite for the Web-platform stack. Writing tests in a way that allows them to be run in all browsers gives browser projects confidence that they are shipping software that is compatible with other implementations, and that later implementations will be compatible with their implementations. This in turn gives Web authors/developers confidence that they can actually rely on the Web platform to deliver on the promise of working across browsers and devices without needing extra layers of abstraction to paper over the gaps left by specification editors and implementors.
The most important sources of information and activity are:
wpt:matrix.org
matrix channel; includes participants located around the world, but busiest during the European working day.If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.
Clone or otherwise get https://github.com/web-platform-tests/wpt.
Note: because of the frequent creation and deletion of branches in this repo, it is recommended to “prune” stale branches when fetching updates, i.e. use git pull --prune
(or git fetch -p && git merge
).
See the documentation website and in particular the system setup for running tests locally.
The wpt
command provides a frontend to a variety of tools for working with and running web-platform-tests. Some of the most useful commands are:
wpt serve
- For starting the wpt http serverwpt run
- For running tests in a browserwpt lint
- For running the lint against all testswpt manifest
- For updating or generating a MANIFEST.json
test manifestwpt install
- For installing the latest release of a browser or webdriver server on the local machine.wpt serve-wave
- For starting the wpt http server and the WAVE test runner. For more details on how to use the WAVE test runner see the documentation.On Windows wpt
commands must be prefixed with python
or the path to the python binary (if python
is not in your %PATH%
).
python wpt [command]
Alternatively, you may also use Bash on Ubuntu on Windows in the Windows 10 Anniversary Update build, then access your windows partition from there to launch wpt
commands.
Please make sure git and your text editor do not automatically convert line endings, as it will cause lint errors. For git, please set git config core.autocrlf false
in your working tree.
The master branch is automatically synced to wpt.live and w3c-test.org.
Save the Web, Write Some Tests!
Absolutely everyone is welcome to contribute to test development. No test is too small or too simple, especially if it corresponds to something for which you've noted an interoperability bug in a browser.
The way to contribute is just as usual:
git checkout -b topic
../wpt lint
as described above.If you spot an issue with a test and are not comfortable providing a pull request per above to fix it, please file a new issue. Thank you!