summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/DOM/Document.h
AgeCommit message (Collapse)Author
2020-06-07LibWeb: Remove unused Document::on_layout_updated hookAndreas Kling
2020-06-06LibWeb: Make Document::url() return URL by valueAndreas Kling
Returning it by reference can lead to unpleasant situations if we use this getter when the document may go away. Better to make the getter return a copy than have to think about this everywhere.
2020-06-05LibWeb: Don't create a layout node for <noscript> when scripting enabledAndreas Kling
This makes stuff inside <noscript> correctly not show up since we run with scripting enabled. In the future, we can add a way to disable scripting, but for now, Document::is_scripting_enabled() just returns true.
2020-06-04LibWeb: Process style sheets in document orderAndreas Kling
Until now we would simply apply stylesheets in the order they finished loading. This patch adds a StyleSheetList object that hangs off of each Document and contains all the style sheets in document order. There's still a lot of work to do for a proper cascade, but at least this makes us consistently wrong every time. :^)
2020-05-30LibWeb: Handle two kinds of deferred script executionsAndreas Kling
This patch adds two script lists to Document: - Scripts to execute when parsing has finished - Scripts to execute as soon as possible Since we don't actually load scripts asynchronously yet (we just do a synchronous load when parsing the <script> element for simplicity), these are already loaded by the time we get to "The end" of parsing.
2020-05-28LibWeb: Add a "quirks mode" flag to DocumentAndreas Kling
This doesn't do anything yet, but it will sooner or later. :^)
2020-05-27LibWeb: Bring up basic external script execution in the new parserAndreas Kling
This only works in some narrow cases, but should be enough for our own welcome.html at least. :^)
2020-05-26LibWeb: Add document.querySelector()Linus Groh
2020-05-24LibWeb: A whole bunch of work towards spec-compliant <script> elementsAndreas Kling
This is still very unfinished, but there's at least a skeleton of code.
2020-05-10LibWeb: Add Document create_element() and create_text_node() helpersAndreas Kling
2020-04-07LibWeb: Add Origin concept (protocol, host, port tuple)Andreas Kling
Every Document now has an Origin, found via Document::origin(). It's based on the URL of the document. This will be used to implement things like the same-origin policy.
2020-04-04LibWeb: Handle javascript: URLs inside LibWeb :^)Andreas Kling
This patch makes it possible to execute JavaScript by clicking on an anchor element with href="javascript:your_script_here()".
2020-04-01LibWeb+LibJS: Move DOM Window object to dedicated classesAndreas Kling
LibWeb now creates a WindowObject which inherits from GlobalObject. Allocation of the global object is moved out of the Interpreter ctor to allow for specialized construction. The existing Window interfaces are moved to WindowObject with their implementation code in the new Window class.
2020-03-30LibWeb: Add naive support for document.querySelectorAll()Andreas Kling
This currently returns a JS::Array of elements matching a selector. The more correct behavior would be to return a static NodeList, but as we don't have NodeLists right now, that'll be a task for the future.
2020-03-28LibWeb: Move get_element_by_id() to a NonElementParentNode mixin classAndreas Kling
This matches the current version of the DOM spec. And since C++ doesn't have mixins this is actually a CRTP class.
2020-03-25LibWeb: Add Document::invalidate_layout()Andreas Kling
This function allows you to throw away the entire layout tree if that's something you want to do. It's certainly not super cheap to reconstruct, but hey, who am I to tell you what to do? :^)
2020-03-22LibWeb: Use FlyString for Element tag namesAndreas Kling
This makes selector matching a lot more efficient, and also reduces the number of strings on the heap.
2020-03-14LibWeb: Start implementing basic JavaScript DOM bindingsAndreas Kling
This patch introduces the Wrapper and Wrappable classes. Node now inherits from Wrappable, and can be wrapped in a GC-allocated Bindings::NodeWrapper object. The only property we expose right now is the very simple nodeName property. When a Document's JS::Interpreter is first instantiated, we add a "document" property with a DocumentWrapper object to the global object. This is pretty cool! :^)
2020-03-14LibWeb: Parse <script> elements and run any JavaScript found insideAndreas Kling
This patch begins integrating LibJS into LibWeb. Document holds the JS::Interpreter for now, and it is created on demand when you first call Document::interpreter(). We also add a simple "alert()" function to the global object.
2020-03-07LibWeb: Rename directory LibHTML => LibWebAndreas Kling
Let's rename this to LibWeb since it aims to provide more parts of the web platform than just HTML. :^)