Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Reduce getComputedStyle calls #69

Merged
merged 2 commits into from
Feb 17, 2017

Conversation

benoitjchevalier
Copy link
Contributor

Fixing #68 by making sure window.getComputedStyle is only called once

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@benoitjchevalier
Copy link
Contributor Author

CLA signed by General Electric, I'm now part of the appropriate google group ([email protected])

Copy link
Member

@valdrinkoshi valdrinkoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment.

@@ -249,7 +249,11 @@

attached: function() {
// Memoize this to avoid expensive calculations & relayouts.
this._isRTL = window.getComputedStyle(this).direction == 'rtl';
// Make sure we do it only once
if(typeof this._isRTL === 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space between if and (

Copy link
Member

@valdrinkoshi valdrinkoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!

@valdrinkoshi valdrinkoshi merged commit 723716d into PolymerElements:master Feb 17, 2017
@benoitjchevalier
Copy link
Contributor Author

Thanks for the quick merge 💯

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants