[webkit-dev] Deprecation of CSSStyleDeclaration -> getPropertyShorthand method.
Alexis Menard
alexis.menard at openbossa.org
Mon May 21 11:09:21 PDT 2012
Hi,
Let's try the new deprecation process documented as
http://trac.webkit.org/wiki/DeprecatingFeatures.
I would like to propose the deprecation and removal of
getPropertyShorthand of CSSStyleDeclaration.
State of art :
- This method is exposed to the Web.
- Its purpose is to get whether a given CSS property was set from
within a shorthand (i.e.
shouldBeEqualToString("test0.style.getPropertyShorthand('overflow-x')",
"overflow"); is true if the CSS code is setting the overflow and not
overflow-x).
- It is used in 4 layout tests (fast/inspector-support/style.html,
fast/css/font-shorthand.html, fast/css/overflow-property.html,
fast/backgrounds/repeat/resources/background-repeat-shorthand.js)
- It is exposed in the Objective C API.
- It is not implemented by any other vendors (Opera, Firefox, Internet
Explorer).
- There is no specification about it.
- It was added in 2005 http://trac.webkit.org/changeset/11481.
Why removing it?
- It reduces the complexity : CSSProperty class doesn't need to handle
the shorthandID member anymore (and we can remove all the related
functions, simplify the constructor), CSSParser could loose its
m_currentShorthand and m_inParseShorthand members, we also can remove
ShorthandScope class as it would not be needed anymore (ShorthandScope
is created on the stack every time we parse a shorthand). Almost no
impact on performance or memory but still a very good cleanup.
- The API doesn't seem to bring much
Cons?
- It is exposed to the web therefore it could potentially break
something. A quick search of "getPropertyShorthand" on google doesn't
show much except stuff happening on webkit.org (i know this is far
from being accurate on whether this function is used or not but it
means nobody ever wrote about it).
- It is exposed in objective C. Maybe some Apple folks could figure
out if someone is using it inside Apple?
This function was added by Dave Hyatt and reviewed by Maciej
Stachowiak, maybe you guys can tell us why you added it back then (if
your memory is very good as we are talking about 2005 material)?
Thoughts?
Thanks.
--
Alexis Menard (darktears)
Software Engineer
openBossa @ INdT - Instituto Nokia de Tecnologia
More information about the webkit-dev
mailing list