Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root element background should fill entire canvas #218

Closed
burg opened this issue Nov 19, 2012 · 7 comments
Closed

Root element background should fill entire canvas #218

burg opened this issue Nov 19, 2012 · 7 comments

Comments

@burg
Copy link

@burg burg commented Nov 19, 2012

We should paint the entire viewport with the background of the root element. The spec seems to imply that this is the background of HTMLBodyElement, but applied to the canvas of HTMLHTMLElement.

Spec: http://www.w3.org/TR/CSS2/colors.html

Talmudic interpretation: https://bugzilla.mozilla.org/show_bug.cgi?id=13473

@burg
Copy link
Author

@burg burg commented Nov 19, 2012

Turns out that we aren't attaching any boxes to the RootFlow, instead creating a BlockFlow for HTMLHTMLElement. This is no good.

@bzbarsky
Copy link
Contributor

@bzbarsky bzbarsky commented Nov 19, 2012

It's the background of the body if this is an HTML document and has a body. Otherwise it's the background of the root element. In either case it's painted over the whole canvas, but the background position and such depends on the box of the root element. Which is important, because the size of the root element's box can easily not match the size of the canvas.

@burg
Copy link
Author

@burg burg commented Nov 19, 2012

From the spec: "For documents whose root element is an HTML "HTML" element or an XHTML "html" element that has computed values of 'transparent' for 'background-color' and 'none' for 'background-image', user agents must instead use the computed value of the background properties from that element's first HTML "BODY" element or XHTML "body" element child when painting backgrounds for the canvas, and must not paint a background for that child element. Such backgrounds must also be anchored at the same point as they would be if they were painted only for the root element."

So, does this mean <html> always paints <body>'s background and <body> paints no background, or does this only happen if <html>'s computed background color is transparent?

burg pushed a commit that referenced this issue Nov 19, 2012
flows have less combined height than the viewport height.

This makes Issue #218 go away in the case when the HTML element's
style specifies a background color.
@bzbarsky
Copy link
Contributor

@bzbarsky bzbarsky commented Nov 20, 2012

The body thing only happens if the HTML background-color is transparent and background-image is "none". I was wrong about that in my comment above.

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Dec 11, 2013

@burg, is this the same as #140, which was fixed in #1210 ?

@burg
Copy link
Author

@burg burg commented Dec 11, 2013

I believe they are the same.

On Dec 11, 2013, at 1:42 AM, Simon Sapin notifications@github.com wrote:

@burg, is this the same as #140, which was fixed in #1210 ?


Reply to this email directly or view it on GitHub.

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Dec 11, 2013

Thanks @burg for confirming. Closing.

@SimonSapin SimonSapin closed this Dec 11, 2013
ChrisParis pushed a commit to ChrisParis/servo that referenced this issue Sep 7, 2014
shadow-dom: Remove shadow-trees/test-003.html in favor of reftests.
glennw pushed a commit to glennw/servo that referenced this issue Jan 16, 2017
Fixes for a couple of panics in WR.

- Change resize to not require changing texture ID.
- Fix freelist iterator.

These changes are slightly less efficient, but fix some panics. We can revisit this code if it shows up in profiles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.