[1] [DFN[CSSOM]] ([DFN[CSS Object Model]]) は、 [[Webブラウザー]]などで利用可能な [[CSS]]
[[スタイル・シート]]やそれに基づく[[レンダリング]]に関する [[DOM API]] です。

* 仕様書

[REFS[
- [62] [CITE@en[CSS Object Model (CSSOM)]] ([TIME[2015-11-22 17:13:36 +09:00]] 版) <https://drafts.csswg.org/cssom/>
-- [59] [CITE@en[CSS Object Model (CSSOM)]] ([TIME[2015-07-03 16:13:04 +09:00]] 版) <http://dev.w3.org/csswg/cssom/>
]REFS]

[57] [[CSSOM]] 本体の他に、 [[CSSOM View]] があります。

[58] [[CSSOM Values]] もありますが、関心が低く放置状態にあります。

* 表記

[21] 「[[CSSOM]]」は初期には「[[DOM CSS]]」などと呼ばれたり、「[[CSS OM]]」と2語に綴られたりいろいろな表記がなされました。 

* API

[FIG(short list)[
- [CODE(DOMi)@en[[[CSSStyleSheet]]]]
- [CODE(DOMi)@en[[[CSSRule]]]]
- [CODE(DOMi)@en[[[CSSStyleDeclaration]]]]
- [CODE(DOMi)@en[[[CSSValue]]]]
]FIG]

* 歴史

** DHTML

[53] [[DHTML]] 時代には、 [[IE4 DOM]] において [CODE(DOMa)@en[[[style]]]]
[[IDL属性]]が実装されました。また現在の [[CSSOM]] と似て非なる [[API]]
が実装されました。

[54] 同時期に [[Netscape 4]] が [[JSSS]] を実装しましたが、これは [[Gecko]]
移行により破棄され現在の [[CSSOM]] にはつながっていません。


[71] [CITE@EN-US[Managing Style Sheets]], [[InetSDK]], [TIME[2024-08-17T06:22:12.000Z]], [TIME[2000-11-17T11:30:12.807Z]] <https://web.archive.org/web/20001117112100/http://msdn.microsoft.com/workshop/author/dynstyle/style_sheets.asp>



** DOM2 Style

[8] [[DOM Level 2 Style]] および [[DOM Level 2 CSS]] が [[W3C勧告]]になっています。
この当時は [[CSSOM]] という呼称はまだありませんでした。

[55] おおむね [[IE4 DOM]] の [[CSS]] 部分を踏襲していましたが、
ほとんどの[[メソッド名]]などが異なっていました。

[56] [[政治的]]その他の理由で敢えて実装されているものと似て非なるものを標準化するという手法は
[[IETF]] や [[W3C]] でしばしば採られていますが、大抵は互換性の問題を生み業界を混乱させる結果となっています。
[[CSSOM]] の場合もその後10年以上にわたり [[IE4]] 由来の [[CSSOM]] と [[W3C]]
由来の [[CSSOM]] の実装で分裂し混乱しました。

[69] [[CEA-2014-B]]

[70] 
[DFN[KS X 6047-4:2011]]
は
[[DOM2 Style]] の
[[KS]]
版。

** Early work on CSSOM at W3C CSSWG

[15]
[CITE@en[DOM 2 Style/CSS Issues List]]
<http://daniel.glazman.free.fr/csswg/DOM_2_Style_Issues.html>

[14]
[CITE@en[CSS Editing Object Model]]
<http://daniel.glazman.free.fr/csswg/csseom/csseom.html>

[12]
[CITE[CSS Editing and Selectors Object Models]] <http://daniel.glazman.free.fr/csswg/csseom/csseom-0.00-01.htm>

** 選択子 API

[13]
[CITE['''['''whatwg''']''' getElementsByClassName()]] ([CODE[2006-02-06 11:06:49 +09:00]] 版) 
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-February/005771.html>([[名無しさん]] [WEAK[2006-02-06 03:57:41 +00:00]])

> Probably doesn't matter which group does it since it'd end up being me 
doing the work either way... At the time where I made that comment, the 
CSSWG was planning on creating a CSSOM spec to replace the DOM2 CSS spec. 
That plan still vaguely exists, though it isn't a high priority for the 
CSS group.
> I can certainly see myself speccing a getElementsBySelector() API as part 
of Selectors 2. But either way, the spec for gEBS is simple; it returns 
the same type as getElementsByTagName(), it is accessible from Document 
and Element nodes and selects a subset of the descendants of that node, it 
takes a single argument (a string representing a selector), its first 
version doesn't support namespaces, and it raises an exception SYNTAX_ERR 
if the string can't be successfully parsed by the UA.

[10]
[CITE[ACTION-87: Selectors API from Anne van Kesteren on 2006-02-25 (public-webapi@w3.org from February 2006)]] <http://lists.w3.org/Archives/Public/public-webapi/2006Feb/0108.html>
([[名無しさん]] [WEAK[2006-02-26 02:46:14 +00:00]])

> During the F2F I got an action assigned to me to draft something up for  
getElementsBySelector().

[17] 以後の動きについては[[選択子API]]の項を参照。

** [CODE(DOMi)@en[CSSValue]]

[11]
[CITE[Re: [SVGMobile12] SVGT12-207: Conformance to uDOM from Ian Hickson on 2006-01-03 (www-svg@w3.org from January 2006)]] <http://lists.w3.org/Archives/Public/www-svg/2006Jan/0066.html>
([[名無しさん]] [WEAK[2006-02-16 03:07:36 +00:00]])

> There are plans for making big improvements to the CSSOM [INS[...]]

[2]
[CITE[[CSSOM] CSSValue and related interfaces (message from the CSS WG) from Bert Bos on 2003-10-30 (www-style@w3.org from October 2003)]] <http://lists.w3.org/Archives/Public/www-style/2003Oct/0347>

> One of the specifications that the CSS WG is chartered to write is a new
version of the Document Object Model for CSS, or CSSOM for short. We don't
have a Working Draft yet, but the following is is an official statement by
the CSS. It represents the current consensus in the WG:
>> The following DOM2 Style features are considered to be problematic
and are therefore classified as obsolete. Implementors are strongly
urged not to implement them. Replacements will be provided at some
future point.
>>> The UnknownRule interface (unknown rules should be dropped by
the parser and thus never reach the DOM)
>>> The getPropertyCSSValue method, CSSValue interface, all
interfaces inheriting from CSSValue, and the RGBColor, Rect, and
Counter interfaces (the CSSValue interface is thought to be too
awkward for frequent use)

[20]
[[Ian Hickson]] の提案
<http://damowmow.com/temp/csswg/dom/values>

** CSSOM Draft 2006- by W3C CSSWG

[1]
[CITE[Cascading Style Sheets Object Model (CSSOM)]] <http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.src.html>
([[名無しさん]] [WEAK[2006-12-09 08:07:12 +00:00]])

[4]
[CITE[csswg/cssom/Overview.src.html - diff - 1.24]] ([CODE[2007-02-04 18:33:01 +09:00]] 版) <http://dev.w3.org/cvsweb/csswg/cssom/Overview.src.html.diff?r1=1.23&r2=1.24&f=h>

> 8EC0 -> Gecko	   
> 09E8A -> Opera

ちょwwwwwww 象形かYOwwwwwwwwwwwwwwwww

** CSSOM View

[7]
[CITE[CSSOM: clientHeight, offsetHeight and scrollHeight - Anne’s Weblog]] ([CODE[2007-08-04 03:57:35 +09:00]] 版) <http://annevankesteren.nl/2007/08/cssom-mess>

[18]
[CITE@en-US[CSSOM View Module]] ([CODE[2007-12-01 07:31:03 +09:00]] 版) <http://dev.w3.org/cvsweb/~checkout~/csswg/cssom-view/Overview.html?rev=1.1&content-type=text/html;%20charset=iso-8859-1>
([[名無しさん]])

[19]
>>18 元の [[CSSOM]] Editor's Draft の Layout API の部分が独立したようです。

以後については [[CSSOM View]] の項をご覧ください。

* memo

[9]
[CITE[JavaScript tutorial - DOM Style Sheets]] <http://www.howtocreate.co.uk/tutorials/javascript/domstylesheets>

[3]
[CITE[CSS + JavaScript Tips]] ([CODE[2007-01-18 15:22:10 +09:00]] 版) <http://usrb.in/amachang/static/cssstudy/200701/>
([[名無しさん]] [WEAK[2007-01-19 15:44:18 +00:00]])

[5]
[CITE[404 Blog Not Found:javascript - CSSをいじくる]] ([CODE[2007-03-12 07:19:59 +09:00]] 版) <http://blog.livedoor.jp/dankogai/archives/50784253.html>

> JavaScriptでDOM要素のstyle属性をいじるのは簡単ですが、これがCSSともなるとobject treeが深くて大変で、Webを見回してもほとんど参考例がありません。

日本語でおkwwwwwwwww

([[名無しさん]] [WEAK[2007-03-11 22:33:05 +00:00]])

[6]
[CITE[erik’s weblog &#187; Blog Archive &#187; Computed vs Cascaded Style]] ([CODE[2007-07-28 11:50:01 +09:00]] 版) <http://erik.eae.net/archives/2007/07/27/18.54.15/>
([[名無しさん]] [WEAK[2007-07-28 02:59:28 +00:00]])

[16]
[[Live CSSOM Viewer]]


[22] [CITE[CSSOM: New Beginning — Anne’s Weblog]]
([TIME[2009-11-15 14:51:56 +09:00]] 版)
<http://annevankesteren.nl/2009/10/cssom-new-beginning>

[23] [CITE[IRC logs: freenode / #whatwg / 20091015]]
([TIME[2009-12-10 00:05:28 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20091015#l-206>

[24] [CITE[IRC logs: freenode / #whatwg / 20100316]]
([TIME[2010-03-21 11:57:02 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20100316>

[25] [CITE[IRC logs: freenode / #whatwg / 20100615]]
([TIME[2010-06-27 13:23:25 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20100615#l-571>

[26] [CITE[IRC logs: freenode / #whatwg / 20100831]]
( ([TIME[2010-09-11 22:28:55 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20100831>

[27] [CITE[IRC logs: freenode / #whatwg / 20110113]]
( ([TIME[2011-01-20 22:41:09 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20110113>

[28] [CITE@en-US[CSSOM]]
( ([TIME[2011-07-12 02:26:01 +09:00]] 版))
<http://www.w3.org/TR/2011/WD-cssom-20110712/>

[29] [CITE@en[Extensions to the CSS Object Model - W3C Blog]]
( ([TIME[2011-07-26 16:06:08 +09:00]] 版))
<http://www.w3.org/QA/2011/07/extensions_to_the_css_object_m.html>

[30] [CITE@en-US[The CSS Object Model - Slide list]]
( ([TIME[2001-10-15 05:34:15 +09:00]] 版))
<http://www.w3.org/Talks/1999/0514-cssom-www8-plh/>

[31] [CITE[IRC logs: freenode / #whatwg / 20111221]]
( ([TIME[2011-12-22 23:59:51 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111221#l-481>

[32] [CITE[IRC logs: freenode / #whatwg / 20120109]]
( ([TIME[2012-01-12 01:37:31 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20120109#l-426>

[33] [CITE[IRC logs: freenode / #whatwg / 20120207]]
( ([TIME[2012-02-10 00:08:02 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20120207#l-383>

[34] [CITE[IRC logs: freenode / #whatwg / 20120215]]
( ([TIME[2012-02-18 10:49:17 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20120215#l-594>

[35] [CITE[IRC logs: freenode / #whatwg / 20120502]]
( ([TIME[2012-05-06 21:45:58 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20120502>

[36] [CITE[IRC logs: freenode / #whatwg / 20120618]]
( ([TIME[2012-07-01 21:54:40 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20120618#l-1051>

[37] [CITE@en[''''''[''''''CSSOM'''''']'''''' CSSValue and related interfaces (message from the CSS WG)]]
( ([[Bert Bos]] 著, [TIME[2003-10-31 07:45:20 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html>

[38] [CITE[IRC logs: freenode / #whatwg / 20121207]]
( ([TIME[2012-12-16 15:20:55 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20121207#l-678>

[39] [CITE[IRC logs: freenode / #whatwg / 20130313]]
( ([TIME[2013-03-23 12:00:18 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130313#l-890>

[40] [CITE[IRC logs: freenode / #whatwg / 20130419]]
( ([TIME[2013-05-01 23:09:17 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130419#l-459>

[41] [CITE[IRC logs: freenode / #whatwg / 20130422]]
( ([TIME[2013-05-03 23:39:29 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130422#l-419>

[42] [CITE[IRC logs: freenode / #whatwg / 20071003]]
( ([TIME[2013-05-22 12:31:36 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20071003>

[43] [CITE@en-US[cssom: Summary]]
( ([TIME[2013-05-26 02:12:32 +09:00]] 版))
<https://dvcs.w3.org/hg/cssom/>

[44] [CITE@en-US[CSS Object Model (CSSOM)]]
( ([TIME[2013-05-24 13:44:30 +09:00]] 版))
<http://dev.w3.org/csswg/cssom/>

[45] [CITE@en-US[csswg: File revisions]]
( ([TIME[2013-05-26 02:15:48 +09:00]] 版))
<https://dvcs.w3.org/hg/csswg/log/1fce354eb139/cssom/Overview.src.html>

[46] [CITE[Introduction to CSSOM (1) - DOM ECMAScripting]]
( ([TIME[2012-02-18 20:10:11 +09:00]] 版))
<http://domes.lingua.heliohost.org/dom/intro-cssom1.html>

[47] [CITE[IRC logs: freenode / #whatwg / 20130529]]
( ([TIME[2013-05-30 20:48:40 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20130529#l-188>

[48] [CITE@en-US[CSS Object Model (CSSOM)]]
( ([TIME[2013-12-05 07:19:58 +09:00]] 版))
<http://www.w3.org/TR/2013/WD-cssom-20131205/>

[49] [CITE@en[Web Applications 1.0 r8390     Update how the interaction with CSS style sheets and CSSOM is defined.]]
( ([TIME[2014-01-14 07:45:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8389&to=8390>

[50] [CITE@en-US[csswg: File revisions]]
( ([TIME[2014-01-14 23:39:11 +09:00]] 版))
<https://dvcs.w3.org/hg/csswg/log/tip/cssom/Overview.src.html>

[51] [CITE[IRC logs: freenode / #whatwg / 20140113]]
( ([TIME[2014-01-15 08:51:21 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140113#l-241>

[52] [CITE@en[CSS DOM woes]]
( ([[Bjoern Hoehrmann]] 著, [TIME[2001-09-30 12:13:31 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2001Sep/0093.html>

[60] [CITE@en[''''''[''''''css-typed-om'''''']'''''' Initial commit · w3c/css-houdini-drafts@6132bef]]
([TIME[2015-10-08 11:17:58 +09:00]] 版)
<https://github.com/w3c/css-houdini-drafts/commit/6132beff7f47ac09b0f220506a54f70e6d494850>

[61] [CITE@en[Re: Typed CSSOM]]
([[Shane Stephens]] 著, [TIME[2015-10-07 10:19:44 +09:00]] 版)
<https://lists.w3.org/Archives/Public/public-houdini/2015Oct/0000.html>

[63] [CITE@en[CSS Object Model (CSSOM)]]
([TIME[2016-03-17 15:49:30 +09:00]] 版)
<https://www.w3.org/TR/2016/WD-cssom-1-20160317/>

[64] [CITE@en[''''''[''''''CSSWG'''''']''''''''''''[''''''cssom'''''']''''''''''''[''''''cssom-view'''''']'''''' Updated WD of CSSOM and CSSOM View]]
([[Simon Pieters]] 著, [TIME[2016-03-17 20:28:16 +09:00]] 版)
<https://lists.w3.org/Archives/Public/www-style/2016Mar/0248.html>

[65] [CITE@en[Stepping down]]
([[Simon Pieters]]著, [TIME[2017-09-11 22:41:40 +09:00]])
<https://lists.w3.org/Archives/Public/www-style/2017Sep/0023.html>

[66] [CITE@en['''['''css-animations''']''''''['''css-conditional''']''''''['''css-font-loading''']''''''['''cssom-view''']''''''['''cssom…]]
([[zcorpan]]著, [TIME[2017-09-15 20:39:20 +09:00]])
<https://github.com/w3c/csswg-drafts/commit/c2541c830fb6c80687b026efacdf3bfa936f102c>

[67] [CITE@en['''['''css-animations''']''''''['''css-conditional''']''''''['''css-font-loading''']''''''['''cssom-view''']''''''['''cssom''']''''''['''mediaqueries''']''' IDL: Use '''['''Exposed''']''' consistently by zcorpan · Pull Request #1749 · w3c/csswg-drafts]]
([TIME[2017-09-16 19:10:31 +09:00]])
<https://github.com/w3c/csswg-drafts/pull/1749>

[68] [CITE@en[Add me as an editor of CSSOM as resolved in the Berlin F2F.]]
([[emilio]]著, [TIME[2018-04-14 04:27:16 +09:00]])
<https://github.com/w3c/csswg-drafts/commit/35f433a226871a26287f9d9e1470345068eb132f>