part 4: Make `AutoMoveOneLineHandler` never split container of insertion point

One of the crash reasons is, the destination is the parent `<video>` of the
`<ol>`.  When `AutoRangeArray` considers the range of first line is, making
`<video><source/>{<ol><li>a</li></ol>}`.  This is not intuitive, but extending
the range to outside of the block boundaries is required to collect editable
target nodes.  However, this causes a problem.  `AutoMoveOneLineHandler` splits
the parent `<video>` element at the range boundaries with
`AutoRangeArray::SplitTextNodesAtEndBoundariesAndParentInlineElementsAtBoundaries`
since it's treated as an inline element.  However, the `<video>` element is the
container of destination, so this is one unexpected issue for
`AutoMoveOneLineHandler`.  Then, it tries to move split empty nodes to same
or another `<video>` element (depending on the split node direction).  However,
at this time, it fails to move the node and delete it instead because `<video>`
cannot have not all elements.  If the source `<video>` and destination `<video>`
is same one, nodes disappear from `movedContentRange` in `Run()` and `Run()`
cannot track it.  Therefore, the range becomes invalid.

Ideal approach to fix this issue is, we should redesign considering where is
a line and how to collect the target nodes.   However, if I change the
`AutoRangeArray` methods to fix this case, a lot of regressions appeared because
they are shared in a lot of edit actions.  Therefore, I give up to fix them.

Instead, this patch just prevents to split the destination container.  This may
have not fixed the real point,  However, for now, we should just patch this
case because this could be potentially a problem for web apps which use inline
elements with `display: block`.

Differential Revision: https://phabricator.services.mozilla.com/D168183

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1811409
gecko-commit: a3b7df71803cf7c1a1b2559e85177143b91e4ac4
gecko-reviewers: m_kato
1 file changed
tree: cd7259c28962c876ef77741a4f77be1ecd21cf79
  1. .github/
  2. .well-known/
  3. accelerometer/
  4. accessibility/
  5. accname/
  6. acid/
  7. ambient-light/
  8. animation-worklet/
  9. annotation-model/
  10. annotation-protocol/
  11. annotation-vocab/
  12. apng/
  13. appmanifest/
  14. attribution-reporting/
  15. audio-output/
  16. autoplay-policy-detection/
  17. avif/
  18. background-fetch/
  19. background-sync/
  20. badging/
  21. battery-status/
  22. beacon/
  23. bluetooth/
  24. clear-site-data/
  25. client-hints/
  26. clipboard-apis/
  27. close-watcher/
  28. common/
  29. compat/
  30. compression/
  31. compute-pressure/
  32. conformance-checkers/
  33. console/
  34. contacts/
  35. content-dpr/
  36. content-index/
  37. content-security-policy/
  38. contenteditable/
  39. cookie-store/
  40. cookies/
  41. core-aam/
  42. cors/
  43. credential-management/
  44. css/
  45. custom-elements/
  46. custom-state-pseudo-class/
  47. delegated-ink/
  48. density-size-correction/
  49. deprecation-reporting/
  50. device-memory/
  51. direct-sockets/
  52. docs/
  53. document-picture-in-picture/
  54. document-policy/
  55. dom/
  56. domparsing/
  57. domxpath/
  58. dpub-aam/
  59. dpub-aria/
  60. ecmascript/
  61. editing/
  62. element-timing/
  63. encoding/
  64. encoding-detection/
  65. encrypted-media/
  66. entries-api/
  67. event-timing/
  68. eventsource/
  69. eyedropper/
  70. feature-policy/
  71. fetch/
  72. file-system-access/
  73. FileAPI/
  74. focus/
  75. font-access/
  76. fonts/
  77. forced-colors-mode/
  78. fs/
  79. fullscreen/
  80. gamepad/
  81. generic-sensor/
  82. geolocation-API/
  83. geolocation-sensor/
  84. graphics-aam/
  85. gyroscope/
  86. hr-time/
  87. html/
  88. html-longdesc/
  89. html-media-capture/
  90. idle-detection/
  91. imagebitmap-renderingcontext/
  92. images/
  93. import-maps/
  94. IndexedDB/
  95. inert/
  96. infrastructure/
  97. input-device-capabilities/
  98. input-events/
  99. installedapp/
  100. interfaces/
  101. intersection-observer/
  102. intervention-reporting/
  103. is-input-pending/
  104. js/
  105. js-self-profiling/
  106. keyboard-lock/
  107. keyboard-map/
  108. largest-contentful-paint/
  109. layout-instability/
  110. lifecycle/
  111. loading/
  112. longtask-timing/
  113. magnetometer/
  114. managed/
  115. mathml/
  116. measure-memory/
  117. media/
  118. media-capabilities/
  119. media-playback-quality/
  120. media-source/
  121. mediacapture-extensions/
  122. mediacapture-fromelement/
  123. mediacapture-handle/
  124. mediacapture-image/
  125. mediacapture-insertable-streams/
  126. mediacapture-record/
  127. mediacapture-region/
  128. mediacapture-streams/
  129. mediasession/
  130. merchant-validation/
  131. mimesniff/
  132. mixed-content/
  133. mst-content-hint/
  134. navigation-api/
  135. navigation-timing/
  136. netinfo/
  137. network-error-logging/
  138. notifications/
  139. old-tests/
  140. orientation-event/
  141. orientation-sensor/
  142. page-lifecycle/
  143. page-visibility/
  144. paint-timing/
  145. parakeet/
  146. payment-handler/
  147. payment-method-basic-card/
  148. payment-method-id/
  149. payment-request/
  150. pending-beacon/
  151. performance-timeline/
  152. periodic-background-sync/
  153. permissions/
  154. permissions-policy/
  155. permissions-request/
  156. permissions-revoke/
  157. picture-in-picture/
  158. pointerevents/
  159. pointerlock/
  160. portals/
  161. preload/
  162. presentation-api/
  163. priority-hints/
  164. private-click-measurement/
  165. proximity/
  166. push-api/
  167. quirks/
  168. referrer-policy/
  169. remote-playback/
  170. reporting/
  171. requestidlecallback/
  172. resize-observer/
  173. resource-timing/
  174. resources/
  175. sanitizer-api/
  176. savedata/
  177. scheduler/
  178. screen-capture/
  179. screen-details/
  180. screen-orientation/
  181. screen-wake-lock/
  182. scroll-animations/
  183. scroll-to-text-fragment/
  184. secure-contexts/
  185. secure-payment-confirmation/
  186. selection/
  187. serial/
  188. server-timing/
  189. service-workers/
  190. shadow-dom/
  191. shape-detection/
  192. shared-storage/
  193. signed-exchange/
  194. soft-navigation-heuristics/
  195. speculation-rules/
  196. speech-api/
  197. storage/
  198. storage-access-api/
  199. streams/
  200. subapps/
  201. subresource-integrity/
  202. svg/
  203. svg-aam/
  204. timing-entrytypes-registry/
  205. tools/
  206. top-level-storage-access-api/
  207. touch-events/
  208. trust-tokens/
  209. trusted-types/
  210. ua-client-hints/
  211. uievents/
  212. upgrade-insecure-requests/
  213. url/
  214. urlpattern/
  215. user-timing/
  216. vibration/
  217. video-rvfc/
  218. virtual-keyboard/
  219. visual-viewport/
  220. wai-aria/
  221. wasm/
  222. web-animations/
  223. web-bundle/
  224. web-locks/
  225. web-nfc/
  226. web-otp/
  227. web-share/
  228. webaudio/
  229. webauthn/
  230. webcodecs/
  231. WebCryptoAPI/
  232. webdriver/
  233. webgl/
  234. webgpu/
  235. webhid/
  236. webidl/
  237. webmessaging/
  238. webmidi/
  239. webnn/
  240. webrtc/
  241. webrtc-encoded-transform/
  242. webrtc-extensions/
  243. webrtc-ice/
  244. webrtc-identity/
  245. webrtc-priority/
  246. webrtc-stats/
  247. webrtc-svc/
  248. websockets/
  249. webstorage/
  250. webtransport/
  251. webusb/
  252. webvr/
  253. webvtt/
  254. webxr/
  255. window-placement/
  256. workers/
  257. worklets/
  258. x-frame-options/
  259. xhr/
  260. .azure-pipelines.yml
  261. .gitattributes
  262. .gitignore
  263. .mailmap
  264. .taskcluster.yml
  265. CODE_OF_CONDUCT.md
  266. CODEOWNERS
  267. CONTRIBUTING.md
  268. LICENSE.md
  269. lint.ignore
  270. README.md
  271. wpt
  272. wpt.py
README.md

The web-platform-tests Project

Taskcluster CI Status documentation manifest Python 3

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:

  • github.com/web-platform-tests/wpt: the canonical location of the project's source code revision history and the discussion forum for changes to the code
  • web-platform-tests.org: the documentation website; details how to set up the project, how to write tests, how to give and receive peer review, how to serve as an administrator, and more
  • wpt.live: a public deployment of the test suite, allowing anyone to run the tests by visiting from an Internet-enabled browser of their choice
  • wpt.fyi: an archive of test results collected from an array of web browsers on a regular basis
  • Real-time chat room: the wpt:matrix.org matrix channel; includes participants located around the world, but busiest during the European working day.
  • Mailing list: a public and low-traffic discussion list
  • RFCs: a repo for requesting comments on substantial changes that would impact other stakeholders or users; people who work on WPT infra are encouraged to watch the repo.

If you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.

Setting Up the Repo

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).

Running the Tests

See the documentation website and in particular the system setup for running tests locally.

Command Line Tools

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 server
  • wpt run - For running tests in a browser
  • wpt lint - For running the lint against all tests
  • wpt manifest - For updating or generating a MANIFEST.json test manifest
  • wpt 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.

Windows Notes

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.

Publication

The master branch is automatically synced to wpt.live and w3c-test.org.

Contributing

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:

  • Fork this repository (and make sure you're still relatively in sync with it if you forked a while ago).
  • Create a branch for your changes: git checkout -b topic.
  • Make your changes.
  • Run ./wpt lint as described above.
  • Commit locally and push that to your repo.
  • Create a pull request based on the above.

Issues with web-platform-tests

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!