Skip to content

Inline pseudo elements layout#12367 - #12669

Merged
bors-servo merged 4 commits into
servo:masterfrom
splav:inline_pseudo_elements_layout#12367
Aug 11, 2016
Merged

bors-servo merged 4 commits into
servo:masterfrom
splav:inline_pseudo_elements_layout#12367

Conversation

@splav

@splav splav commented Jul 31, 2016 •

Copy link
Copy Markdown
Contributor

This PR fixes ignored paddings and margins for inline pseudo elements.


  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive highfive assigned ghost Jul 31, 2016
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 31, 2016
@splav

splav commented Jul 31, 2016

Copy link
Copy Markdown
Contributor Author

This is a first version, another part is missing - in the following case the green zone is calculated incorrectly and a line is broken:

<!DOCTYPE html>
<html><head><style type="text/css">
  span:before {
    content:"a";
    margin-right:5em;
  }
  span:after {
    content:"c";
    margin-left:5em;
  }
  span {
    margin-left:4em;
    margin-right:4em;
  }
</style></head>
<body><div style="position: absolute; top: 20px;"><span>b</span></div></body>
</html>

@ghost

ghost commented Jul 31, 2016

Copy link
Copy Markdown

r? @mbrubeck or someone else

@highfive highfive assigned mbrubeck and unassigned ghost Jul 31, 2016
@jdm

jdm commented Jul 31, 2016

Copy link
Copy Markdown
Member

Want to review this, @notriddle?

@notriddle

Copy link
Copy Markdown
Contributor

Yeah, that sounds like something I could help with.

@KiChjang

Copy link
Copy Markdown
Contributor

@bors-servo delegate=notriddle

r? @notriddle

@bors-servo

Copy link
Copy Markdown
Contributor

✌️ @notriddle can now approve this pull request

@highfive highfive assigned notriddle and unassigned mbrubeck Jul 31, 2016
@splav

splav commented Jul 31, 2016 •

Copy link
Copy Markdown
Contributor Author

@notriddle may be change to something like this:

<style type="text/css">
  span:before { content:"a"; margin-right:5em; }
  span:after { content:"c"; margin-left:5em; }
  #first { margin-left:4em; margin-right:4em; }
  #second:before { margin-left:4em; }
  #second:after { margin-right:4em; }
</style>
<body>
    |<span id=first>b</span>|<br>
    |<span id=second>b</span>|
</body>

and

<style type="text/css">
  span:before { content:"a"; padding-right:5em; }
  span:after { content:"c"; padding-left:5em; }
  #first { padding-left:4em; padding-right:4em; }
  #second:before { padding-left:4em; }
  #second:after { padding-right:4em; }
</style>

<body>
    |<span id=first>b</span>|<br>
    |<span id=second>b</span>|
</body>

Could you please comment if the main idea of the fix is correct? I'm not very sure that both style-fixing functions can be just skipped for pseudo elements. I've read the specs and couldn't imagine the appropriate cases, but I didn't have much experience with CSS and could miss something.

@notriddle

Copy link
Copy Markdown
Contributor

The modified version of the test looks good.

The big problem that the modify function tries to solve is that the style of the base element is copied verbatim to the pseudo-element. I think that was actually fixed in the style code awhile back. Let's try it.

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 8c8f5dd with merge 718cbfd...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 31, 2016
@highfive

Copy link
Copy Markdown
  ▶ FAIL [expected PASS] /css21_dev/html4/insert-inline-in-blocks-n-inlines-begin-003.htm
  └   → /css21_dev/html4/insert-inline-in-blocks-n-inlines-begin-003.htm daa5c6726760140eb39cfd0ef842bc0a337bd0d6
/css21_dev/html4/reference/insert-inline-in-blocks-n-inlines-begin-003-ref.htm 11aaba585e29d82ac7512d6f646fa3a6962167f8
Testing daa5c6726760140eb39cfd0ef842bc0a337bd0d6 == 11aaba585e29d82ac7512d6f646fa3a6962167f8

  ▶ FAIL [expected PASS] /css21_dev/html4/insert-inline-in-blocks-n-inlines-middle-003.htm
  └   → /css21_dev/html4/insert-inline-in-blocks-n-inlines-middle-003.htm 84814dc899e920095373d52c0a0cca063929bce7
/css21_dev/html4/reference/insert-inline-in-blocks-n-inlines-middle-003-ref.htm 021252e76c13ae9d890</span><span class="stdout">677f08d3b957f46be4c3f
Testing 84814dc899e920095373d52c0a0cca063929bce7 == 021252e76c13ae9d890677f08d3b957f46be4c3f

  ▶ Unexpected subtest result in /css-transitions-1_dev/html/pseudo-elements-001.htm:
  └ PASS [expected FAIL] transition padding-left on :before, changing content / values

  ▶ Unexpected subtest result in /css-transitions-1_dev/html/pseudo-elements-001.htm:
  └ PASS [expected FAIL] transition padding-left on :after, changing content / values

  ▶ Unexpected subtest result in /css21_dev/html4/pseudo-elements-001.htm:
  └ PASS [expected FAIL] transition padding-left on :before, changing content / values

  ▶ Unexpected subtest result in /css21_dev/html4/pseudo-elements-001.htm:
  └ PASS [expected FAIL] transition padding-left on :after, changing content / values

@notriddle

Copy link
Copy Markdown
Contributor

The passes look good, since they're part of your PR. I'm not sure about the failures, because there aren't any pseudo elements in either of those tests to trigger your code changes.

@notriddle

notriddle commented Aug 1, 2016 •

Copy link
Copy Markdown
Contributor

Reverting c1243fe, the one that prevents text fragments from being merged, fixes the test failures. Reverting f787f3a, the one that stops pseudo-element styles from being reset, does not. (I ran the failing tests on my box to check them.)

So turning off the style reset didn't cause any tests to fail, and it makes sense that we need to store the style of the pseudo-elements somewhere, since they're not going to get their own flows, so let's put it in the fragments.

@splav

splav commented Aug 1, 2016

Copy link
Copy Markdown
Contributor Author

@notriddle OK, thank you. I'll investigate what's going on in failed tests. And also in the case with absolutely positioned div, I've posted before.

@notriddle

notriddle commented Aug 9, 2016 •

Copy link
Copy Markdown
Contributor

@bors-servo retry

Let's see how #12760 affected the test results.

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 8c8f5dd with merge 68096b8...

bors-servo pushed a commit that referenced this pull request Aug 9, 2016
…try>

Inline pseudo elements layout#12367

<!-- Please describe your changes on the following line: -->
This PR fixes ignored paddings and margins for inline pseudo elements.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12367 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12669)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Aug 9, 2016
@splav
splav force-pushed the inline_pseudo_elements_layout#12367 branch from 8c8f5dd to d3ccbc5 Compare August 9, 2016 19:57
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Aug 9, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit d3ccbc5 with merge 4ca4c7c...

bors-servo pushed a commit that referenced this pull request Aug 10, 2016
…otriddle

Inline pseudo elements layout#12367

<!-- Please describe your changes on the following line: -->
This PR fixes ignored paddings and margins for inline pseudo elements.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12367 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12669)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Aug 10, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 10, 2016
@highfive

Copy link
Copy Markdown
  ▶ FAIL [expected PASS] /css-transforms-1_dev/html/transform-table-007.htm
  └   → /css-transforms-1_dev/html/transform-table-007.htm a5c014b20ef1363bea6f24eda28c7efb7c45698a
/css-transforms-1_dev/html/reference/transform-blank-ref.htm fa6407b1acbbfea27e27061e7d1bdeca98e4a728
Testing a5c014b20ef1363bea6f24eda28c7efb7c45698a == fa6407b1acbbfea27e27061e7d1bdeca98e4a728

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #12757) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Aug 11, 2016
@splav
splav force-pushed the inline_pseudo_elements_layout#12367 branch from d3ccbc5 to a9c1817 Compare August 11, 2016 07:34
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Aug 11, 2016
@splav

splav commented Aug 11, 2016 •

Copy link
Copy Markdown
Contributor Author

@jdm rebased to current master.

@notriddle

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit a9c1817 has been approved by notriddle

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. labels Aug 11, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit a9c1817 with merge 9ffda4c...

bors-servo pushed a commit that referenced this pull request Aug 11, 2016
…otriddle

Inline pseudo elements layout#12367

<!-- Please describe your changes on the following line: -->
This PR fixes ignored paddings and margins for inline pseudo elements.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12367 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12669)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo
bors-servo merged commit a9c1817 into servo:master Aug 11, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 11, 2016
@splav
splav deleted the inline_pseudo_elements_layout#12367 branch August 11, 2016 13:13
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.

Margins of inline pseudo elements(:before and :after) are ignored.

7 participants