These two fixes are related to the wikipedia metabug #2554.
They don't make the wikipedia page look better (they cause a slight regression in the top caption table), but they are prerequisites for fixing some of the other layout issues that remain.
Added reftests for each of the three cases I have come across that this patch solves.
The code that managed ranges was buggy - failing on edge cases
such as a span within a span. I have refactored the code so that the
context information for inline formatting can optionally be stored
within a fragment. This seems cleaner to me, and fixes the bugs
encountered when making these changes by removing the need for
the fixup() functionality (and ranges).
The rendering is incorrect
and the test is marked as flaky on Linux or on GPU rendering,
but this should help catch further regressions.
The test is modified to add the following CSS:
.intro { display: none }
html #top { margin-top: 0 }
To disable the "scrolling" part of the test.
The reference is modified to match the current rendering of the test:
* Rows 4 and 5 (eyes) have a red background.
* The nose is not quite where it should be.
* Row 12’s height is 3px more than it should be.
(See http://www.webstandards.org/action/acid2/guide/ for row numbers.)
The nose issue seems be related to rounding vs truncating
when pixel-snapping borders, but this is only a guess.
According to the CSS specification, section 8.3.1, margins of the root
element's box do not collapse. Ensure that root flow margins do not
collapse during the assign heights phase.
When a frame is selected via set_ids, a tree of root compositor
layers is also created, matching the tree of pipelines in the frame.
This decouples the chronological ordering dependency for parent frames
and child iframes sending CreateOrUpdateRootLayer &
CreateOrUpdateDescendentLayer messages.
Change the Compositor ready and render states to per pipeline.
This ensures the compositor doesn't composite for an epoch until
every *pipeline* in the epoch is finished rendering.
For iframes it fixes a bug where the compositor didnt wait on the
child pipeline ready state before compositing the window.
Gotchas:
* layout task or script task failure on exit ("task '' failed at sending
on a closed channel"), this happens if the child iframe shares the
same script task as the parent and can be avoided by adding the
sandbox attribute to the iframe.
Other changes:
* Inline set_clipping_rect in compositor.rs
* Commented out ref test simple_iframe.html fails on os x
Issue https://github.com/mozilla/servo/issues/2848 has details.
This commit uncomments the borders ref test in basic.list
and modifies the test to work with viewports up to 4096px wide.
Also as a workaround change the html element background to white,
otherwise pixel (0,0) is black (it should be white since the border
at pixel (0, 0) is white. The bug is mostly likely a regression
in rust-layers.
This test has been failing locally on OS X for me for quite some time,
although since #2843 this started affecting the Travis builders as well.
Getting to the root of this problem is tracked by #2848.
When creating child layers it is important to consider overflow when
determining the size of the layer. This also means that overflow should
not be too large, so also shrink block width down to the size of their
contained fragment. This means that a block that has been explicitly
sized to width:100px should be 100 pixels wide instead of the width of
its containing block.
Even though we don't recompute non-inherited properties here, we still need
to compute properties that are derived from them. Fixes#2498: because
text-decoration is not inherited, -servo-text-decorations-in-effect was not
derived correctly for cached declarations.
The first layer implicitly provides the size of the page, but child
layer background colors can still improperly override the body
background color. This commit ensures that layer background colors only
apply to layers with the same id and pipeline id. Additionally the root
layer's unrendered color is defined by the first layer's background
color, just like for size.
Instead, use shared code to parse stylesheet content when it is inserted,
whether during parsing or dynamically by script.
Based on work by sanools in #1350.
See #2090
One reftest compares a green image to a white div. The other has green text being compared with normal text.
If necessary, I can add some absolute positioning ones.
There were two problems here: (1) we did not process style sheets with an
unexpected `rel` attribute but a correct MIME type; (2) we did not
consider `none` a valid value for the `background` property.
+ Divide the width code into several methods.
+ Bring in the various width calculation methods into the trait
methods (like for blocks, floats, absolute flows, etc.)
+ Calculate margin top and bottom during assign width even for absolute
flows.
+ Add the Replaced versions for Floats and Absolute flows.
This only traverses absolute flows, nothing else.
+ Also, a separate mini-traversal for store overflow.
+ Store descendants with position 'absolute' and 'fixed' in BaseFlow.
+ Bubble up links to absolute and fixed descendants during Flow Construction.
+ Set Rawlink to the CB in absolute descendants.
+ store_overflow() now uses absolute descendants' overflows too.
+ Add reftests for 'absolute' and 'fixed' static y position.
+ Add reftests for overflow (they all fail now).
+ Put absolute flow display items under their CB's ClipDisplayItem.
+ Paint borders in Box_ before the actual box stuff (minor fix in lieu of paint-order).
Back in 2012, Brian wrote a reftest system using Firefox via Selenium to
generate comparison images. This seems like a pretty cool idea, but we
didn't maintain it and important pieces are now missing.
Let's remove it from the working tree to avoid confusion with the current
reftest system, and I'll open a ticket about revisiting this idea.
One pair of old reftest files seems usable as a new reftest and that move is
included in this commit.