servo / app_units

https://crates.io/crates/app_units
3 stars 17 forks source link

Clamp Au values between 1<<30 and -(1<<30) and saturate all operations #26

Closed Manishearth closed 7 years ago

Manishearth commented 7 years ago

fixes #22, fixes #25

r? @SimonSapin

Manishearth commented 7 years ago

We probably should make the Au ctor private, but that's a breaking change and requires some refactoring :|

Manishearth commented 7 years ago
 TEST-UNEXPECTED-FAIL | layout/style/test/test_bug664955.html | failure pattern `font size is larger than max font size` in this test - expected 2 failures but got 0 [log…] 

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/backgrounds/background-size-monster-ch.html == file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/backgrounds/background-size-monster-ch.html | image comparison [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/backgrounds/background-size-monster-em.html == file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/backgrounds/background-size-monster-em.html | image comparison [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/backgrounds/background-size-monster-ex.html == file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/backgrounds/background-size-monster-ex.html | image comparison [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/backgrounds/background-size-monster-rem.html == file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/backgrounds/background-size-monster-rem.html | image comparison [log…] 
Manishearth commented 7 years ago

We have some crashtest passes and fails:


REFTEST TEST-UNEXPECTED-FAIL | file:///home/worker/workspace/build/tests/reftest/tests/layout/base/crashtests/266445-2.html | assertion count 2 is more than expected 0 assertions [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/generic/crashtests/345617-1.html | assertion count 0 is less than expected 4 assertions [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/generic/crashtests/387088-1.html | assertion count 0 is less than expected 2 assertions [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/generic/crashtests/418932-1.html | assertion count 0 is less than expected 2 assertions [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/generic/crashtests/420000-1.html | assertion count 0 is less than expected 2 assertions [log…]

REFTEST TEST-UNEXPECTED-FAIL | file:///home/worker/workspace/build/tests/reftest/tests/layout/generic/crashtests/459968.html | assertion count 4 is more than expected 0 assertions [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/generic/crashtests/512725-1.html | assertion count 0 is less than expected 2 assertions [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/generic/crashtests/595435-1.xhtml | assertion count 0 is less than expected 4 assertions [log…]

REFTEST TEST-UNEXPECTED-FAIL | file:///home/worker/workspace/build/tests/reftest/tests/layout/generic/crashtests/798020-1.html | assertion count 4 is more than expected 0 assertions [log…]

REFTEST TEST-UNEXPECTED-PASS | file:///home/worker/workspace/build/tests/reftest/tests/layout/tables/crashtests/448988-1.xhtml | assertion count 0 is less than expected 1 assertions [log…] 
Manishearth commented 7 years ago

Wil lfix https://bugzilla.mozilla.org/show_bug.cgi?id=1324640

Manishearth commented 7 years ago

Full expectations update

diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list
index 33db2db..39cdfaa 100644
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -46,7 +46,7 @@ load 265999-1.html
 load 266222-1.html
 asserts(1-7) load 266360-1.html # bug 576358
 load 266445-1.html
-asserts(2) asserts-if(stylo,0) load 266445-2.html
+asserts(2) load 266445-2.html
 load 268157-1.html
 load 269566-1.html
 load 272647-1.html
diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list
index d0be7e5..8100d21 100644
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -47,7 +47,7 @@ load 342322-1.html
 load 343206-1.xhtml
 load 344557-1.html
 load 345139-1.xhtml
-asserts-if(stylo,4) load 345617-1.html # bug 1324640
+load 345617-1.html
 load 348510-1.html
 load 348510-2.html
 load 348887-1.html
@@ -134,7 +134,7 @@ load 386812-1.html
 load 386827-1.html
 load 387058-1.html
 load 387058-2.html
-asserts-if(stylo,2) load 387088-1.html # bug 1324640
+load 387088-1.html
 load 387209-1.html
 load 387213-1.html
 load 387215-1.xhtml
@@ -246,9 +246,9 @@ load 417848-1.xhtml
 load 417902-1.html
 load 417902-2.html
 load 418532-1.html
-asserts-if(stylo,2) load 418932-1.html # bug 1324665
+load 418932-1.html
 load 419352.html
-asserts-if(stylo,2) load 420000-1.html # bug 1330259
+load 420000-1.html
 load 420718.html
 load 420785-1.xhtml
 load 421404-1.html
@@ -310,7 +310,7 @@ load 455171-3.html
 load 455643-1.xhtml
 load 457375.html
 load 457380-1.html
-asserts-if(!Android,4) asserts-if(stylo,0) load 459968.html # bug 1067022
+asserts-if(!Android,4) load 459968.html # bug 1067022
 load 460910-1.xml
 load 461294-1.html
 load 462968.xhtml
@@ -377,7 +377,7 @@ load 508908-1.html
 load 509749-1.html
 load 511482.html
 load 512724-1.html
-asserts-if(stylo,2) load 512725-1.html # bug 1324640
+load 512725-1.html
 load 512749-1.html
 load 513110-1.html
 load 513110-2.xhtml
@@ -428,7 +428,7 @@ load 590404.html
 load 591141.html
 load 592118.html
 load 594808-1.html
-asserts-if(stylo,4) load 595435-1.xhtml # bug 1324640
+load 595435-1.xhtml
 load 595740-1.html
 load 597240-1.xhtml
 pref(layout.float-fragments-inside-column.enabled,true) load 600100.xhtml
@@ -502,7 +502,7 @@ load 786740-1.html
 load 790260-1.html
 asserts(1) asserts-if(stylo,0) test-pref(font.size.inflation.emPerLine,15) load 791601.xhtml # Bug 871327
 test-pref(font.size.inflation.minTwips,120) load 794693.html
-asserts-if(!Android,4) asserts-if(stylo,0) load 798020-1.html
+asserts-if(!Android,4) load 798020-1.html
 load 798235-1.html
 load 799207-1.html
 load 799207-2.html
diff --git a/layout/reftests/backgrounds/reftest.list b/layout/reftests/backgrounds/reftest.list
index 51eb261..feed894 100644
--- a/layout/reftests/backgrounds/reftest.list
+++ b/layout/reftests/backgrounds/reftest.list
@@ -110,16 +110,16 @@ pref(layout.css.box-decoration-break.enabled,true) != background-size-cover-clon
 # other
 pref(layout.css.box-decoration-break.enabled,true) != background-size-cover-slice.html background-size-cover-clone.html

-random-if(OSX==1010) fails-if(stylo) == background-size-monster-ch.html background-size-monster-ref.html # bug 1129300
+random-if(OSX==1010) == background-size-monster-ch.html background-size-monster-ref.html # bug 1129300
 random-if(OSX==1010) == background-size-monster-cm.html background-size-monster-ref.html # bug 1129300
-random-if(OSX==1010) fails-if(stylo) == background-size-monster-em.html background-size-monster-ref.html # bug 1129300
-random-if(OSX==1010) fails-if(stylo) == background-size-monster-ex.html background-size-monster-ref.html # bug 1129300
+random-if(OSX==1010) == background-size-monster-em.html background-size-monster-ref.html # bug 1129300
+random-if(OSX==1010) == background-size-monster-ex.html background-size-monster-ref.html # bug 1129300
 random-if(OSX==1010) == background-size-monster-inches.html background-size-monster-ref.html # bug 1129300
 random-if(OSX==1010) == background-size-monster-mm.html background-size-monster-ref.html # bug 1129300
 random-if(OSX==1010) == background-size-monster-pc.html background-size-monster-ref.html # bug 1129300
 random-if(OSX==1010) == background-size-monster-pt.html background-size-monster-ref.html # bug 1129300
 random-if(OSX==1010) == background-size-monster-px.html background-size-monster-ref.html # bug 1129300
-random-if(OSX==1010) fails-if(stylo) == background-size-monster-rem.html background-size-monster-ref.html # bug 1129300
+random-if(OSX==1010) == background-size-monster-rem.html background-size-monster-ref.html # bug 1129300

 # There seems to be a pixel-snapping problem here, where the repeated background
 # image isn't being snapped at its boundaries.  Note that the boundaries within
diff --git a/layout/style/test/stylo-failures.md b/layout/style/test/stylo-failures.md
index 966d1a3e..dad4598 100644
--- a/layout/style/test/stylo-failures.md
+++ b/layout/style/test/stylo-failures.md
@@ -145,8 +145,6 @@ to mochitest command.
     * test_value_storage.html `context-` [7]
     * test_bug798843_pref.html [7]
 * Incorrect parsing
-  * Incorrect bounds
-    * test_bug664955.html `font size is larger than max font size` [2]
   * -moz-alt-content parsing is wrong: servo/servo#15726
     * test_property_syntax_errors.html `-moz-alt-content` [4]
   * mask shorthand servo/servo#15772
diff --git a/layout/tables/crashtests/crashtests.list b/layout/tables/crashtests/crashtests.list
index 49370d3..eda4fa2 100644
--- a/layout/tables/crashtests/crashtests.list
+++ b/layout/tables/crashtests/crashtests.list
@@ -110,7 +110,7 @@ load 423514-1.xhtml
 load 430374.html
 load 444431-1.html
 load 444702-1.html
-asserts-if(stylo,1) load 448988-1.xhtml # bug 1324681
+load 448988-1.xhtml
 load 450311-1.html
 load 451170.html
 load 451355-1.html
Manishearth commented 7 years ago

Addressed

mbrubeck commented 7 years ago

@bors-servo r+

bors-servo commented 7 years ago

:pushpin: Commit b21675e has been approved by mbrubeck

bors-servo commented 7 years ago

:hourglass: Testing commit b21675e074f19afaee64b474eca6c7ca037cc19c with merge 6978fe8732885ce37c8f91a017050892fd90202e...

bors-servo commented 7 years ago

:sunny: Test successful - status-travis Approved by: mbrubeck Pushing 6978fe8732885ce37c8f91a017050892fd90202e to master...