Commit graph

3197 commits

Author SHA1 Message Date
Corey Farwell
3ae76f4e76 Implement <font> 'face' attribute 2015-09-14 20:24:52 -04:00
João Oliveira
813cdaa012 Move setting UserAgent header into http_loader::load,
closes #7541
2015-09-14 15:35:34 +01:00
Ali Sabil
ea655ada10 Cache the id attribute on Element 2015-09-13 23:55:40 +02:00
Anthony Ramine
cba8856309 Fix Node::query_selector() and Node::query_selector_iter()
These should not find the root of the tree to start matching.
2015-09-13 23:40:24 +02:00
Anthony Ramine
650afc9d3e Fix cloning of Element's attributes
No virtual method was invoked when copies of attributes were appended to
newly-cloned elements.
2015-09-13 23:40:24 +02:00
bors-servo
d5ee58caf2 Auto merge of #7606 - nox:move-typeid, r=jdm
Move the type_id fields to DOMClass

Cc @michaelwu.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7606)
<!-- Reviewable:end -->
2015-09-13 11:53:42 -06:00
bors-servo
6a21bcd9c5 Auto merge of #7615 - frewsxcv:obsolete-link-anchor, r=nox
Add obsolete reflecting attributes on <a> and <link>

From my understanding, setting any of these will not affect any
presentational hints for the elements

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7615)
<!-- Reviewable:end -->
2015-09-13 10:47:32 -06:00
Corey Farwell
fdebd2ae2a Add obsolete reflecting attributes on <a> and <link>
From my understanding, setting any of these will not affect any
presentational hints for the elements
2015-09-13 09:45:02 -04:00
Corey Farwell
be3352f379 Explicitly state 'blink' should create HTMLUnknownElement, like the spec
https://html.spec.whatwg.org/#other-elements,-attributes-and-apis:blink
2015-09-13 08:07:03 -04:00
Corey Farwell
cc8994422b Fix a few incorrect Element interfaces 2015-09-13 08:02:51 -04:00
Mathieu Rheaume
cc44448b09 Fix BinaryOrPLaintextClassifier bug with utf16-be & utf16-le and correct tests 2015-09-12 19:59:20 -04:00
Mathieu Rheaume
68a088bef6 Fixed apache bug flag on not passing the good params 2015-09-12 17:44:16 -04:00
Mathieu Rheaume
ff608de781 fixup! Issue #7382 Use descriptive enums instead of booleans for MIMEClassifier::classifer 2015-09-12 17:44:16 -04:00
Mathieu Rheaume
8525495265 Issue #7382 Use descriptive enums instead of booleans for MIMEClassifier::classifer 2015-09-12 17:44:14 -04:00
Simon Sapin
43c999905c Replace reftest with a problematic file name with a unit test.
Fix #7609, "error: unable to create file tests/ref/hello_a?foo#bar.html
(Invalid argument)" during git checkout on Windows.

Behavior change: passing an nonexistent file name on the command line
now shows a blank page (like network errors)
rather than exit with an error message.
2015-09-12 14:18:15 +02:00
Michael Wu
941f7dc04b Move EventTargetTypeId/NodeTypeId to DOMClass 2015-09-12 01:09:46 +02:00
Jinwoo Song
d524601cf5 CSS 'transformation: skew()' should take <angle> type as parameters
Current implementation is taking <number> type as parameter so skew()
does not work properly. Let the skew() to get <angle> as specification
described.

Fixes #6237.
2015-09-12 01:06:35 +02:00
Anthony Ramine
f11fcebd9c Bump euclid to 0.2 2015-09-12 01:06:26 +02:00
bors-servo
8d7ba12f28 Auto merge of #7600 - pcwalton:body-overflow-scroll, r=mbrubeck
layout: Allow the overflow area of the `<body>` to be scrolled.

Fixes scrolling on Twitter.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7600)
<!-- Reviewable:end -->
2015-09-11 11:20:13 -06:00
bors-servo
c3f9e1813a Auto merge of #7550 - pcwalton:block-formatting-context-overflow, r=mbrubeck
layout: Defend the block formatting context speculation against going wrong in the presence of blocks that overflow in the inline direction.

Makes the Google search result links appear.

Closes #7298.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7550)
<!-- Reviewable:end -->
2015-09-11 10:03:39 -06:00
Patrick Walton
99587cf105 layout: Allow the overflow area of the <body> to be scrolled.
Fixes scrolling on Twitter.
2015-09-10 18:07:21 -07:00
bors-servo
4c64c870c6 Auto merge of #7592 - nox:nonelementparentnode, r=jdm
Introduce NonElementParentNode

This is the interface where Document.getElementById() belong.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7592)
<!-- Reviewable:end -->
2015-09-10 07:29:47 -06:00
bors-servo
c349b7b3a1 Auto merge of #7426 - dzbarsky:surroundcontents, r=glennw
Implement Range#surroundContents



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7426)
<!-- Reviewable:end -->
2015-09-09 21:54:06 -06:00
Anthony Ramine
dc125f9eb1 Implement NonElementParentNode for DocumentFragment 2015-09-10 01:33:13 +02:00
bors-servo
7b6c341900 Auto merge of #7581 - connorimes:power-profiling, r=larsbergstrom
Add energy monitoring and characterization scripts

Add the energy-profiling feature.  Users can compile the proper (or their own) version of energymon libraries to capture power/energy data at runtime.  The results are accessed through heartbeats.

Additionally, there are a couple of python scripts to enable heartbeats for profiler categories and process the results into some visualizations to help understand how time and energy is being spent in Servo.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7581)
<!-- Reviewable:end -->
2015-09-09 15:24:48 -06:00
bors-servo
f29ddb4b5d Auto merge of #7577 - bjwbell:borders_pixel_rounding_bug, r=mbrubeck
gfx: Fix bug with 1px width borders disappearing

In to_nearest_azure_rect when rounding to pixel coordinates, maintain
the invariant of rect non-overlap (if before rounding two rects don't overlap).

The previous code rounded the rect top left corner to the nearest pixel with
the size rounded to the nearest pixel multiple which can violate the
non-overlap condition, e.g.
10px×9.60px at (0px,6.6px) & 10px×9.60px at (0px,16.2px)
would round to
10px×10.0px at (0px,7.0px) & 10px×10.0px at (0px,16.0px), which overlap.

Instead round each corner to the nearest pixel.

For rects that dont need to satify the non-overlap condition and with
width or height between 0.5px and 1px, rounding each rect corner to the
nearest pixel can yield an empty rect e.g.
10px×0.6px at 0px,28.56px -> 10px×0px at 0px,29px.

For this scenario a new function to_nearest_non_empty_azure_rect
rounds the rect top left corner to the nearest pixel and the rect size
to the nearest pixel multiple. It's possible for non-overlapping rects
after this rounding to overlap.

This should fix https://github.com/servo/servo/issues/7184 "rounding ...borders not to be visible", without breaking https://github.com/servo/servo/issues/7152 "Underlines less than 1px high sometimes invisible".

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7577)
<!-- Reviewable:end -->
2015-09-09 13:30:41 -06:00
Michael Howell
029af81570 Actually store the overflow for inline-block elements.
Fixes #7571
2015-09-09 12:24:28 -07:00
Bryan Bell
1f44686415 position-relative-035 reftest -> expected fail
There is no easy way to pass position-relative-035 & also
pass both tests/ref/border_rounding_1px_invisible_issue_7184 and
tests/ref/text_decoration_underline_subpx.

https://github.com/servo/servo/pull/7161, "Snap rectangles to nearest
pixels...", did fix position-relative-035 (except
for OS X) but broke 1px borders.
2015-09-09 11:58:21 -07:00
Connor Imes
3c25f47dbc Add energy monitoring and characterization scripts 2015-09-09 13:35:21 -05:00
bors-servo
c0381c7325 Auto merge of #7563 - mrobinson:layerize-stacking-contexts, r=pcwalton
Layerize StackingContexts that are on top of layers

StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7563)
<!-- Reviewable:end -->
2015-09-09 10:52:56 -06:00
Martin Robinson
184238c348 Layerize StackingContexts that are on top of layers
StackingContexts that should be painted on top of StackingContexts that
are already layerized should automatically get their own layer. This
will ensure proper painting order.
2015-09-09 09:13:14 -07:00
Bryan Bell
642b34865f gfx: Fix bug with 1px width borders disappearing
In to_nearest_azure_rect when rounding to pixel coordinates, maintain
the invariant of rect non-overlap (if before rounding two rects don't overlap).

The previous code rounded the rect top left corner to the nearest pixel with
the size rounded to the nearest pixel multiple which can violate the
non-overlap condition, e.g.
10px×9.60px at (0px,6.6px) & 10px×9.60px at (0px,16.2px)
would round to
10px×10.0px at (0px,7.0px) & 10px×10.0px at (0px,16.0px), which overlap.

Instead round each corner to the nearest pixel.

For rects that dont need to satify the non-overlap condition and with
width or height between 0.5px and 1px, rounding each rect corner to the
nearest pixel can yield an empty rect e.g.
10px×0.6px at 0px,28.56px -> 10px×0px at 0px,29px.

For this scenario a new function to_nearest_non_empty_azure_rect
rounds the rect top left corner to the nearest pixel and the rect size
to the nearest pixel multiple. It's possible for non-overlapping rects
after this rounding to overlap.
2015-09-09 03:20:52 -07:00
David Zbarsky
3bec4d37dd Implement Range#surroundContents 2015-09-08 22:01:49 -07:00
bors-servo
4221b354cf Auto merge of #7557 - glennw:fix-layout-panic, r=pcwalton
Handle cases where the layout root is None. Fixes #6375.



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7557)
<!-- Reviewable:end -->
2015-09-08 20:39:09 -06:00
bors-servo
68f32f7bef Auto merge of #7388 - paulrouget:issue-7332, r=metajack
Test for flexbox crasher

Closes #7332

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7388)
<!-- Reviewable:end -->
2015-09-08 12:45:24 -06:00
bors-servo
ef8a145233 Auto merge of #7561 - servo:update-css, r=SimonSapin
Update CSS tests to revision 09d27d61d637da536af1d86a8d7bea157592ff9e



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7561)
<!-- Reviewable:end -->
2015-09-08 03:46:36 -06:00
Simon Sapin
84f2ae6c93 Update CSS tests expected data to revision 09d27d61d637da536af1d86a8d7bea157592ff9e 2015-09-08 11:42:20 +02:00
Simon Sapin
5abfa12a4c Update CSS tests to revision 09d27d61d637da536af1d86a8d7bea157592ff9e 2015-09-08 11:01:17 +02:00
bors-servo
5a0be12e43 Auto merge of #7531 - nox:template, r=Ms2ger
Implement <template>

All tests using iframes can't currently pass, same for innerHTML-related tests with <template> elements. The latter contradicts the spec, see the links below.

Apart from this, they work, AFAICT.

https://github.com/servo/html5ever/issues/164
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27314

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7531)
<!-- Reviewable:end -->
2015-09-08 02:29:00 -06:00
Anthony Ramine
b3820047da Fix HTMLTemplateElement.innerHTML
https://github.com/w3c/DOM-Parsing/issues/1
2015-09-08 10:28:24 +02:00
Anthony Ramine
a5cefe41d0 Implement adopting and cloning steps for HTMLTemplateElement 2015-09-08 10:28:23 +02:00
Anthony Ramine
663f1d65e3 Fix tests in template-contents-owner-document-type.html
HTMLDocument isn't a thing anymore.
2015-09-08 10:28:22 +02:00
Anthony Ramine
a7476a758e Bump html5ever to 0.2.4, <template> support!
The failing <img> test comes from the now-correct parsing of <font face> elements
in SVG.
2015-09-08 10:28:21 +02:00
Anthony Ramine
880364b56d Enable template tests
All tests using iframes can't currently pass, same for innerHTML-related tests
with <template> elements. The latter contradicts the spec, see the links below.

https://github.com/servo/html5ever/issues/164
https://github.com/w3c/DOM-Parsing/issues/1
2015-09-08 09:32:50 +02:00
Michael Howell
6228edfb4c Include the overflow of the inline block itself.
Closes #7372.
2015-09-07 20:27:06 -07:00
Glenn Watson
a02d28a732 Handle cases where the layout root is None. Fixes #6375. 2015-09-08 11:19:58 +10:00
Paul Rouget
f6582e7f21 Test for flexbox crasher 2015-09-07 09:02:53 +02:00
Patrick Walton
683290e109 layout: Use a special path that treats margin: auto as zero for inline-block
inline size computation.

Places the search icon in the right place on the Google SERPs.
2015-09-04 20:42:57 -07:00
bors-servo
aeb8dce2d9 Auto merge of #7534 - pcwalton:inline-absolute-out-of-flow, r=mbrubeck
layout: Lay absolutely-positioned blocks with inline containing blocks out of flow.

Removes the long space before the site-specific drop-down in the Google SERPs.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7534)
<!-- Reviewable:end -->
2015-09-04 19:59:11 -06:00
bors-servo
5bad6b1b6e Auto merge of #7502 - bjwbell:elliptical-borders, r=pcwalton
gfx: Add elliptical border radius support

TODO: Add code for parsing shorthand border-radius e.g. "border-radius: 10px 5% / 20px".

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7502)
<!-- Reviewable:end -->
2015-09-04 18:46:24 -06:00