Giter VIP home page Giter VIP logo

Comments (7)

abrahamjuliot avatar abrahamjuliot commented on May 23, 2024

disregarding https://developer.mozilla.org/en-US/docs/Web/API/Element/computedStyleMap
https://developers.google.com/web/updates/2018/03/cssom

from creepjs.

abrahamjuliot avatar abrahamjuliot commented on May 23, 2024

Interesting find in Chrome:

  • HTMLElement.style and CSSRuleList.style only reveal alias attributes via the for...in loop. But, named attributes are valid on the CSSStyleDeclaration object:. For example, zIndex is returned via the for...in loop and not z-index, but 'z-index' in obj is true and obj['z-index'] returns a valid result "" instead of undefined. "The in operator returns true if the specified property is in the specified object or its prototype chain." - MDN

from creepjs.

abrahamjuliot avatar abrahamjuliot commented on May 23, 2024
//returns the prototype
Object.getOwnPropertyNames(Object.getPrototypeOf(document.body.style))

from creepjs.

abrahamjuliot avatar abrahamjuliot commented on May 23, 2024

d2c1ffc fixes Chrome and gives balanced/accurate readings across all 3 tests

  • dropped total keys since it is unnecessary and subject to easy manipulation
  • dropped methods and properties from the result to reduce output. Note, FF counts alias and named attributes as properties, so including it in the output is a useful option.

from creepjs.

abrahamjuliot avatar abrahamjuliot commented on May 23, 2024

dbea648:

  • preserve order -- entropy evidenced in chrome see 1107088
  • sort in a separate check to determine if keys are matching
  • identify prototype name -- FF and Chrome differ
  • drop CSSRuleList.style argument type check -- not required since I collect all properties and ignore duplicates
  • reduce styleVersion code
  • improve caniuse helper method to limit errors

from creepjs.

abrahamjuliot avatar abrahamjuliot commented on May 23, 2024

Safari Version 13.0.5 (15608.5.11): getComputedStyles returns an additional 9 keys
https://www.diffchecker.com/eJOL5Dhf

from creepjs.

abrahamjuliot avatar abrahamjuliot commented on May 23, 2024

System Styles #70

from creepjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.