Commit graph

82 commits

Author SHA1 Message Date
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Glenn Watson
4cb9f32427 Fix inline size bubbling with fixed width block. Improve intrinsic inline size calculation for text fragments.
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.
2014-09-05 16:41:13 +10:00
Glenn Watson
e4e1c71d48 Add support for borders on inline elements.
Fix ahem reftests on mac, by disabling text AA in reftest mode.

Also fix precision issues in font metrics to correct height
and baseline calculations.
2014-09-03 07:16:17 +10:00
Matt Brubeck
024ce539fd Fix <br> support 2014-08-27 10:00:23 -07:00
Glenn Watson
fa6b59901a Add support for backgrounds on inline elements. Fix fixup() by removing it.
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).
2014-08-27 13:03:08 +10:00
Simon Sapin
a29ab0e47c Add a reftest for basic block layout in a vertical writing mode. 2014-08-26 21:24:46 +01:00
Simon Sapin
4d4c034600 Add a (broken) Acid2 reftest. Fix #1993
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.
2014-08-21 22:01:37 +01:00
Martin Robinson
65fce97f51 Prevent margin collapse in the root flow
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.
2014-08-18 12:16:09 -07:00
Glenn Watson
2ff7949775 Ensure that block elements with replaced content don't get their block size overwritten. 2014-08-18 10:43:53 +10:00
Glenn Watson
f287340af2 Add ahem test font for ref tests to use. Add ref test for line-height using ahem as web font. 2014-08-12 10:16:57 +10:00
Ms2ger
21c080d1b8 Mark linebreak_simple_a.html as flaky on cpu reftests.
It has failed on three unrelated PRs:

https://s3.amazonaws.com/archive.travis-ci.org/jobs/31574326/log.txt
https://s3.amazonaws.com/archive.travis-ci.org/jobs/31581185/log.txt
https://s3.amazonaws.com/archive.travis-ci.org/jobs/31592052/log.txt
2014-08-04 11:33:52 +02:00
Glenn Watson
76349374bb Change layout to handle whitespace between inline elements in HTML file.
This matches the behaviour of other browsers.
2014-07-31 07:16:41 +10:00
Cameron Zwarich
a7eafbc48e Revert "Merge pull request #2819 from bjwbell/iframe-layers"
This reverts commit 0200b61f71, reversing
changes made to ca96821902.
2014-07-19 17:17:00 -07:00
Cameron Zwarich
39b9397c2b Merge pull request #2874 from bjwbell/borders-ref-test
Modify borders ref test to work on OS X
2014-07-19 13:08:05 -07:00
Bryan Bell
0c9f469f64 Restructure compositor layers to work with iframes
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
2014-07-19 10:46:11 -07:00
Bryan Bell
12a2cde8a5 Modify borders ref test to work 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.
2014-07-19 05:37:43 -07:00
Simon Sapin
94b630e2ed Mark as expected failure a reftest that uses 'direction'.
That property is behind the new --experimental flag.
2014-07-18 19:35:01 +01:00
Glenn Watson
049b99cfac Fix issue with auto table layout when cells have multiple fragments. Fixes some layout issues related to #2554. 2014-07-18 12:11:03 +10:00
Glenn Watson
3f010907ad Partial fix for footer layout issues on wikipedia, ref #2554. 2014-07-17 14:30:29 +10:00
Cameron Zwarich
0e294a235f Temporarily disable the 'borders' test
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.
2014-07-15 21:49:57 -07:00
Glenn Watson
9dba9b9447 Make pseudo :before and :after elements inherit style from attached
element, as per http://dev.w3.org/csswg/css2/generate.html, rather
than from the parent element.
2014-07-08 11:20:19 +10:00
Matt Brubeck
f7e371fdfd Add parsing of overflow: scroll and auto.
Elements with overflow scroll/auto are not yet scrollable, but they will be
clipped correctly (like `overflow: hidden`).
2014-07-01 11:08:37 -07:00
Pierre Louis Aublin
e5c01c6613 adding test for noscript 2014-06-21 13:20:31 +02:00
Martin Robinson
22ea9a634c Add overflow to child layer size
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.
2014-06-17 17:23:40 -07:00
Matt Brubeck
3e53dbd2e5 Fix deriving in cascade_with_cached_declarations
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.
2014-06-04 15:32:42 -07:00
Martin Robinson
12097703ba Prevent child layers from overriding root background color
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.
2014-05-30 13:16:24 -07:00
Simon Sapin
f4ed464149 Add the 'direction' property and fix one RTL layout corner case. 2014-05-29 18:01:46 +01:00
bors-servo
614b1f2fe6 auto merge of #2471 : bjz/servo/split-to-width, r=pcwalton
@pcwalton r?
2014-05-23 18:22:36 -04:00
bors-servo
4e1c025203 auto merge of #2465 : bjwbell/servo/groove-ridge-borders, r=pcwalton
Matches Chrome's rendering behavior for groove and ridge borders (I can attach comparison images, if wanted).
2014-05-22 14:11:05 -04:00
bors-servo
891ca73785 auto merge of #2411 : glennw/servo/issue-2335, r=pcwalton 2014-05-22 09:17:13 -04:00
Glenn Watson
0bb518561e Potential fix for #2335. 2014-05-22 09:15:35 +10:00
Brendan Zabarauskas
d6d36997c6 Add ref test for nested inline elements 2014-05-21 15:29:27 -07:00
Bryan Bell
afe0c0bfa6 Add ref test for dashed, dotted, groove, and ridge borders.
Don't line up :'s in render_context.rs (style)
2014-05-20 19:36:11 -07:00
Brendan Zabarauskas
4a4eeb70ec Fix linebreak regression
Fixes #2457
2014-05-16 17:12:16 -07:00
Matt Brubeck
8c794c6739 Move inline stylesheet parsing out of HTML parser.
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.
2014-04-14 11:14:07 -07:00
bors-servo
c27b31d9c9 auto merge of #2098 : Manishearth/servo/ref-noteq, r=metajack
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.
2014-04-12 11:04:09 -04:00
Manish Goregaokar
07cf2d095d Add the second reftest (#2090) 2014-04-12 09:17:26 +05:30
Manish Goregaokar
50b5bd3beb A couple of != reftests (#2090) 2014-04-12 08:22:44 +05:30
hyunjunekim
a6066e8c03 Add a reftest for the pseudo element 2014-04-12 00:10:50 +09:00
Jacob Parker
62227009b0 Add reftest for setAttribute restyling 2014-04-07 23:18:13 -04:00
Patrick Walton
2e5b210c95 test: Fix some reftests. 2014-04-03 14:51:18 -07:00
Patrick Walton
42170c7585 test: Add many reftests for parts of Acid2. 2014-04-03 14:50:57 -07:00
Patrick Walton
3f8882450c script: Fix background color of Acid2.
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.
2014-03-13 18:08:50 -07:00
bors-servo
af616dba58 auto merge of #1808 : pradeep90/servo/relative-position-container-block-size, r=pcwalton
This fixes #1757.
2014-03-11 21:28:40 -04:00
S Pradeep Kumar
9d510a7112 Implement min-width and max-width for non-block flows.
+ Add simple reftests.
+ Add reftests for float min-width and max-width.
2014-03-10 15:22:15 +09:00
S Pradeep Kumar
e98c839ab0 Add a trait for width and margin calculation.
+ 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.
2014-03-10 15:02:10 +09:00
S Pradeep Kumar
20a4ac6de3 Send in the right container block size for relative positioning.
This fixes #1757.
2014-03-04 16:25:03 +09:00
S Pradeep Kumar
070be51910 Implement position: absolute for replaced elements.
Add reftests for replaced and nested absolute flows.
2014-03-04 11:08:46 +09:00
S Pradeep Kumar
75f1142107 Implement mini-traversal for absolute flow assign-height.
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).
2014-03-03 16:12:45 +09:00
Keegan McAllister
2f2df09303 Remove remnants of old reftest system
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.
2014-02-26 18:06:20 -08:00