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

Intermittent failure in /_mozilla/css/last_of_type_pseudo_a.html #8191

Closed
jdm opened this issue Oct 25, 2015 · 4 comments
Closed

Intermittent failure in /_mozilla/css/last_of_type_pseudo_a.html #8191

jdm opened this issue Oct 25, 2015 · 4 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Oct 25, 2015

Looks like a layout issue.
screen shot 2015-10-25 at 12 06 36 pm

@KiChjang KiChjang changed the title Intermittent failure in _mozilla/css/last_of_type_pseudo_a.html Intermittent failure in /_mozilla/css/last_of_type_pseudo_a.html Feb 19, 2016
@nox
Copy link
Member

@nox nox commented Feb 19, 2016

With this in last_of_type_pseudo_a.html:

    <div id="d1">
      <p> </p>
      <div> </div>
      <div> </div>
      <p> </p>
      <address> </address>
      <p> </p>
      <div> </div>
      <p> </p>
      <p> </p>
      <address> </address>
<!--       <address class="ok"> </address>
      <p> </p>
      <div class="ok"> </div>
      <p> </p>
      <p class="ok"> </p> -->
    </div>

We get:

capture d ecran 2016-02-19 a 14 45 37

Seems like layout is done when the document isn't complete and these nodes aren't styled again when the rest is finally parsed and handled.

@nox
Copy link
Member

@nox nox commented Feb 19, 2016

<!DOCTYPE html>
<html>
  <head>
    <link rel='match' href='last_of_type_pseudo_b.html'>
    <title>:last-of-type test</title>
    <style type="text/css">
      html { background: red; }
      /* Should match according to Selectors Level 4 (changed from Level 3) */
      html:last-of-type { background: white; }

      div > p,
      div > div,
      div > address {
          float: left;
          width: 20px;
          height: 20px;
          margin: 0px;
          margin-right: 10px;
          padding: 0px;
      }
      div > p {
          background: white;
      }
      div > div,
      div > address {
          background: black;
      }
      body > div { clear: both; margin-bottom: 10px; }

      #d1 > .ok { background: red; }
      #d1 > *:last-of-type { background: green }

    </style>
    <script>
      setTimeout(function() {
        var d1 = document.getElementById("d1");
        var address = document.createElement("address");
        address.classList.add("ok");
        d1.appendChild(address);
        console.log("ok");
      }, 1000);
    </script>
  </head>
  <body>
    <div id="d1">
      <p> </p>
      <div> </div>
      <div> </div>
      <p> </p>
      <address> </address>
      <p> </p>
      <div> </div>
      <p> </p>
      <p> </p>
      <address> </address>
<!--       <address class="ok"> </address>
      <p> </p>
      <div class="ok"> </div>
      <p> </p>
      <p class="ok"> </p> -->
    </div>
  </body>
</html>
@jdm
Copy link
Member Author

@jdm jdm commented Feb 19, 2016

That last testcase works with -i (ie. incremental reflow disabled).

@KiChjang
Copy link
Member

@KiChjang KiChjang commented Feb 22, 2016

Disabled in #9716

mbrubeck added a commit to mbrubeck/rust-selectors that referenced this issue Feb 22, 2016
mbrubeck added a commit to mbrubeck/servo that referenced this issue Feb 22, 2016
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.  Fixes servo#8191
and other intermittent layout bugs.

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
mbrubeck added a commit to mbrubeck/servo that referenced this issue Feb 22, 2016
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.  Fixes servo#8191
and servo#9063, and other intermittent layout bugs.

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
mbrubeck added a commit to mbrubeck/rust-selectors that referenced this issue Feb 23, 2016
bors-servo added a commit to servo/rust-selectors that referenced this issue Feb 23, 2016
Mark elements whose children are affected by "slow" selectors

This required by the fix for servo/servo#8191. r? @SimonSapin

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-selectors/71)
<!-- Reviewable:end -->
mbrubeck added a commit to mbrubeck/servo that referenced this issue Feb 23, 2016
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.  Fixes servo#8191
and servo#9063, and other intermittent layout bugs.

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
mbrubeck added a commit to mbrubeck/servo that referenced this issue Feb 23, 2016
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes servo#8191
* Fixes servo#9063
* Fixes servo#9303
* Fixes servo#9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
mbrubeck added a commit to mbrubeck/servo that referenced this issue Feb 23, 2016
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes servo#8191
* Fixes servo#9063
* Fixes servo#9303
* Fixes servo#9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
mbrubeck added a commit to mbrubeck/servo that referenced this issue Feb 24, 2016
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes servo#8191
* Fixes servo#9063
* Fixes servo#9303
* Fixes servo#9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
mbrubeck added a commit to mbrubeck/servo that referenced this issue Feb 24, 2016
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes servo#8191
* Fixes servo#9063
* Fixes servo#9303
* Fixes servo#9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
bors-servo added a commit that referenced this issue Feb 24, 2016
Dirty elements whose selectors are affected by sibling changes

This fixes incremental layout of nodes that match pseudo-class selectors such as :first-child, :nth-child, :last-child, :first-of-type, etc.  Fixes #8191 and other intermittent layout bugs.

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134

Depends on servo/rust-selectors#71. r? @SimonSapin

There are a couple of TODO items in this commit, but I'd appreciate feedback on the general approach before I finish it up.  (Also, if someone who knows more than I do could give some advice about atomic orderings...)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9722)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.