Auto merge of #23073 - sbansal3096:master, r=emilio

Expose public getter to stylesheet's owner

<!-- Please describe your changes on the following line: -->

- [x] expose a public getter on CSSStyleSheet to return the stylesheet's owner
- [x] in CSSRuleList::insert_rule, use the new getter to pass a non-None value as an argument to arc.insert_rule
- [x] add a test for this that verifies that the new stylesheet is actually loaded
---
<!-- 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 #23028

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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/23073)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-03-22 19:45:08 -04:00 committed by GitHub
commit 059ac12c00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 79 additions and 4 deletions

View file

@ -0,0 +1,6 @@
<!doctype html>
<head>
<meta charset="utf-8">
<title>insertrule @import test reference</title>
<link rel="stylesheet" href="support/black.css">
</head>

View file

@ -0,0 +1,12 @@
<!doctype html>
<head>
<meta charset="utf-8">
<title>insertrule @import test</title>
<link rel="help" href="https://drafts.csswg.org/cssom/">
<link rel="help" href="http://www.w3.org/TR/cssom-1/#the-cssrule-interface">
<link rel="match" href="insertRule-from-script-ref.html">
<style></style>
</head>
<body>
<script>document.styleSheets[0].insertRule("@import url(\"support/black.css\");");</script>
</body>

View file

@ -0,0 +1,4 @@
html {
background-color: black;
color: white;
}