diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-02-27 04:52:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-27 04:52:05 -0500 |
commit | ac162e8f72d46280d8501dc670e3d823d0c8fdf9 (patch) | |
tree | ecb59326ca6395f5a0bf4feea595507446510557 /components/script/script_thread.rs | |
parent | da8604991e47244a4ef6e728b3b8bc2de7f53668 (diff) | |
parent | 8d093982307275026d79af45afa29512cef1180c (diff) | |
download | servo-ac162e8f72d46280d8501dc670e3d823d0c8fdf9.tar.gz servo-ac162e8f72d46280d8501dc670e3d823d0c8fdf9.zip |
Auto merge of #20012 - alexfjw:avoid_Window-GetComputedStyle_when_checking_for_display-none, r=emilio
Avoid `Window::GetComputedStyle` when checking for `display: none`
<!-- Please describe your changes on the following line: -->
Refactored Window::GetComputedStyle to use Element::Style.
Not sure which tests are relevant, but I've ran the dom, fetch & 2dcontext wpt tests. They don't seem to give errors.
---
<!-- 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 #19885.
<!-- Either: -->
- [x] These changes do not require tests because it's a refactoring task
<!-- 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/20012)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 3a51c812dce..f386d29487e 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -25,7 +25,6 @@ use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; use devtools_traits::CSSError; use document_loader::DocumentLoader; use dom::bindings::cell::DomRefCell; -use dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::EventBinding::EventInit; use dom::bindings::codegen::Bindings::TransitionEventBinding::TransitionEventInit; @@ -1926,7 +1925,7 @@ impl ScriptThread { node.dirty(NodeDamage::NodeStyleDamaged); if let Some(el) = node.downcast::<Element>() { - if &*window.GetComputedStyle(el, None).Display() == "none" { + if !el.has_css_layout_box() { return; } } |