From 0e24194d81820664be0e521fa9d22df6494e197d Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 16 Dec 2014 12:01:00 -0800 Subject: [PATCH 1/4] Inset and outset border coloring is incorrect on left side border. This patch will fix this issue. --- components/gfx/paint_context.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index 0748b3db928..f34b62559f8 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -642,8 +642,7 @@ impl<'a> PaintContext<'a> { let original_bounds = self.get_scaled_bounds(bounds, border, 0.0); // select and scale the color appropriately. let scaled_color = match direction { - Top => self.scale_color(color, if is_inset { 2.0/3.0 } else { 1.0 }), - Left => self.scale_color(color, if is_inset { 1.0/6.0 } else { 0.5 }), + Top | Left => self.scale_color(color, if is_inset { 2.0/3.0 } else { 1.0 }), Right | Bottom => self.scale_color(color, if is_inset { 1.0 } else { 2.0/3.0 }) }; self.draw_border_path(&original_bounds, direction, border, radius, scaled_color); From 92f4ab6394ed40245b33b7f8131ca4b415f7ed64 Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 16 Dec 2014 12:06:57 -0800 Subject: [PATCH 2/4] Thanks to differences on rendering between CPU X GPU, there is a 1 pixel wide difference in the position where the top border meets the right border (as also the right border X bottom border). The workaround to have a test that will work on both modes is to cover the affected area with a white div. This patch adds inset test. --- tests/ref/basic.list | 1 + tests/ref/inset.html | 49 +++++++++++++++++++++++++++++++++++++++ tests/ref/inset.png | Bin 0 -> 2848 bytes tests/ref/inset_ref.html | 13 +++++++++++ 4 files changed, 63 insertions(+) create mode 100644 tests/ref/inset.html create mode 100644 tests/ref/inset.png create mode 100644 tests/ref/inset_ref.html diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 5d993a5fe9c..55b9f3b1812 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -213,3 +213,4 @@ fragment=top != ../html/acid2.html acid2_ref.html == table_colspan_fixed_a.html table_colspan_fixed_ref.html == legacy_td_bgcolor_attribute_a.html legacy_td_bgcolor_attribute_ref.html == legacy_table_border_attribute_a.html legacy_table_border_attribute_ref.html +== inset.html inset_ref.html diff --git a/tests/ref/inset.html b/tests/ref/inset.html new file mode 100644 index 00000000000..3a98c0c4292 --- /dev/null +++ b/tests/ref/inset.html @@ -0,0 +1,49 @@ + + + + + + +
+
+
+ +
+
+ + diff --git a/tests/ref/inset.png b/tests/ref/inset.png new file mode 100644 index 0000000000000000000000000000000000000000..d1564dde92ee5b2b3c0d49eebd6827175d011ce6 GIT binary patch literal 2848 zcmeAS@N?(olHy`uVBq!ia0y~yU{+vYV2a>i0*Z)=h^jL%a6R{QaSW-L^Y)Ho)?o($ zhJ!gD#Q%EP7ky&l%#k`7v}zr9(uI{X53iZ|laXP;=jv}jjpfQ47#Nb6xEU1GFc{x% zR8_3KKCw9FR`I;_eg=jbL1`U^h8YK#7& + + + + + + From c41fc316553af58efd940914d925e113728bc2c1 Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 16 Dec 2014 12:16:23 -0800 Subject: [PATCH 3/4] Adding tests for outset. --- tests/ref/basic.list | 1 + tests/ref/outset.html | 48 ++++++++++++++++++++++++++++++++++++++ tests/ref/outset.png | Bin 0 -> 2843 bytes tests/ref/outset_ref.html | 19 +++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 tests/ref/outset.html create mode 100644 tests/ref/outset.png create mode 100644 tests/ref/outset_ref.html diff --git a/tests/ref/basic.list b/tests/ref/basic.list index 55b9f3b1812..3976d902d9e 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -214,3 +214,4 @@ fragment=top != ../html/acid2.html acid2_ref.html == legacy_td_bgcolor_attribute_a.html legacy_td_bgcolor_attribute_ref.html == legacy_table_border_attribute_a.html legacy_table_border_attribute_ref.html == inset.html inset_ref.html +== outset.html outset_ref.html diff --git a/tests/ref/outset.html b/tests/ref/outset.html new file mode 100644 index 00000000000..d75c74f2ade --- /dev/null +++ b/tests/ref/outset.html @@ -0,0 +1,48 @@ + + + + + + +
+
+
+ +
+
+ + diff --git a/tests/ref/outset.png b/tests/ref/outset.png new file mode 100644 index 0000000000000000000000000000000000000000..6e3f04c541f0576a29ad3bea1ef16169f549041d GIT binary patch literal 2843 zcmeAS@N?(olHy`uVBq!ia0y~yU{+vYV2a>i0*Z)=h^jL%a6R&LaSW-L^Y)G**I@$z zhJzYUy6cw8uiTO;;uMjSlNQyuqiE-&V{<+;GB`Z1{07uluDpSPA&H5bK|u|J@hxg! z5A*UJR?CktH1L~6FfbT4vN8w=<7aIAs`~x?9X)o2hz$ps7&|>mU^Ewu<^nQv!5iN7;X)kG ToHn)s8?OwWu6{1-oD!M<1j<(< literal 0 HcmV?d00001 diff --git a/tests/ref/outset_ref.html b/tests/ref/outset_ref.html new file mode 100644 index 00000000000..6da0826efdf --- /dev/null +++ b/tests/ref/outset_ref.html @@ -0,0 +1,19 @@ + + + + + + + From bdb8afd35163b17a2238bd3eaa66d14a250a1a18 Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 16 Dec 2014 15:59:42 -0800 Subject: [PATCH 4/4] Cropping the ref images to save some bytes (as also adjust test borders to match results). --- tests/ref/inset.html | 4 ++++ tests/ref/inset.png | Bin 2848 -> 315 bytes tests/ref/outset.html | 4 ++++ tests/ref/outset.png | Bin 2843 -> 312 bytes 4 files changed, 8 insertions(+) diff --git a/tests/ref/inset.html b/tests/ref/inset.html index 3a98c0c4292..095303adab5 100644 --- a/tests/ref/inset.html +++ b/tests/ref/inset.html @@ -2,6 +2,10 @@