Closed Bug 1339627 Opened 7 years ago Closed 7 years ago

stylo: nsXULPrototypeCache needs to be able to hold ServoStyleSheets

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: bradwerth, Assigned: bradwerth)

References

Details

Attachments

(2 files)

To maintain performance, we'll need to be able to cache XUL style sheets, also.
See Also: → 1290218
Assignee: nobody → bwerth
Comment on attachment 8841129 [details]
Bug 1339627 Part 1: Add a Servo-specific StyleSheet table to nsXULPrototypeCache.

https://reviewboard.mozilla.org/r/115464/#review119082

::: dom/xul/nsXULPrototypeCache.h:132
(Diff revision 2)
> -    nsRefPtrHashtable<nsURIHashKey,mozilla::StyleSheet>      mStyleSheetTable;
> +    StyleSheetTable                                          mStyleSheetTableGecko;
> +    StyleSheetTable                                          mStyleSheetTableServo;

Other similar pairs of variables are called mGeckoBlah/mServoBlah (for example those on nsStyleSheetService) so let's follow the same pattern here.

::: dom/xul/nsXULPrototypeCache.cpp:194
(Diff revision 2)
>      return NS_OK;
>  }
>  
> +mozilla::StyleSheet*
> +nsXULPrototypeCache::GetStyleSheet(nsIURI* aURI,
> +                                   mozilla::StyleBackendType aType)

No need for the "mozilla::" here since we've got a "using namespace mozilla" at the top of the file.

::: dom/xul/nsXULPrototypeCache.cpp:202
(Diff revision 2)
> +    return table.GetWeak(aURI);
> +}
> +
>  nsresult
> -nsXULPrototypeCache::PutStyleSheet(StyleSheet* aStyleSheet)
> +nsXULPrototypeCache::PutStyleSheet(StyleSheet* aStyleSheet,
> +                                   mozilla::StyleBackendType aType)

And here.

::: dom/xul/nsXULPrototypeCache.cpp:266
(Diff revision 2)
> -  for (auto iter = mStyleSheetTable.Iter(); !iter.Done(); iter.Next()) {
> +  mozilla::StyleBackendType tableTypes[] = { mozilla::StyleBackendType::Gecko,
> +                                             mozilla::StyleBackendType::Servo };

Here too.
Attachment #8841129 - Flags: review?(cam) → review+
Comment on attachment 8841130 [details]
Bug 1339627 Part 2: Change StyleSheet Loader to attempt to cache ServoStyleSheets.

https://reviewboard.mozilla.org/r/115466/#review119118
Attachment #8841130 - Flags: review?(cam) → review+
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f7367db2913f
Part 1: Add a Servo-specific StyleSheet table to nsXULPrototypeCache. r=heycam
https://hg.mozilla.org/integration/autoland/rev/817642eb6e45
Part 2: Change StyleSheet Loader to attempt to cache ServoStyleSheets. r=heycam
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s 8ae3b8ac2185 -d c1e2141e8efe: rebasing 379800:8ae3b8ac2185 "Bug 1339627 Part 1: Add a Servo-specific StyleSheet table to nsXULPrototypeCache. r=heycam"
merging layout/style/Loader.cpp
warning: conflicts while merging layout/style/Loader.cpp! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s 02987e0dd6a9 -d 0632a4a7fb66: rebasing 379847:02987e0dd6a9 "Bug 1339627 Part 1: Add a Servo-specific StyleSheet table to nsXULPrototypeCache. r=heycam"
merging layout/style/Loader.cpp
warning: conflicts while merging layout/style/Loader.cpp! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
https://hg.mozilla.org/mozilla-central/rev/f7367db2913f
https://hg.mozilla.org/mozilla-central/rev/817642eb6e45
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: