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

Remove redundant RefCell from CanvasState struct #23730

Closed
wants to merge 1 commit into from

Conversation

@chansuke
Copy link
Contributor

chansuke commented Jul 8, 2019

Removed DomRefCell member wrappers from CanvasState.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #23436 (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because it only fixed redundancy.

This change is Reviewable

@highfive
Copy link

highfive commented Jul 8, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/canvasrenderingcontext2d.rs, components/script/dom/offscreencanvasrenderingcontext2d.rs
  • @KiChjang: components/script/dom/canvasrenderingcontext2d.rs, components/script/dom/offscreencanvasrenderingcontext2d.rs
@highfive
Copy link

highfive commented Jul 8, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@CYBAI
Copy link
Collaborator

CYBAI commented Jul 9, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2019

Trying commit 4271f26 with merge d055df5...

bors-servo added a commit that referenced this pull request Jul 9, 2019
Remove redundant RefCell from CanvasState struct

<!-- Please describe your changes on the following line: -->
Removed DomRefCell member wrappers from CanvasState.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23436 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it only fixed redundancy.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/23730)
<!-- Reviewable:end -->
@paulrouget
Copy link
Contributor

paulrouget commented Jul 9, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2019

📌 Commit 4271f26 has been approved by paulrouget

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2019

Previous build results for status-taskcluster are reusable. Rebuilding only linux-rel-css, linux-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2019

💔 Test failed - linux-rel-css

@CYBAI
Copy link
Collaborator

CYBAI commented Jul 9, 2019

Failures in `linux-rel-css`
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.case.html", 
    "line": 38867, 
    "action": "test_result", 
    "expected": "OK"
}
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.html", 
    "line": 39584, 
    "action": "test_result", 
    "expected": "OK"
}
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.html", 
    "line": 40139, 
    "action": "test_result", 
    "expected": "OK"
}
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.null.html", 
    "line": 40622, 
    "action": "test_result", 
    "expected": "OK"
}
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/html/semantics/embedded-content/the-canvas-element/initial.reset.pattern.html", 
    "line": 106360, 
    "action": "test_result", 
    "expected": "OK"
}
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.changed.html", 
    "line": 151463, 
    "action": "test_result", 
    "expected": "OK"
}
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.html", 
    "line": 152146, 
    "action": "test_result", 
    "expected": "OK"
}
{
    "status": "CRASH", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.undefined.html", 
    "line": 173173, 
    "action": "test_result", 
    "expected": "OK"
}
@chansuke
Copy link
Contributor Author

chansuke commented Jul 14, 2019

@CYBAI Thanks for your comment. How can I debug the error of linux-rel-css in my local env?

@CYBAI
Copy link
Collaborator

CYBAI commented Jul 14, 2019

I think you can try to run these tests locally with ./mach test-wpt.

@jdm
Copy link
Member

jdm commented Jul 14, 2019

Specifically ./mach test-wpt /2dcontext/fill-and-stroke-styles/2d.pattern.repeat.case.html will run one failing test and show the output in the terminal.

@bors-servo
Copy link
Contributor

bors-servo commented Jul 24, 2019

The latest upstream changes (presumably #23827) made this pull request unmergeable. Please resolve the merge conflicts.

@chansuke chansuke force-pushed the chansuke:remove-redundant-wrappers branch from 4271f26 to 266109c Jul 27, 2019
@chansuke
Copy link
Contributor Author

chansuke commented Jul 27, 2019

Sorry for taking time, the error says DomRefCell<T> already borrowed: so I at first tried to change this.canvas_state.borrow()this.canvas_state.borrow() in canvasrenderingcontext2 and offscreencanvasrenderingcontext2d but could not get rid of the error, and am stacking right now.

@gterzian
Copy link
Member

gterzian commented Aug 26, 2019

@chansuke since you transform some borrow into borrow_mut, and a borrow can be followed by another borrow but not a borrow_mut, it must be that somewhere where you introduced a borrow_mut, that which is borrowed mutably is already borrow immutably. Previously, the borrow was followed by another borrow, and now it's changed to a mutable borrow, hence the panic.

I can't tell why one it is though...

@jdm
Copy link
Member

jdm commented Aug 26, 2019

@bors-servo try=wpt
The previous logs disappeared.

@bors-servo
Copy link
Contributor

bors-servo commented Aug 26, 2019

Trying commit 266109c with merge d79010f...

bors-servo added a commit that referenced this pull request Aug 26, 2019
Remove redundant RefCell from CanvasState struct

<!-- Please describe your changes on the following line: -->
Removed DomRefCell member wrappers from CanvasState.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23436 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it only fixed redundancy.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

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

bors-servo commented Aug 26, 2019

💔 Test failed - linux-rel-css

@jdm
Copy link
Member

jdm commented Aug 26, 2019

The place to look will be:

 │    6: script::dom::htmlcanvaselement::HTMLCanvasElement::fetch_all_data::haa9dfca3363a0147 (0x55a11a8b1197)
  │    7: script::dom::canvasrenderingcontext2d::CanvasState::CreatePattern::h66931c48f7ad02c7 (0x55a11b28a860)
  │    8: <script::dom::canvasrenderingcontext2d::CanvasRenderingContext2D as script::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasRenderingContext2DBinding::CanvasRenderingContext2DMethods>::CreatePattern::hf7505c94c50526e7 (0x55a11b290a03)

Presumably we borrow in CanvasRenderingContext2D::CreatePattern, then HTMLCanvasElement::fetch_all_data tries to borrow again when it's called from CanvasState::CreatePattern.

@jdm jdm removed the S-awaiting-review label Oct 2, 2019
@bors-servo
Copy link
Contributor

bors-servo commented Oct 8, 2019

The latest upstream changes (presumably #24340) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm
Copy link
Member

jdm commented Apr 8, 2020

Closing due to inactivity.

@jdm jdm closed this Apr 8, 2020
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.

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