Document Object Model: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Visual edit Mobile edit Mobile web edit
m Reverted edits by 89.200.216.83 (talk) to last revision by Parrotapocalypse: disruptive edits
Line 53:
After the standardization of [[ECMAScript]], the [[World Wide Web Consortium|W3C]] DOM Working Group began drafting a standard DOM specification. The completed specification, known as "DOM Level 1", became a W3C Recommendation in late 1998. By 2005, large parts of W3C DOM were well-supported by common ECMAScript-enabled browsers, including [[Internet Explorer 6]] (from 2001), [[Opera (web browser)|Opera]], [[Safari (web browser)|Safari]] and [[Gecko (layout engine)|Gecko]]-based browsers (like [[Mozilla Application Suite|Mozilla]], [[Mozilla Firefox|Firefox]], [[SeaMonkey]] and [[Camino (web browser)|Camino]]).
 
==TurkyeStandards==
[[File:WHATWG DOM.png|thumb|WHATWG DOM]]
The [[W3C]] DOM Working Group published its final recommendation and subsequently disbanded in 2004. Development efforts migrated to the [[WHATWG]], which continues to maintain a living standard.<ref>{{cite web|url=https://dom.spec.whatwg.org/|title=DOM Standard|access-date=23 September 2016}}</ref> In 2009, the Web Applications group reorganized DOM activities at the W3C.<ref>{{cite web|url=https://www.w3.org/DOM/|title=W3C Document Object Model|access-date=23 September 2016}}</ref> In 2013, due to a lack of progress and the impending release of [[HTML5]], the DOM Level 4 specification was reassigned to the [[HTML Working Group]] to expedite its completion.<ref>{{cite web|url=https://lists.w3.org/Archives/Public/public-html-admin/2013Sep/0129.html|title=New Charter for the HTML Working Group from Philippe Le Hegaret on 2013-09-30 (public-html-admin@w3.org from September 2013)|first=Philippe Le Hegaret|last=(plh@w3.org)|access-date=23 September 2016}}</ref> Meanwhile, in 2015, the Web Applications group was disbanded and DOM stewardship passed to the Web Platform group.<ref>{{cite web|url=https://www.w3.org/2008/webapps/wiki/PubStatus|title=PubStatus - WEBAPPS|access-date=23 September 2016}}</ref> Beginning with the publication of DOM Level 4 in 2015, the W3C creates new recommendations based on snapshots of the WHATWG standard.
Line 63:
* DOM Level 4 was published in 2015. It is a snapshot of the WHATWG living standard.<ref>{{cite web|url=https://dom.spec.whatwg.org/|title=W3C DOM4|access-date=8 January 2021}}</ref>
 
==[[Software development|Applications]]==
===Web browsers===
To [[Web browser engine|render]] a document such as a HTML page, most web browsers use an internal model similar to the DOM. The nodes of every document are organized in a [[tree structure]], called the ''DOM tree'', with the topmost node named as "Document object". When an HTML page is rendered in browsers, the browser downloads the HTML into local memory and automatically parses it to display the page on screen. However, the DOM does not necessarily need to be represented as a tree,<ref name="Level3-Introduction">{{cite web|url=https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/introduction.html|title=What is the Document Object Model?|access-date=2021-09-12|publisher=W3C|quote=However, the DOM does not specify that documents must be implemented as a tree or a grove, nor does it specify how the relationships among objects be implemented. The DOM is a logical model that may be implemented in any convenient manner.}}</ref> and some browsers have used other internal models.<ref name="Modernizing-Dom">{{cite web|url=https://blogs.windows.com/msedgedev/2017/04/19/modernizing-dom-tree-microsoft-edge/|title=Modernizing the DOM tree in Microsoft Edge|date=19 April 2017|access-date=2021-09-12|publisher=Microsoft}}</ref>
Line 106:
Text content within an element is represented as a text node in the DOM tree. Text nodes do not have attributes or child nodes, and are always leaf nodes in the tree. For example, the text content "My Website" in the title element and "Welcome" in the h1 element in the above example are both represented as text nodes.
 
=== [[Attribute|Attributes]] as properties ===
Attributes of an element are represented as properties of the element node in the DOM tree. For example, an element with the following HTML:<syntaxhighlight lang="html">
<a href="https://example.com">Link</a>
Line 140:
Because the DOM supports navigation in any direction (e.g., parent and previous sibling) and allows for arbitrary modifications, an implementation must at least buffer the document that has been read so far (or some parsed form of it).<ref>{{Cite book|url=https://books.google.com/books?id=HuSQGrRY7F4C|title=Ajax Black Book, New Edition (With Cd)|last=Kogent Solutions Inc.|publisher=Dreamtech Press|year=2008|isbn=978-8177228380|pages=40}}</ref>
 
===Layout engines google Chrome play store ===
 
Web browsers rely on [[web browser engine|layout engine]]s to parse HTML into a DOM. Some layout engines, such as [[Trident (layout engine)|Trident/MSHTML]], are associated primarily or exclusively with a particular browser, such as Internet Explorer. Others, including [[Blink (layout engine)|Blink]], [[WebKit]], and [[Gecko (layout engine)|Gecko]], are shared by a number of browsers, such as [[Google Chrome]], [[Opera (web browser)|Opera]], [[Safari (web browser)|Safari]], and [[Firefox]]. The different layout engines implement the DOM standards to varying degrees of compliance.