Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement the line-height calculation quirk #11853
Conversation
highfive
commented
Jun 24, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jun 24, 2016
|
@bors-servo try |
Implement the line-height calculation quirk
|
@notriddle Would you be interested in reviewing this change? |
|
|
|
@jdm Sure. |
|
@bors-servo delegate=notriddle |
|
|
| border.border_left_width == Au(0) && | ||
| border.border_right_width == Au(0) && | ||
| padding.padding_left.is_definitely_zero() && | ||
| padding.padding_right.is_definitely_zero() |
This comment has been minimized.
This comment has been minimized.
notriddle
Jun 24, 2016
Contributor
is_definitely_zero is, as the name implies, not an exhaustive test for whether the "used property" of a value is zero. The spec asks for the used value.
How hard would it be to get the used value here?
This comment has been minimized.
This comment has been minimized.
pcwalton
Jul 25, 2016
•
Contributor
Shouldn't be hard; use the self.border_padding field.
Edit: Never mind, this is not called at a point where that is available.
|
Other than that and not having any tests, LGMT. |
|
Looking through the IRC backlog, it looks like the used value only exists after layout. So no code changes needed, just adding a reftest should work. |
|
The definitely bits scare me. Can we produce a test where the used value is zero, but not definitely zero? |
|
It isn't scary, it just means it won't catch cases where the padding is |
|
If we willfully ignore the spec, we should file an issue. |
|
If none of the browsers implement the spec as written, we should file a bug against the spec. |
|
components/layout/inline.rs, line 1833 [r1] (raw file):
|
|
Reviewed 1 of 3 files at r1. Comments from Reviewable |
|
Reviewed 2 of 3 files at r1, 1 of 1 files at r2. Comments from Reviewable |
|
I don't think we're deviating from the spec. The definition of used value is:
So I don't think we need the specified value at all here, the computed value is more than enough. |
|
@emilio The problem is that the used value is "more computed" than the computed values, and that |
|
Ahh, I get it, sorry then... Yeah, this wouldn't catch less-tricky cases as "computed value is 10%", but width is 0 thing, right? In that case I agree with @Ms2ger, a spec bug should be open at least, though given how servo does layout I doubt it's possible to fix this easily. |
|
This quirk should also be present in limited-quirks mode. |
| SpecificFragmentInfo::ScannedText(_) => true, | ||
| _ => false, | ||
| } | ||
| }) |
This comment has been minimized.
This comment has been minimized.
pcwalton
Jul 25, 2016
Contributor
nit: How about self.fragments.fragments.iter().any(Fragment::is_scanned_text_fragment)?
|
It's not clear to me from reading the previous comments on what the status is here. Are we waiting on some other piece of work, or spec discussion? I seem to recall @nox mentioning that these changes were incomplete in some way, but I might be misremembering. Who's responsible for taking the next step here? |
|
"The fix is completely wrong." Either he fixes it or it goes back into the big pot of unassigned issues. |
|
|
nox commentedJun 24, 2016
•
edited by larsbergstrom
This change is