This matches what chromium does, and is both simpler and prettier. The overflow: hidden enforcement also matches chromium / WebKit via: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/resolver/style_adjuster.cc;l=482;drc=88c8510c16d44e0dc8c07426db31aa5bb3c90a2b https://searchfox.org/wubkat/rev/473ca5f8512b88edd7e82c8783e7e09158f17ba1/Source/WebCore/style/StyleAdjuster.cpp#581-596 See also https://github.com/whatwg/html/pull/10243 and the resets.html change. Adding white-space: nowrap isn't strictly necessary, but also matches other implementations: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_marquee_element.cc;l=66;drc=4aba604f0aae6fb93eab830b68765604e9a2cca0 (and same link as above on WebKit) Differential Revision: https://phabricator.services.mozilla.com/D206357
21 lines
537 B
CSS
21 lines
537 B
CSS
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
slot {
|
|
display: block;
|
|
will-change: translate;
|
|
}
|
|
|
|
/* Disable the animation on contenteditable */
|
|
:host(:read-write) > slot {
|
|
translate: none !important;
|
|
}
|
|
|
|
/* When printing or when the user doesn't want movement, we disable scrolling */
|
|
@media print, (prefers-reduced-motion) {
|
|
slot {
|
|
translate: none !important;
|
|
}
|
|
}
|