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

Temporary implementation of Canvas.MeasureText #24261

Merged
merged 1 commit into from Sep 25, 2019

Conversation

@paulrouget
Copy link
Contributor

paulrouget commented Sep 21, 2019

@jdm: that will help with the babylonjs demos. Another approach is to implement that in JS and add it to the demos.


This change is Reviewable

@highfive
Copy link

highfive commented Sep 21, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/canvasrenderingcontext2d.rs, components/script/dom/webidls/TextMetrics.webidl, components/script/dom/mod.rs, components/script/dom/offscreencanvasrenderingcontext2d.rs, components/script/dom/webidls/CanvasRenderingContext2D.webidl and 1 more
  • @KiChjang: components/script/dom/canvasrenderingcontext2d.rs, components/script/dom/webidls/TextMetrics.webidl, components/script/dom/mod.rs, components/script/dom/offscreencanvasrenderingcontext2d.rs, components/script/dom/webidls/CanvasRenderingContext2D.webidl and 1 more
@highfive
Copy link

highfive commented Sep 21, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@paulrouget paulrouget assigned jdm and unassigned nox Sep 21, 2019
@paulrouget paulrouget force-pushed the paulrouget:fakeMeasureTExt branch from a2b01df to c06332e Sep 21, 2019
@paulrouget
Copy link
Contributor Author

paulrouget commented Sep 21, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2019

Trying commit c06332e with merge 92ff08b...

bors-servo added a commit that referenced this pull request Sep 21, 2019
[WIP] Temporary implementation of Canvas.MeasureText

@jdm: that will help with the babylonjs demos. Another approach is to implement that in JS and add it to the demos.

<!-- 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/24261)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2019

💔 Test failed - linux-rel-css

@paulrouget
Copy link
Contributor Author

paulrouget commented Sep 24, 2019

The failure is very explicit :)

Gonna disable TextMetrics, not just measureText if the pref is off.

@paulrouget paulrouget force-pushed the paulrouget:fakeMeasureTExt branch from c06332e to 2583121 Sep 24, 2019
@paulrouget
Copy link
Contributor Author

paulrouget commented Sep 24, 2019

@jdm would you be ok with something like this?

@paulrouget paulrouget changed the title [WIP] Temporary implementation of Canvas.MeasureText Temporary implementation of Canvas.MeasureText Sep 24, 2019
@jdm
Copy link
Member

jdm commented Sep 24, 2019

Yes, bit let's hook it up to the existing pref that controls the fake fillText implementation.

@paulrouget paulrouget force-pushed the paulrouget:fakeMeasureTExt branch from 2583121 to ede24e3 Sep 24, 2019
@paulrouget
Copy link
Contributor Author

paulrouget commented Sep 24, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Sep 24, 2019

Trying commit ede24e3 with merge 4a25343...

bors-servo added a commit that referenced this pull request Sep 24, 2019
Temporary implementation of Canvas.MeasureText

@jdm: that will help with the babylonjs demos. Another approach is to implement that in JS and add it to the demos.

<!-- 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/24261)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Sep 24, 2019

The PR taskcluster check reports:

�[36m 0:05.21�(B�[m �[33mWARNING�(B�[m Manifest /repo/tests/wpt/mozilla/meta/MANIFEST.json contains correct tests but file hashes changed.
�[36m 0:05.21�(B�[m �[31mERROR�(B�[m Manifest /repo/tests/wpt/mozilla/meta/MANIFEST.json is outdated, use |./mach update-manifest| to fix.
@paulrouget paulrouget force-pushed the paulrouget:fakeMeasureTExt branch from ede24e3 to dcf9c40 Sep 24, 2019
@paulrouget
Copy link
Contributor Author

paulrouget commented Sep 24, 2019

@jdm r?

@@ -7658,9 +7658,6 @@
]
]
},
"stub": {
"css/blockify_inline_element.html": []
},

This comment has been minimized.

Copy link
@paulrouget

paulrouget Sep 24, 2019

Author Contributor

Why is ./mach update-manifest updating that test?

This comment has been minimized.

Copy link
@jdm

jdm Sep 24, 2019

Member

It's fixing previously-incorrect updates.

@jdm
Copy link
Member

jdm commented Sep 24, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Sep 24, 2019

📌 Commit dcf9c40 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2019

Testing commit dcf9c40 with merge e8e5112...

bors-servo added a commit that referenced this pull request Sep 25, 2019
Temporary implementation of Canvas.MeasureText

@jdm: that will help with the babylonjs demos. Another approach is to implement that in JS and add it to the demos.

<!-- 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/24261)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2019

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Sep 25, 2019

{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: existence and properties of interface object", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194160, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface object length", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194161, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface object name", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194162, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: existence and properties of interface prototype object", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194163, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: existence and properties of interface prototype object's \"constructor\" property", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194164, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: existence and properties of interface prototype object's @@unscopables property", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194165, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute width", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194166, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute actualBoundingBoxLeft", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194167, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute actualBoundingBoxRight", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194168, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute fontBoundingBoxAscent", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194169, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute fontBoundingBoxDescent", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194170, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute actualBoundingBoxAscent", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194171, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute actualBoundingBoxDescent", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194172, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute emHeightAscent", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194173, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute emHeightDescent", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194174, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute hangingBaseline", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194175, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute alphabeticBaseline", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194176, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute ideographicBaseline", 
    "test": "/html/dom/idlharness.worker.html", 
    "line": 194177, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "CanvasRenderingContext2D interface: operation measureText(DOMString)", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272472, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "CanvasRenderingContext2D interface: document.createElement(\"canvas\").getContext(\"2d\") must inherit property \"measureText(DOMString)\" with the proper type", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272576, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "CanvasRenderingContext2D interface: calling measureText(DOMString) on document.createElement(\"canvas\").getContext(\"2d\") with too few arguments must throw TypeError", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272577, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: existence and properties of interface object", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272637, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface object length", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272638, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface object name", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272639, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: existence and properties of interface prototype object", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272640, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: existence and properties of interface prototype object's \"constructor\" property", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272641, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: existence and properties of interface prototype object's @@unscopables property", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272642, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute width", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272643, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute actualBoundingBoxLeft", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272644, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute actualBoundingBoxRight", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272645, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute fontBoundingBoxAscent", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272646, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute fontBoundingBoxDescent", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272647, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute actualBoundingBoxAscent", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272648, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute actualBoundingBoxDescent", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272649, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute emHeightAscent", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272650, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute emHeightDescent", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272651, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute hangingBaseline", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272652, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute alphabeticBaseline", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272653, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "TextMetrics interface: attribute ideographicBaseline", 
    "test": "/html/dom/idlharness.https.html?exclude=(Document|Window|HTML.*)", 
    "line": 272654, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "The TextMetrics interface object should be exposed.", 
    "test": "/workers/semantics/interface-objects/001.worker.html", 
    "line": 331266, 
    "action": "test_result", 
    "expected": "FAIL"
}
@paulrouget paulrouget force-pushed the paulrouget:fakeMeasureTExt branch from dcf9c40 to c222931 Sep 25, 2019
@paulrouget paulrouget force-pushed the paulrouget:fakeMeasureTExt branch from c222931 to 3695fb1 Sep 25, 2019
@paulrouget
Copy link
Contributor Author

paulrouget commented Sep 25, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2019

Trying commit 3695fb1 with merge cad8bf4...

bors-servo added a commit that referenced this pull request Sep 25, 2019
Temporary implementation of Canvas.MeasureText

@jdm: that will help with the babylonjs demos. Another approach is to implement that in JS and add it to the demos.

<!-- 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/24261)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
State: approved= try=True

@paulrouget
Copy link
Contributor Author

paulrouget commented Sep 25, 2019

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2019

📌 Commit 3695fb1 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2019

Testing commit 3695fb1 with merge cf725fc...

bors-servo added a commit that referenced this pull request Sep 25, 2019
Temporary implementation of Canvas.MeasureText

@jdm: that will help with the babylonjs demos. Another approach is to implement that in JS and add it to the demos.

<!-- 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/24261)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 25, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing cf725fc to master...

@bors-servo bors-servo merged commit 3695fb1 into servo:master Sep 25, 2019
3 checks passed
3 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@bors-servo bors-servo mentioned this pull request Sep 25, 2019
0 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.