Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout: Add support for clear on <br> elements #32094

Merged
merged 1 commit into from Apr 17, 2024

Conversation

mrobinson
Copy link
Member

@mrobinson mrobinson commented Apr 16, 2024

<br> elements are a bit "special" in the sense that they defer a
linebreak, but can also have clear applied to them. The clear that
they supply should be applied after the linebreak is processed. This
change adds special processing for this situation.

Fixes #15402.
Fixes #8960.
Fixes #7311.


`<br>` elements are a bit "special" in the sense that they defer a
linebreak, but can also have `clear` applied to them. The `clear` that
they supply should be applie *after* the linebreak is processed. This
change adds special processing for this situation.

Fixes servo#15402.
@mrobinson mrobinson added the T-linux-wpt-2020 Do a try run of the WPT label Apr 16, 2024
@github-actions github-actions bot removed the T-linux-wpt-2020 Do a try run of the WPT label Apr 16, 2024
Copy link

🔨 Triggering try run (#8705706012) for Linux WPT

Copy link

Test results for linux-wpt-layout-2020 from try job (#8705706012):

Flaky unexpected result (27)
  • OK /_mozilla/css/stylesheet_media_queries.html (#17159)
    • FAIL [expected PASS] subtest: Media queries within stylesheets

      assert_equals: expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
      

  • FAIL [expected PASS] /_mozilla/mozilla/iframe/resize_after_load.html (#13573)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • PASS [expected FAIL] subtest: Matching font-weight: '400' should prefer '350 399' over '351 398'
    • PASS [expected FAIL] subtest: Matching font-weight: '400' should prefer '501 550' over '502 560'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 0deg' should prefer 'oblique 0deg' over 'oblique 5deg'
  • OK /css/css-fonts/variations/font-weight-matching.html (#20686)
    • PASS [expected FAIL] subtest: Test @font-face matching for weight 100
  • TIMEOUT [expected OK] /dom/events/webkit-transition-end-event.html (#26497)
    • TIMEOUT [expected FAIL] subtest: webkitTransitionEnd event listener should trigger for an animation

      Test timed out
      

    • NOTRUN [expected PASS] subtest: webkitTransitionEnd event listener should not trigger if an unprefixed listener also exists
    • NOTRUN [expected PASS] subtest: webkitTransitionEnd event listener should not trigger if an unprefixed event handler also exists
    • NOTRUN [expected FAIL] subtest: event types for prefixed and unprefixed transitionend event listeners should be named appropriately
    • NOTRUN [expected PASS] subtest: webkitTransitionEnd event listener is case sensitive
  • TIMEOUT /fetch/api/basic/keepalive.any.html (#29536)
    • TIMEOUT [expected PASS] subtest: [keepalive] simple GET request on 'load' [no payload]; setting up

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: [keepalive] simple GET request on 'pagehide' [no payload]; setting up
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.https.sub.html (#30111)
    • FAIL [expected TIMEOUT] subtest: sec-fetch-site - Cross-site, no attributes

      promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
      

    • TIMEOUT [expected NOTRUN] subtest: sec-fetch-site - Same site, no attributes

      Test timed out
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • PASS [expected FAIL] subtest: Navigating to a different document with link click
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • PASS [expected FAIL] subtest: load event does not fire on window.open('about:blank')
  • TIMEOUT /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.html (#29055)
    • PASS [expected FAIL] subtest: Navigating an opened window with an iframe via location.href to a javascript: URL must not fire beforeunload on the iframe: undefined completion
  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted

      assert_array_equals: Pages opened during history navigation expected property 1 to be 5 but got 3 (expected array [6, 5] got [6, 3])
      

  • TIMEOUT [expected OK] /html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html (#21581)
    • TIMEOUT [expected PASS] subtest: Traverse the history when a history entry is written in the load event

      Test timed out
      

  • OK [expected CRASH] /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
    • FAIL [expected TIMEOUT] subtest: opener of discarded auxiliary browsing context

      assert_object_equals: property "get" expected function "function opener() {
          [native code]
      }" got function "function opener() {
          [native code]
      }"
      

  • CRASH [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • CRASH [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html (#24057)
  • CRASH [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/sandbox-top-navigation-cross-site.tentative.sub.window.html (#31754)
    • TIMEOUT [expected FAIL] subtest: A cross-site unsandboxed iframe navigation consumes user activation and disallows top-level navigation.

      Test timed out
      

  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • PASS [expected FAIL] subtest: text/plain: 0x00 in name (normal form)
    • PASS [expected FAIL] subtest: text/plain: 0x00 in filename (formdata event)
    • PASS [expected FAIL] subtest: text/plain: \r\n in name (normal form)
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • PASS [expected FAIL] subtest: The end: DOMContentLoaded and defer scripts
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • PASS [expected FAIL] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document
  • TIMEOUT [expected PASS] /streams/readable-streams/crashtests/strategy-worker-terminate.html
  • OK [expected TIMEOUT] /webmessaging/with-ports/018.html (#24485)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, javascript:
  • OK [expected TIMEOUT] /webmessaging/without-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank
  • OK [expected TIMEOUT] /webmessaging/without-ports/018.html (#24485)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, javascript:
  • OK [expected ERROR] /workers/constructors/Worker/Worker-constructor.html (#22991)
Stable unexpected results that are known to be intermittent (8)
  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • FAIL [expected PASS] /css/css-sizing/dynamic-available-size-iframe.html (#31559)
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • TIMEOUT [expected FAIL] subtest: sec-fetch-site - Not sent to non-trustworthy same-site destination, no attributes

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: sec-fetch-site - Not sent to non-trustworthy cross-site destination, no attributes
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • PASS [expected FAIL] subtest: load &amp; pageshow events do not fire on contentWindow of &lt;iframe&gt; element created with src='about:blank'
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK [expected TIMEOUT] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html (#29724)
    • PASS [expected TIMEOUT] subtest: reparent-form-during-planned-navigation-task
  • OK /workers/WorkerGlobalScope-close.html (#23064)
    • PASS [expected FAIL] subtest: Test sending a message after closing.

Copy link

✨ Try run (#8705706012) succeeded.

Copy link
Contributor

@Loirooriol Loirooriol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These cases are not consistent:

<!DOCTYPE html>
<div style="float: left; width: 100px; height: 100px; background: cyan"></div>
<div style="height: 50px; width: 150px; background: magenta"></div>
<br style="clear: both; display: inline; margin-top: 100px">a
<hr>
<div style="float: left; width: 100px; height: 100px; background: cyan"></div>
<div style="height: 50px; width: 150px; background: magenta"></div>
<br style="clear: both; display: block; margin-top: 100px">a
Servo Gecko Blink

But Gecko and Blink, while self-consistent, are not interoperable, so I guess it's fine. Also setting display on a <br> is quite broken in general.

@mrobinson mrobinson added this pull request to the merge queue Apr 17, 2024
Merged via the queue into servo:main with commit 4ec61c2 Apr 17, 2024
39 checks passed
@mrobinson mrobinson deleted the add-clear-support-for-br branch April 17, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clear:both not working when applied to <br> element Rendering bug on SSL Labs Support <br clear="foo">
2 participants