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

Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT. #14035

Merged
merged 3 commits into from Nov 10, 2016

Conversation

@Permutatrix
Copy link
Contributor

Permutatrix commented Nov 3, 2016

This change allows inline margins, borders, and padding to interact correctly with {ib} splits.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #14030
  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

highfive commented Nov 3, 2016

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Ms2ger (or someone else) soon.

@highfive
Copy link

highfive commented Nov 3, 2016

Heads up! This PR modifies the following files:

  • @emilio: components/layout/construct.rs
@emilio
Copy link
Member

emilio commented Nov 3, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Nov 3, 2016

Trying commit 8279114 with merge 744cf46...

bors-servo added a commit that referenced this pull request Nov 3, 2016
Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT.

<!-- Please describe your changes on the following line: -->
This change allows inline margins, borders, and padding to interact correctly with {ib} splits.

---
<!-- 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 #14030
<!-- -->
- [X] There are tests for these changes

<!-- 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/14035)
<!-- Reviewable:end -->
@@ -222,7 +248,7 @@ impl InlineFragmentsAccumulator {
pseudo: node.get_pseudo_element_type().strip(),
style: node.style(style_context),
selected_style: node.selected_style(),
flags: InlineFragmentNodeFlags::empty(),
flags: FIRST_FRAGMENT_OF_ELEMENT | LAST_FRAGMENT_OF_ELEMENT,

This comment has been minimized.

Copy link
@emilio

emilio Nov 3, 2016

Member

This looks good to me, but I wonder if there's a way to organize this so this doesn't start with this flags. It feels weird to use these flags here since we always remove them in to_intermediate_inline_fragments.

Maybe keeping in the accumulator something like saw_ib_split flag or similar, and don't insert the flags in that case?

This comment has been minimized.

Copy link
@Permutatrix

Permutatrix Nov 3, 2016

Author Contributor

I think of InlineFragmentsAccumulator's enclosing_node as representing the "whole" InlineFragmentNodeInfo for this accumulator, i.e. what it would be if it was all one fragment. It's split in two each time an {ib} split is encountered, then split up again in to_intermediate_inline_fragments. I'm not convinced that it's conceptually more reasonable to save instructions for how to mark the nodes and follow them as late as possible rather than simply handling it this way as we go.

Practically speaking, Servo will one day have to handle the positioning of backgrounds across multiple line boxes. Information about this will likely be stored in InlineFragmentNodeInfo. Using a conceptual model that allows that information to be reused will make it easier.

Comments would definitely help, though. If we stick with my model, I'll add some explaining it.

This comment has been minimized.

Copy link
@Permutatrix

Permutatrix Nov 3, 2016

Author Contributor

Actually, I suppose information about positioning backgrounds won't be split at this stage. But, uh, you know... Something else could be. In theory.

This comment has been minimized.

Copy link
@pcwalton

pcwalton Nov 8, 2016

Contributor

I concur with @Permutatrix; let's make things as simple as possible. But definitely comment this explaining how things work and the rationale.

@bors-servo
Copy link
Contributor

bors-servo commented Nov 3, 2016

💔 Test failed - linux-rel-css

@highfive
Copy link

highfive commented Nov 3, 2016

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-015.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-015.htm f8e79ff73dc35295804b13d87eab4cd865e38b1d
/css-text-3_dev/html/reference/css3-text-line-break-opclns-015-ref.htm 7c6a28563e81830e495a39b5f3e330a451b159bb
Testing f8e79ff73dc35295804b13d87eab4cd865e38b1d == 7c6a28563e81830e495a39b5f3e330a451b159bb

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-014.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-014.htm 61f979a39fbbfa31e4ea1a6c17f6750c8f3725ed
/css-text-3_dev/html/reference/css3-text-line-break-opclns-014-ref.htm 491175f313283d2b697821fcd32f219d7c893538
Testing 61f979a39fbbfa31e4ea1a6c17f6750c8f3725ed == 491175f313283d2b697821fcd32f219d7c893538

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-016.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-016.htm 8c2d1348e1986079d4444079a09494265a0ed12b
/css-text-3_dev/html/reference/css3-text-line-break-opclns-016-ref.htm 3554fe6375cd9c7f5c7485500ba5c60d79bb6958
Testing 8c2d1348e1986079d4444079a09494265a0ed12b == 3554fe6375cd9c7f5c7485500ba5c60d79bb6958

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-020.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-020.htm e5012808fba17daa51408aa2ac69eaa413ad2333
/css-text-3_dev/html/reference/css3-text-line-break-opclns-020-ref.htm d4babe9b789027d9e320564b6b5c4966099b6da4
Testing e5012808fba17daa51408aa2ac69eaa413ad2333 == d4babe9b789027d9e320564b6b5c4966099b6da4

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-019.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-019.htm de8db60f480534ce37fe1474fd0fffd09ce2cdc0
/css-text-3_dev/html/reference/css3-text-line-break-opclns-019-ref.htm 2148c53841ae125941772b5a73d0a9f72f7de20f
Testing de8db60f480534ce37fe1474fd0fffd09ce2cdc0 == 2148c53841ae125941772b5a73d0a9f72f7de20f

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-018.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-018.htm fb4f5452a6274f73f0f0c14bd583f6c83039d4ff
/css-text-3_dev/html/reference/css3-text-line-break-opclns-018-ref.htm 8c1ae6293027f68fa0de8e73f7b94e8a95fed5ec
Testing fb4f5452a6274f73f0f0c14bd583f6c83039d4ff == 8c1ae6293027f68fa0de8e73f7b94e8a95fed5ec

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-023.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-023.htm 84976e54167032f80607e64ae9700bd1978c6f30
/css-text-3_dev/html/reference/css3-text-line-break-opclns-023-ref.htm 31b0f5b321d7129fa9e20c0d4cfbdb2b303f87c5
Testing 84976e54167032f80607e64ae9700bd1978c6f30 == 31b0f5b321d7129fa9e20c0d4cfbdb2b303f87c5

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-120.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-120.htm ac6b55a069326d64e8880848ed1e2ae9e5adfbaf
/css-text-3_dev/html/reference/css3-text-line-break-opclns-120-ref.htm d5b49d26c38c415327c7f36c113b4d90dfcc6819
Testing ac6b55a069326d64e8880848ed1e2ae9e5adfbaf == d5b49d26c38c415327c7f36c113b4d90dfcc6819

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-119.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-119.htm 311c1c4db0a40b9cef8fbe3fe36637b470f89e16
/css-text-3_dev/html/reference/css3-text-line-break-opclns-119-ref.htm 090e6a27a1e539c8594bb61edeffa47631f2d873
Testing 311c1c4db0a40b9cef8fbe3fe36637b470f89e16 == 090e6a27a1e539c8594bb61edeffa47631f2d873

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-122.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-122.htm 124022eba63504aaa05caf152f1f5965ede81d62
/css-text-3_dev/html/reference/css3-text-line-break-opclns-122-ref.htm 54fe158f0b787221168158b5a28a90b7016d3787
Testing 124022eba63504aaa05caf152f1f5965ede81d62 == 54fe158f0b787221168158b5a28a90b7016d3787

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-125.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-125.htm d83b12118c4faa33027d5becd1f4fb21eaac6de6
/css-text-3_dev/html/reference/css3-text-line-break-opclns-125-ref.htm 3b9f729d4d2d15c9975dc1cac231a97771532672
Testing d83b12118c4faa33027d5becd1f4fb21eaac6de6 == 3b9f729d4d2d15c9975dc1cac231a97771532672

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-124.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-124.htm ad75f2e379c27aed968c6a823532a636e74087ce
/css-text-3_dev/html/reference/css3-text-line-break-opclns-124-ref.htm f728041eb0e34743789d6e5c322d6bd4abf2d7f6
Testing ad75f2e379c27aed968c6a823532a636e74087ce == f728041eb0e34743789d6e5c322d6bd4abf2d7f6

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-123.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-123.htm 941d61740e6a3b687717c5ee53ac55cd24afceba
/css-text-3_dev/html/reference/css3-text-line-break-opclns-123-ref.htm 1f5c344cc1d92d5f01d71a8c4d870bce707b697e
Testing 941d61740e6a3b687717c5ee53ac55cd24afceba == 1f5c344cc1d92d5f01d71a8c4d870bce707b697e

  ▶ FAIL [expected PASS] /css-text-3_dev/html/css3-text-line-break-opclns-128.htm
  └   → /css-text-3_dev/html/css3-text-line-break-opclns-128.htm dc685a0d62f1f095f471960f7aa4e64bbbec0132
/css-text-3_dev/html/reference/css3-text-line-break-opclns-128-ref.htm 0a3a629cc71356657b0c3fd8ffdb197e28323083
Testing dc685a0d62f1f095f471960f7aa4e64bbbec0132 == 0a3a629cc71356657b0c3fd8ffdb197e28323083

  ▶ FAIL [expected PASS] /css-text-3_dev/html/word-break-normal-002.htm
  └   → /css-text-3_dev/html/word-break-normal-002.htm c66c86cd5a673e2052e0130da76f1518fdf5d0c1
/css-text-3_dev/html/reference/word-break-normal-002-ref.htm 2cd9afc05d29f3991c889f9dc4999bd056455e7e
Testing c66c86cd5a673e2052e0130da76f1518fdf5d0c1 == 2cd9afc05d29f3991c889f9dc4999bd056455e7e
@notriddle
Copy link
Contributor

notriddle commented Nov 3, 2016

Sorry, but the "opclns" tests and "word-break-normal" pass on real desktop installs but fail in CI. It's font-related, I think. Remove those test expectations, and try should pass.

@Permutatrix Permutatrix force-pushed the Permutatrix:iss-14030 branch from 8279114 to 6321f70 Nov 3, 2016
@highfive highfive removed the S-tests-failed label Nov 3, 2016
@Permutatrix
Copy link
Contributor Author

Permutatrix commented Nov 3, 2016

Thanks, @notriddle.

@notriddle
Copy link
Contributor

notriddle commented Nov 3, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Nov 3, 2016

Trying commit 6321f70 with merge df68c13...

bors-servo added a commit that referenced this pull request Nov 3, 2016
Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT.

<!-- Please describe your changes on the following line: -->
This change allows inline margins, borders, and padding to interact correctly with {ib} splits.

---
<!-- 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 #14030
<!-- -->
- [X] There are tests for these changes

<!-- 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/14035)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 4, 2016

💥 Test timed out

@emilio
Copy link
Member

emilio commented Nov 4, 2016

@bors-servo retry

@notriddle
Copy link
Contributor

notriddle commented Nov 4, 2016

@bors-servo clean try

@bors-servo
Copy link
Contributor

bors-servo commented Nov 4, 2016

Trying commit 6321f70 with merge dc8e468...

bors-servo added a commit that referenced this pull request Nov 4, 2016
Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT.

<!-- Please describe your changes on the following line: -->
This change allows inline margins, borders, and padding to interact correctly with {ib} splits.

---
<!-- 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 #14030
<!-- -->
- [X] There are tests for these changes

<!-- 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/14035)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 5, 2016

💥 Test timed out

@notriddle
Copy link
Contributor

notriddle commented Nov 5, 2016

Last attempt

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Nov 5, 2016

Trying commit 6321f70 with merge 8ff2958...

bors-servo added a commit that referenced this pull request Nov 5, 2016
Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT.

<!-- Please describe your changes on the following line: -->
This change allows inline margins, borders, and padding to interact correctly with {ib} splits.

---
<!-- 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 #14030
<!-- -->
- [X] There are tests for these changes

<!-- 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/14035)
<!-- Reviewable:end -->
@SimonSapin
Copy link
Member

SimonSapin commented Nov 5, 2016

Trying to get homu unstuck.

bors-servo added a commit that referenced this pull request Nov 5, 2016
Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT.

<!-- Please describe your changes on the following line: -->
This change allows inline margins, borders, and padding to interact correctly with {ib} splits.

---
<!-- 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 #14030
<!-- -->
- [X] There are tests for these changes

<!-- 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/14035)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 5, 2016

@Permutatrix
Copy link
Contributor Author

Permutatrix commented Nov 6, 2016

Cool. So, are we doing things my way or @emilio's? Any more thoughts on that?

@emilio
Copy link
Member

emilio commented Nov 6, 2016

I don't really care that much as long as it's well documented, but probably @pcwalton or @notriddle have some opinions on it?

@notriddle
Copy link
Contributor

notriddle commented Nov 6, 2016

No complaints here about doing it the @Permutatrix way.

@Permutatrix Permutatrix force-pushed the Permutatrix:iss-14030 branch from f202bfa to 0db5c55 Nov 7, 2016
@Permutatrix
Copy link
Contributor Author

Permutatrix commented Nov 7, 2016

Okay, I've added a comment about enclosing_node. Should @Ms2ger look at this now?

@Ms2ger
Copy link
Contributor

Ms2ger commented Nov 7, 2016

Calling not it, I don't know anything about layout :)

r? @SimonSapin

@highfive highfive assigned SimonSapin and unassigned Ms2ger Nov 7, 2016
@emilio
Copy link
Member

emilio commented Nov 9, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2016

📌 Commit 0db5c55 has been approved by emilio

@highfive highfive assigned emilio and unassigned SimonSapin Nov 9, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Nov 9, 2016

Testing commit 0db5c55 with merge d55a832...

bors-servo added a commit that referenced this pull request Nov 9, 2016
Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT.

<!-- Please describe your changes on the following line: -->
This change allows inline margins, borders, and padding to interact correctly with {ib} splits.

---
<!-- 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 #14030
- [X] There are tests for these changes

<!-- 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/14035)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 10, 2016

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Nov 10, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Nov 10, 2016

Testing commit 0db5c55 with merge 959dfe4...

bors-servo added a commit that referenced this pull request Nov 10, 2016
Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT.

<!-- Please describe your changes on the following line: -->
This change allows inline margins, borders, and padding to interact correctly with {ib} splits.

---
<!-- 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 #14030
- [X] There are tests for these changes

<!-- 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/14035)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 10, 2016

@bors-servo bors-servo merged commit 0db5c55 into servo:master Nov 10, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

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