summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/DOM/Element.h
AgeCommit message (Collapse)Author
2020-08-18LibWeb: Implement Element.innerTextNico Weber
Reading the property has a few warts (see FIXMEs in the included tests), but with this the timestamps on http://45.33.8.238/ get localized :^) Since the Date() constructor currently ignores all arguments, they don't get localized correctly but are all set to the current time, but hey, it's still progress from a certain point of view.
2020-08-15LibWeb: Allow focusing individual (focusable) elements with Tab keyAndreas Kling
You can now cycle through focusable elements (currently only hyperlinks are focusable) with the Tab key. The focus outline is rendered in a new FocusOutline paint phase.
2020-08-12LibWeb: Fix #include <LibWeb/{DOM => HTML}/AttributeNames.h>Linus Groh
This file has been moved from DOM/ to HTML/ in a784090b91139776b26fbac2a8426de3abdea308.
2020-08-03LibWeb: Move "element sibling" getters to NonDocumentTypeChildNodeAndreas Kling
Here's another CRTP mixin since that's the best we can do with C++. This prepares exposing these via IDL on Element and CharacterData.
2020-08-03LibWeb: Move contentEditable from Element to HTMLElementLuke
HTMLElement is the only interface that includes ElementContentEditable in the HTML specification. This makes sense, as Element is also a base class for elements in other specifications such as SVG, which definitely shouldn't be editable. Also adds a test for the attribute based on what Andreas did in the video that added it.
2020-08-02LibWeb: Implement the Element.contentEditable IDL attributeAndreas Kling
2020-08-02LibWeb: Only allow editing of elements with contenteditable="true"Andreas Kling
We now respect the contenteditable HTML attribute and only let you edit content inside explicitly editable elements.
2020-07-26LibWeb: Move CSS classes into the Web::CSS namespaceAndreas Kling
2020-07-26LibWeb: Move DOM classes into the Web::DOM namespaceAndreas Kling
LibWeb keeps growing and the Web namespace is filling up fast. Let's put DOM stuff into Web::DOM, just like we already started doing with SVG stuff in Web::SVG.
2020-07-26LibWeb: Switch to using AK::is and AK::downcastAndreas Kling
2020-07-24LibWeb: Use [Reflect] for Element.id and Element.className :^)Andreas Kling
2020-07-23LibWeb: Rename Element::tag_name() => local_name()Andreas Kling
To prepare for fully qualified tag names, let's call this local_name. Note that we still keep an Element::tag_name() around since that's what the JS bindings end up calling into for the Element.tagName property.
2020-06-24LibWeb: Move border width and color into LayoutStyleAndreas Kling
To make this possible, I also had to give each LayoutNode a Document& so it can resolve document-specific colors correctly. There's probably ways to avoid having this extra member by resolving colors later, but this works for now.
2020-06-21LibWeb: Add Element.tagName and Element.classNameAndreas Kling
2020-06-21LibWeb: Generate Element bindings from IDL :^)Andreas Kling
Had to do a bunch more hacking on WrapperGenerator to support this. We now support attribute setters as well.
2020-06-16LibWeb: Make Element::tag_name() return a const FlyString&Andreas Kling
The more generic virtual variant is renamed to node_name() and now only Element has tag_name(). This removes a huge amount of String ctor/dtor churn in selector matching.
2020-06-13LibWeb: Add basic <object> element supportAndreas Kling
This patch implements a simple <object> element with fallback content. If the URL from the data attribute fails to load (including 404), we render the DOM tree inside the <object> as fallback content. This works by generating a different layout tree for the <object> depending on the state and success of the data load. Since we cannot currently do incremental layout tree updates, we have to force a complete layout tree rebuild when the resource load finishes/fails.
2020-06-12LibWeb: Include class names in layout tree dumpsAndreas Kling
This makes it a lot easier to see which layout node is which DOM node.
2020-06-07LibWeb: Add HTML::TagNames namespace for global tag name FlyStringsAndreas Kling
Instead of "iframe", we can now say HTML::TagNames::iframe and avoid a FlyString lookup.
2020-06-03LibWeb: Use HTML::AttributeNames::foo instead of FlyString("foo")Andreas Kling
To avoid the costly instantiation of FlyStrings whenever we're looking up attributes, use the premade HTML::AttributeNames globals. :^)
2020-05-26LibWeb: Let Element cache its list of classesAndreas Kling
Instead of string splitting every time you call Element::has_class(), we now split the "class" attribute value when it changes, and cache the individual classes as FlyStrings in Element::m_classes. This makes has_class() significantly faster and moves the pain point of selector matching somewhere else.
2020-05-22LibWeb: Move Attribute to its own header fileAndreas Kling
This will allow us to use it without including Element.h
2020-03-25LibWeb: Implement getting and setting element.innerHTMLAndreas Kling
Getting the innerHTML property will recurse through the subtree inside the element and serialize it into a string as it goes. Setting it will parse the set value as an HTML fragment. It will then remove all current children of the element and replace them with all the children inside the parsed fragment. Setting element.innerHTML will currently force a complete rebuild of the document's layout tree. This is pretty neat! :^)
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-22LibWeb: Use FlyString for element attribute namesAndreas Kling
Attribute names occur again and again.
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. :^)