Commit graph

16155 commits

Author SHA1 Message Date
Connor Brewster
eedff27ea9 add methods to ensure frame state stays consistent 2017-01-17 22:30:51 -06:00
Xidorn Quan
0a3866cfa8 Fix initial value of -moz-user-{input,focus} 2017-01-18 13:59:50 +11:00
bors-servo
f010fb58fd Auto merge of #15065 - Manishearth:box-calclop, r=heycam
Use Box<CalcLengthOrPercentage> in specified values to avoid bloating inline sizes

For #15061

CalcLOP is a large struct, and gets used quite often. While #15063 reduces its size a bit,
it will still be much larger than any of the other variants in the `specified::Length*` types,
so it will still bloat sizes, especially for specified values that contain many lengths.

This change boxes it in the length types, so that it just takes one word.

r? @heycam

<!-- 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/15065)
<!-- Reviewable:end -->
2017-01-17 11:49:52 -08:00
bors-servo
a73fd01f01 Auto merge of #15074 - paulrouget:removeBhtmlFromComponent, r=Ms2ger
Remove browserhtml dependency from components/servo

Fix #15066

<!-- 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/15074)
<!-- Reviewable:end -->
2017-01-17 10:56:22 -08:00
Pavel Potocek
0d9b4e858c Fix #14497: WeakMediaQueryListVec assumes its contents are still alive 2017-01-17 18:35:49 +01:00
bors-servo
4b3fbc0059 Auto merge of #15071 - upsuper:page-break-after, r=emilio
Fix typo in glue code for page-break-after

<!-- 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/15071)
<!-- Reviewable:end -->
2017-01-17 09:05:33 -08:00
bors-servo
b4980f9037 Auto merge of #15069 - heycam:bindgen-regex-update, r=emilio
Update geckolib build-time bindgen build script for recent regex changes.

`./mach build-geckolib --with-gecko ...` is broken due to regex's API changing a bit.

r? @Manishearth

<!-- 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/15069)
<!-- Reviewable:end -->
2017-01-17 08:13:47 -08:00
Manish Goregaokar
f59557d2f2 Box CalcLengthOrPercentage to reduce inline size of PropertyDeclaration(s) 2017-01-17 08:09:54 -08:00
bors-servo
3ab514302f Auto merge of #14979 - mrobinson:scroll-roots-when-necessary, r=emilio
Only create scrolling overflow regions when necessary

Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes #14574.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #14574 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/14979)
<!-- Reviewable:end -->
2017-01-17 07:18:42 -08:00
Martin Robinson
44b24de60f Only create scrolling overflow regions when necessary
Only create scroll roots for overflow regions when the overflow region
is actually larger than the container size. This prevents creating
scrolling roots for elements that do not have overflow scroll as a
side-effect of the way their height and width is defined. For example,
tables should never respect overflow:scroll since their height and
width should always be large enough to prevent overflow. This also
decreases the size and complexity of the display list in many other
circumstances.

As part of this change, transformed overflow calculation is moved from
display list construction to layout. This should mean that overflow is
handled more accurately earlier.

Fixes #14574.
2017-01-17 09:47:43 -05:00
Anthony Ramine
44fd53fd48 Reorder some steps in ServoParser::finish 2017-01-17 14:25:23 +01:00
Anthony Ramine
70ed3e7006 Remove ScriptThread::parsing_complete 2017-01-17 14:24:37 +01:00
Emilio Cobos Álvarez
3b36f4c58e
Bug 1331213: Implement the resolution override. r=heycam
MozReview-Commit-ID: LFGam2hDoh7
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:18:56 +01:00
Emilio Cobos Álvarez
13878d674c
Bug 1331213: Implement Device::media_type, without supporting overrides for now. r=heycam
MozReview-Commit-ID: 9AeHViwoX1t
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:18:53 +01:00
Emilio Cobos Álvarez
646258e5a0
Bug 1331213: Don't make the pres context pointers opaque. r=heycam
I don't know why they were that way, but it makes no sense and tests still pass.

MozReview-Commit-ID: HAIuQhqlTtF
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:18:51 +01:00
Emilio Cobos Álvarez
10a1b887d6
Bug 1331213: Implement the bulk of media query evaluation. r=heycam
Two main notes:

 * The nsStringBuffer bit goes untested, since it's only used on windows and
   there's no way I can test it, please review with care.

 * I haven't implemented yet the "enumerated" media queries. I'd want to do it
   as a follow-up, because I'm running out of time, and it requires some
   investigation.

MozReview-Commit-ID: 1pBbzyIViPk
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:18:49 +01:00
Emilio Cobos Álvarez
197f21f3a7
Bug 1331213: Allow parsing media query expressions without colons. r=heycam
This is used for stuff like @media (monochrome), etc.

MozReview-Commit-ID: ANhZLXDURDj
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:05:37 +01:00
Emilio Cobos Álvarez
2dceb4502f
Bug 1331213: Add sugar for nsCSSValue and nsCSSValue::Array. r=heycam r=Manishearth
I will use this soon to implement the media query evaluation code.

Please review carefully.

MozReview-Commit-ID: HXelawXBfH8
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:05:34 +01:00
Emilio Cobos Álvarez
ad32f40e13
Bug 1331213: Add an API to drop a nsCSSValue in the stack. r=heycam
The getter function may create an nsCSSValue with allocated stuff, and we don't
want to leak it.

MozReview-Commit-ID: DYkUD8CW88E
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:05:32 +01:00
Emilio Cobos Álvarez
5b5243b8af
Bug 1331213: Bootstrap a Gecko-side Device, and track it's dirtiness manually in the per-doc data. r=heycam
The setup is quite different to Servo-land, so add a comment about the different
setup.

Also, check viewport rules when flushing stylesheets. I believe that the
previous behavior is plain wrong, though I haven't taken the time to come up
with a test case.

In any case, it doesn't hurt any of both back-ends.

MozReview-Commit-ID: 46gtTkesOsr
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 14:05:23 +01:00
Emilio Cobos Álvarez
5d6ac65e04
Bug 1331213: Add an API to get nsMediaFeatures::features. r=heycam
We can't use the generated ones if we want a windows build.

MozReview-Commit-ID: 200LNgWl5Lm
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 13:59:00 +01:00
Emilio Cobos Álvarez
7d2f43df58
Bug 1331213: Generate nsMediaFeatures and nsMediaList, along with a bunch of other stuff in nsCSSProps. r=xidorn
MozReview-Commit-ID: 8ANuHlp886J
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 13:58:44 +01:00
Emilio Cobos Álvarez
4843fcad80
Bug 1331213: Add a descriptive error message when an include isn't found. r=xidorn
Kind of drive-by.

MozReview-Commit-ID: CHLYcrLhyRq
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-01-17 13:58:34 +01:00
Emilio Cobos Álvarez
485fe874e8
layout: Expose whether the element was rendered in content_box_query to script.
But don't change the API yet.
2017-01-17 13:55:08 +01:00
Emilio Cobos Álvarez
8159dac506
dom: Refactor htmlanchorelement.rs layout query for an existing helper. 2017-01-17 13:55:08 +01:00
bors-servo
463a8bbdb6 Auto merge of #14936 - servo:incumbent-global, r=jdm
Implement the incumbent global.

Fixes #10963.

<!-- 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/14936)
<!-- Reviewable:end -->
2017-01-17 04:45:29 -08:00
Paul Rouget
3a48bd762b Remove browserhtml dependency from components/servo 2017-01-17 13:21:50 +01:00
Anthony Ramine
d29726971a Remove an obsolete reflow 2017-01-17 13:15:00 +01:00
Anthony Ramine
a60bbc81b8 Reorder some Document methods to put them together 2017-01-17 13:14:59 +01:00
Ms2ger
51df04d93e Implement the incumbent global.
Fixes #10963.
2017-01-17 12:57:02 +01:00
Anthony Ramine
5756f2ff4d Kill HTMLScriptElement::ready_to_be_parser_executed 2017-01-17 12:16:43 +01:00
Ms2ger
933b74781b Use usize for AutoEntryScript::global. 2017-01-17 11:38:32 +01:00
bors-servo
a70af60eec Auto merge of #15063 - Wafflespeanut:calc, r=heycam
Cleaning up CalcLengthOrPercentage

<!-- Please describe your changes on the following line: -->

We don't really need enum variants in `CalcLengthOrPercentage`. Given that we already have the information (whether it's `vw`, `ch`, etc.) in the struct fields, we could just store `Option<CSSFloat>` there, and modify our `ToCss` implementation a bit.

cc #15061

r? @Manishearth or anyone interested

---
<!-- 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

<!-- Either: -->
- [x] These changes do not require tests because it's a refactor

<!-- 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/15063)
<!-- Reviewable:end -->
2017-01-17 02:18:15 -08:00
Xidorn Quan
3131a1b1c1 Fix typo in glue code for page-break-after 2017-01-17 20:41:40 +11:00
Cameron McCormack
d4023a32d4 Update geckolib build-time bindgen build script for recent regex changes. 2017-01-17 16:59:30 +08:00
Ravi Shankar
6cf9fc0813 Prefer CSSFloat instead of enum variants in CalcLoP 2017-01-17 11:34:16 +05:30
bors-servo
7c1112408e Auto merge of #15056 - upsuper:blockify-none, r=emilio
Never blockify display: none

<!-- 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/15056)
<!-- Reviewable:end -->
2017-01-16 18:01:43 -08:00
Xidorn Quan
5d2bb99d49 Never blockify display: none 2017-01-17 11:32:09 +11:00
bors-servo
a4551d0cee Auto merge of #15047 - emilio:click-regression, r=notriddle,emilio
gfx: Don't mutate the same point multiple times while translating it …

…to other stacking context space.

I don't know how neither review or a test caught this.

r? @pcwalton  or @notriddle

Fixes #15015

<!-- 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/15047)
<!-- Reviewable:end -->
2017-01-16 15:46:05 -08:00
bors-servo
b9c6f9f76e Auto merge of #15040 - Manishearth:stylo-supports, r=heycam
stylo: support 1-arg CSS.supports()

r=heycam in https://bugzilla.mozilla.org/show_bug.cgi?id=1331316

<!-- 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/15040)
<!-- Reviewable:end -->
2017-01-16 13:56:51 -08:00
bors-servo
c8c38249a3 Auto merge of #15018 - emilio:freetype, r=jdm
gfx: Use proper freetype bindings.

<!-- Please describe your changes on the following line: -->

Needs https://github.com/servo/rust-freetype/pull/48, and https://github.com/servo/webrender/pull/716

<!-- 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/15018)
<!-- Reviewable:end -->
2017-01-16 13:01:59 -08:00
bors-servo
e01417e936 Auto merge of #15031 - emilio:stylo-display-none-pseudo, r=bholley
Bug 1331272: style: Unify restyle-damage display: none checks.

They were formerly different because we used the element check to cull the
traversal.

Now this is no longer true, so we can just unify them.

Also, update a no-longer up-to-date comment on that.

r? @bholley

<!-- 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/15031)
<!-- Reviewable:end -->
2017-01-16 12:07:02 -08:00
Emilio Cobos Álvarez
65c388cd06
gfx: Use proper freetype bindings. 2017-01-16 20:49:07 +01:00
bors-servo
ecd1d2dbc9 Auto merge of #15020 - jdm:external_script_line, r=Ms2ger
Do not use the script element's line number for external scripts.

This was yielding incorrect line numbers when looking at JS backtraces in gdb.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- 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/15020)
<!-- Reviewable:end -->
2017-01-16 11:11:46 -08:00
Florian Merz
65f3ac7d19 Don't translate point for independent stacking contexts
I took the test for hit_test from:
https://github.com/servo/servo/pull/15047/commits/602b45a3724747e1be767605c523c510846cfbf6
Thank you emilio
2017-01-16 19:19:34 +01:00
bors-servo
e891277dd5 Auto merge of #14994 - jdm:callback_rooting, r=Manishearth,Ms2ger
Make WebIDL callbacks permanently rooted

This replicates the same model that Promise uses right now, because it requires less thinking than coming up with something else.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14447
- [ ] There are tests for these changes

<!-- 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/14994)
<!-- Reviewable:end -->
2017-01-16 10:16:44 -08:00
bors-servo
57d6b8ec45 Auto merge of #15039 - heycam:bindings-update-17, r=emilio
stylo: Regenerate bindings.

<!-- Please describe your changes on the following line: -->

Bindings update for the sync I'll pushed based on https://treeherder.mozilla.org/#/jobs?repo=try&revision=42b2ac6142ddec57f60f4c3c05ec7c7d5aba9533, assuming there's nothing wrong.

r? @Manishearth

<!-- 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/15039)
<!-- Reviewable:end -->
2017-01-16 06:48:07 -08:00
bors-servo
bb540cab63 Auto merge of #15042 - servo:update-regex, r=jdm
Update regex.

<!-- 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/15042)
<!-- Reviewable:end -->
2017-01-16 05:59:18 -08:00
Emilio Cobos Álvarez
602b45a372
gfx: Don't mutate the same point multiple times while translating it to other stacking context space.
I don't know how neither review or a test caught this.
2017-01-16 14:39:55 +01:00
Ms2ger
a1d478fbb7 Update regex. 2017-01-16 13:11:16 +01:00