servo: Merge #4934 - Fixes background-color calculation for iframes. Fixes #1248 (from glennw:fix-1248); r=pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 6d2e840bf49f7d9d8022ab2566cfb641dd578a44
This commit is contained in:
Glenn Watson 2015-02-16 14:06:52 -07:00
Родитель 884bfec2ce
Коммит 4ddf1f39c5
4 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -666,7 +666,17 @@ impl LayoutTask {
// FIXME(pcwalton): This is really ugly and can't handle overflow: scroll. Refactor
// it with extreme prejudice.
let mut color = color::white();
// The default computed value for background-color is transparent (see
// http://dev.w3.org/csswg/css-backgrounds/#background-color). However, we
// need to propagate the background color from the root HTML/Body
// element (http://dev.w3.org/csswg/css-backgrounds/#special-backgrounds) if
// it is non-transparent. The phrase in the spec "If the canvas background
// is not opaque, what shows through is UA-dependent." is handled by rust-layers
// clearing the frame buffer to white. This ensures that setting a background
// color on an iframe element, while the iframe content itself has a default
// transparent background color is handled correctly.
let mut color = color::transparent_black();
for child in node.traverse_preorder() {
if child.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHtmlElement))) ||
child.type_id() == Some(NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLBodyElement))) {

2
servo/components/servo/Cargo.lock сгенерированный
Просмотреть файл

@ -458,7 +458,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "layers"
version = "0.1.0"
source = "git+https://github.com/servo/rust-layers#1ef45363e38cb4257d99a4de6a43bf99c1a6f807"
source = "git+https://github.com/servo/rust-layers#7f0ab52e147b778c79b9378fe3ddd4d13055df84"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",

2
servo/ports/cef/Cargo.lock сгенерированный
Просмотреть файл

@ -460,7 +460,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "layers"
version = "0.1.0"
source = "git+https://github.com/servo/rust-layers#1ef45363e38cb4257d99a4de6a43bf99c1a6f807"
source = "git+https://github.com/servo/rust-layers#7f0ab52e147b778c79b9378fe3ddd4d13055df84"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",

2
servo/ports/gonk/Cargo.lock сгенерированный
Просмотреть файл

@ -378,7 +378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "layers"
version = "0.1.0"
source = "git+https://github.com/servo/rust-layers#1ef45363e38cb4257d99a4de6a43bf99c1a6f807"
source = "git+https://github.com/servo/rust-layers#7f0ab52e147b778c79b9378fe3ddd4d13055df84"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",