summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2021-10-03LibJS: Convert set_integrity_level() to ThrowCompletionOrLinus Groh
2021-10-03LibJS: Convert Object::set() to ThrowCompletionOrLinus Groh
2021-10-03LibJS: Convert Object::get() to ThrowCompletionOrLinus Groh
To no one's surprise, this patch is pretty big - this is possibly the most used AO of all of them. Definitely worth it though.
2021-10-03LibWeb: Only auto-reschedule HTML::EventLoop when there are runnablesAndreas Kling
HTML::EventLoop tries to reschedule itself when there are more tasks in any of its queues, but let's not do it if none of them are runnable.
2021-10-03LibWeb: Remove unnecessary `this` capture in RequestAnimationFrameDriverAndreas Kling
2021-10-03LibWeb: Remove pointless brackets from Length::to_string()Andreas Kling
Since we expose these strings to web content via LengthStyleValue, let's not have non-standard brackets in there to confuse anyone trying to parse these values. :^)
2021-10-03LibWeb: Make ColorStyleValue serialization spec compliantAndreas Kling
[CSS Color 4] tells us to use either rgb() or rgba() notation, depending on the color's alpha value.
2021-10-03LibWeb: Don't update rendering in BrowsingContexts without opportunityAndreas Kling
This patch adds the "has a rendering opportunity" concept from the spec to BrowsingContext and uses it to filter out contexts that are unable to render right now when doing the event loop's rendering updates. Note that we actually consider all contexts to have a rendering opportunity at all times right now. Coming up with reasons to avoid rendering is left as a FIXME. :^)
2021-10-03LibWeb: Let HTML::EventLoop drive the firing of `resize` eventsAndreas Kling
2021-10-03LibWeb: Let HTML::EventLoop drive animation frame callbacksAndreas Kling
2021-10-03LibWeb: Let HTML::EventLoop keep track of live DOM::Document objectsAndreas Kling
This will be used by the event loop processing model.
2021-10-03LibWeb: Allow Document::ref() when ref-count is zeroAndreas Kling
DOM::Document has some special lifetime rules to support the DOM lifetime semantics expected on the web. Any DOM node will keep its document alive as well, even after the document's ref-count has reached zero. This is achieved by the Document::m_referencing_node_count counter. Because of this mechanism, we can't VERIFY(m_ref_count) in TreeNode where T may be a DOM::Document.
2021-10-03LibWeb: Only take runnable tasks from the HTML task queueAndreas Kling
We were previously willing to execute tasks before they had become runnable.
2021-10-03LibWeb: Improve HTML::EventLoop::spin_until()Andreas Kling
This algorithm now saved and restores the JavaScript execution context stack while performing a microtask checkpoint, as the spec mandates.
2021-10-03LibWeb: Have CSSStyleRule inherit from CSSRule in IDLLuke Wilde
This also allows removing the cssText attribute being on CSSStyleRule.
2021-10-03LibWeb: Pass the correct timestamp to requestAnimationFrame callbacksAndreas Kling
The timestamp needs to be consistent with the "current high resolution time" as reflected by window.performance.now
2021-10-03LibWeb: Run setTimeout() and setInterval() callbacks as HTML tasksAndreas Kling
We now invoke DOM timer callbacks via HTML tasks. This brings callback sequencing closer to the spec, although there are still many imperfections in this area.
2021-10-03LibWeb: Convert Node.childNodes to NodeListLuke Wilde
This changes the old child_nodes implementation to children_as_vector so that can still be used in insert_before.
2021-10-03LibWeb: Convert ParentNode.querySelectorAll to NodeListLuke Wilde
2021-10-03LibWeb: Add support for NodeListLuke Wilde
This introduces 3 classes: NodeList, StaticNodeList and LiveNodeList. NodeList is the base of the static and live versions. Static is a snapshot whereas live acts on the underlying data and thus inhibits the same issues we have currently with HTMLCollection. They were split into separate classes to not have them weirdly mis-mashed together. The create functions for static and live both return a NNRP to the base class. This is to prevent having to do awkward casting at creation and/or return, as the bindings expect to see the base NodeList only.
2021-10-02LibJS: Put zombie cell tracking code behind a compile-time flagAndreas Kling
Since this is a debug-only feature, let's not have it impact GC marking performance when you don't need it.
2021-10-02LibJS+LibWeb: Use Object::set_prototype() in more placesLinus Groh
2021-10-02LibWeb: Implement Navigator.cookieEnabledLinus Groh
2021-10-01LibWeb: Implement CSSRule and CSSStyleDeclaration serializationAndreas Kling
There are a handful of FIXME's here, but this seems generally good. Note that CSS *values* don't get serialized in a spec-compliant way since we currently rely on StyleValue::to_string() which is ad-hoc.
2021-10-01LibWeb: Make CSSStyleDeclaration support both dashed-name and camelCaseAndreas Kling
Turns out we need to support *both* of these styles since there's content that uses one or both of these.
2021-10-01LibWeb: Add missing virtual/override/final in CSSStyleRuleAndreas Kling
2021-10-01LibWeb: Flexbox: Catch zero flex-basis and use width insteadTobias Christiansen
A flex-basis of zero doesn't actually mean that the preferred size of the particular Box is 0. It means that the Box should take the least amount of space possible while still accomodating the content inside. We catch and circumvent this now right when the flex-basis property gets read for the FlexFormattingContext. This isn't mentioned anywhere in the seemingly relevant portions of the spec, however thanks to this answer https://stackoverflow.com/a/47579078 (which is not entirely correct about width either) lead to the behavior that is wanted and used by other Browsers.
2021-10-01LibWeb: Create real Keybord & Message events in Document::create_eventIdan Horowitz
2021-10-01LibWeb: Change the type of MouseEvent members to doubleIdan Horowitz
These are defined as integers only in the legacy specification, the new one defines these as doubles.
2021-10-01LibWeb: Add the missing KeyboardEvent IDL constructorIdan Horowitz
This commit also does a bit of general cleanup on the header file.
2021-10-01LibWeb: Dispatch keydown/keyup events on the appropriate targetIdan Horowitz
2021-10-01LibWeb: Change the parent interface of MouseEvent to UIEventIdan Horowitz
This was accidentally set to Event
2021-10-01LibWeb: Add the missing UIEvent IDL constructorIdan Horowitz
2021-10-01LibWeb: Add the UIEvent::{view, detail} IDL attributesIdan Horowitz
2021-10-01LibWeb: Add the missing PageTransitionEvent IDL constructorIdan Horowitz
2021-10-01LibWeb: Add the missing ProgressEvent IDL constructorIdan Horowitz
2021-10-01LibWeb: Add the missing SubmitEvent IDL constructorIdan Horowitz
This commit also removes the SubmitEvent.cpp file, as all of the method implementations were trivial and could be inlined into the header file.
2021-10-01LibWeb: Add the missing MessageEvent IDL constructorIdan Horowitz
2021-10-01LibWeb: Add the lastEventId IDL attribute to MessageEventIdan Horowitz
2021-10-01LibWeb: Change the IDL type of MessageEvent::data to anyIdan Horowitz
2021-10-01LibWeb: Add the missing CloseEvent IDL constructorIdan Horowitz
2021-10-01LibWeb: Use the LibWeb source directory as the IDL #import base pathIdan Horowitz
This allows us to include IDL files from other base LibWeb directories wihout using relative `../foo.idl` references.
2021-10-01LibWeb: Parse media queries! :^)Sam Atkins
While not complete by any means, we are now compatible with the [level 3 spec](https://www.w3.org/TR/css3-mediaqueries/#syntax) and some parts of [level 4.](https://www.w3.org/TR/mediaqueries-4#mq-syntax) Compatibility with level 4+ requires: - Implementing the range syntax: `(800px <= width <= 1200px)` - Parsing `<general-enclosed>`, which represents syntax that is not yet used but they may use in the future.
2021-10-01LibWeb: Add TokenStream::rewind_to_position()Sam Atkins
Parsing media queries sometimes requires significant back-tracking, so `reconsume_current_input_token()` was not good enough. `rewind_to_position()` lets you reconsume an erbitrary number of tokens to return to an earlier point in the stream, which you previously saved from `TokenStream::position()`.
2021-10-01LibWeb: Parse `@media` rules into CSSMediaRule objectsSam Atkins
This is not yet actually useful, since we only have a stub for parsing the query part, but now I have a nice way to test that things are working. :^)
2021-10-01LibWeb: Make consume_a_qualified_rule() understand block tokensSam Atkins
This now matches the spec, and fixes the situation where if it was given a TokenStream of StyleComponentValueRules, it would drop any Blocks on the floor instead of adding them to the result StyleRule.
2021-10-01LibWeb: Make MediaQueryList store MediaQueries instead of a StringSam Atkins
2021-10-01LibWeb: Sketch out media-query parsingSam Atkins
This does everything except actually parse the individual media queries.
2021-10-01LibWeb: Add CSSMediaRuleSam Atkins
This is the class corresponding to a `@media` rule. It contains a list of media queries and a list of child css rules.
2021-10-01LibWeb: Add MediaListSam Atkins
This is a list of MediaQuery objects. Not to be confused with `MediaQueryList`, which is concerned with firing events when a media query's match-state changes.