summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-09-26LibWeb: Make WindowObject's prototype immutableLuke Wilde
While I was implementing IDL special operations, I noticed that for global platform objects (e.g. WindowObject), the IDL spec makes their prototype immutable. https://heycam.github.io/webidl/#platform-object-setprototypeof
2021-09-26LibWeb: Add support for HTMLOrSVGElement.datasetLuke Wilde
2021-09-26LibWeb: Convert HTMLCollection to use IDL special operationsLuke Wilde
2021-09-26LibWeb: Add support for IDL legacy platform objectsLuke Wilde
A legacy platform object is a non-global platform object that implements a special operation. A special operation is a getter, setter and/or deleter. This is particularly used for old collection types, such as HTMLCollection, NodeList, etc. This will be used to make these spec-compliant and remove their custom wrappers. Additionally, it will be used to implement collections that we don't have yet, such as DOMStringMap.
2021-09-26LibJS: Make Object::ordinary_set_with_own_descriptor non-staticLuke Wilde
This needs to be accessible for implementing IDL legacy platform objects.
2021-09-26LibWeb: Implement Document.importNodeLuke Wilde
2021-09-26LibJS: Allow statements to have multiple labelsAndreas Kling
This is a curious thing that occurs more often than you'd think in minified JavaScript: a: b: c: for (...) { ... break b; ... }
2021-09-26LibJS: Defer execution of switch default clause until after case clausesLinus Groh
When we encounter a default clause in a switch statement, we should not execute it immediately, instead we need to wait until all case clauses have been executed as a matching case clause can break from the switch/case. The code is nowhere close to the spec, so instead of fixing it properly I just made it slightly worse, but correct. Needs a complete refactor at some point.
2021-09-26LibWeb: Implement window.queueMicrotask(callback)Andreas Kling
This API allows authors to schedule a serialized JS callback that will get invoked at the next spec-allowed opportunity.
2021-09-26LibWeb: Add the PageTransitionEvent interface and fire "pageshow" eventsAndreas Kling
We now fire "pageshow" events at the appropriate time during document loading (done by the parser.) Note that there are no corresponding "pagehide" events yet.
2021-09-26LibWeb: Add a "page showing" flag to documentsAndreas Kling
This will be used to determine whether "pageshow" and "pagehide" events are appropriate. We won't actually make use of it until we implement more of history traversal and document unloading.
2021-09-26LibWeb: Implement "update the current document readiness" from specAndreas Kling
The only difference from what we were already doing is that setting the same ready state twice no longer fires a "readystatechange" event. I don't think that could happen in practice though.
2021-09-26LibWeb: Store HTML document ready state as an enumAndreas Kling
2021-09-26LibWeb: Make unhandled JS exception stand out more in debug logAndreas Kling
Let's log "unhandled exception" messages in red text so that they stand out better among lots of other debug logging.
2021-09-26LibELF: Indicate value of unimplemented dtagRodrigo Tobar
For flags that are not mapped to a string this message prints DT_??, which isn't really useful.
2021-09-26LibC+LibELF: Add definitions for extra dtagsRodrigo Tobar
These are found in some libraries, and LibELF doesn't know how to handle them, not even their name. Adding these definitions should at least help readelf display information correctly, but more work is needed to actually implement them.
2021-09-26LibELF+readelf: Remove duplicated dtag->string mapRodrigo Tobar
A copy of the same mapping was found both in LibELF and in the readelf utility, which uses LibELF; keeping them both is redundant and removing the duplicate saves (a bit of) space.
2021-09-26ThemeEditor: Show currently opened theme path in the window titleKarol Kosek
You can open files since #9979, so let's show the path there to distinguish open theme files more easily!
2021-09-26LibWeb: Mark event listeners generated by event handler attributesAndreas Kling
We have to mark the EventListener objects so that we can tell them apart from listeners added via the addEventListener() API. This makes element.onfoo getters actually return the handler function.
2021-09-26LibWeb: Implement more of "completely finish loading the document"Andreas Kling
2021-09-26LibWeb: Remove nonsensical assignment in script-became-ready callbackAndreas Kling
We don't need to set m_script_ready in the callback that gets invoked precisely because m_script_ready has been set. :^)
2021-09-26LibWeb: Make parser <script> elements delay the document load eventAndreas Kling
2021-09-26LibWeb: Make <link> style sheets delay the document load eventAndreas Kling
2021-09-26LibWeb: Allow HTML parser to delay delivery of the document "load" eventAndreas Kling
We will now spin in "the end" until there are no more "things delaying the load event". Of course, nothing actually uses this yet, and there are a lot of things that need to.
2021-09-26LibWeb: Remove some unused includes and a member in HTMLScriptElementAndreas Kling
2021-09-26LibWeb: Implement more of HTMLParser::the_end() and bring closer to specAndreas Kling
2021-09-26LibWeb: Make update_style() a no-op if there's no browsing contextAndreas Kling
Style is needed to lay out and paint a document, but we can't do either those when the document isn't attached to a browsing context.
2021-09-26LibWeb: Split out "The end" from the HTML parsing spec to a functionAndreas Kling
Also add a spec link and some comments.
2021-09-25LibWeb: Rename HTMLDocumentParser => HTMLParserAndreas Kling
2021-09-25LibWeb: Provide a default DOM::EventTarget::dispatch_event()Andreas Kling
All EventTarget subclasses except Window do the same exact thing in their overrides, so let's just share an implementation in the base.
2021-09-25PixelPaint: Close image tabs on middle clickKarol Kosek
2021-09-25PixelPaint: Close New Image dialog after pressing return keyKarol Kosek
13e526de43847ac86d74e3cb0be2d6b930f1d46f added the feature to new Layer dialog. This patch adds it to Image dialog to stay consistent across the app. :^)
2021-09-25LibWeb: Use Core::EventLoop::spin_until() for the ad-hoc loop spinningAndreas Kling
The ideal solution here is to implement a more spec-compliant event loop, but while we get all the pieces in place for that, this at least makes the HTML event loop a bit more responsive since it never has to wait for a 16ms timer to fire.
2021-09-25LibCore: Add Core::EventLoop::spin_until(Function<bool()>)Andreas Kling
This function spins the event loop until a goal condition is met.
2021-09-25LibWeb: Move window.scroll{X,Y} from wrapper into DOM::WindowAndreas Kling
The less we do in WindowObject, the easier it will be to eventually auto-generate the entire thing.
2021-09-25LibJS: Move has_constructor() from NativeFunction to FunctionObjectLinus Groh
At a later point this will indicate whether some FunctionObject "has a [[Construct]] internal method" (separate from the current FunctionObject call() / construct()), to help with a more spec-compliant implementation of [[Call]] and [[Construct]]. This means that it is no longer relevant to just NativeFunction.
2021-09-25LibJS: Add const Value::as_function()Linus Groh
2021-09-25LibJS: Remove unused FunctionObject::environment()Linus Groh
ECMAScriptFunctionObject::environment() can just be non-virtual.
2021-09-25LibJS: Move [[BoundThis]] and [[BoundArguments]] to BoundFunctionLinus Groh
2021-09-25LibJS: Rename BoundFunction::m_target_function to match spec nameLinus Groh
2021-09-25LibJS: Move has_simple_parameter_list to ECMAScriptFunctionObjectLinus Groh
2021-09-25LibJS: Move [[Fields]] to ECMAScriptFunctionObjectLinus Groh
2021-09-25LibJS: Move [[HomeObject]] to ECMAScriptFunctionObjectLinus Groh
2021-09-25LibJS: Move [[ConstructorKind]] to ECMAScriptFunctionObjectLinus Groh
2021-09-25LibJS: Move [[ThisMode]] to ECMAScriptFunctionObjectLinus Groh
2021-09-25LibJS: Add ECMAScriptFunctionObject forward declarationLinus Groh
2021-09-25LibJS: Rename ECMAScriptFunctionObject members to match spec namesLinus Groh
Also add the internal slot names as comments, and separate them into groups of spec and non-spec members. This will make it easier to compare the implementation code with the spec, as well as identify internal slots currently missing or only present on FunctionObject.
2021-09-25LibJS: Rename OrdinaryFunctionObject to ECMAScriptFunctionObjectLinus Groh
The old name is the result of the perhaps somewhat confusingly named abstract operation OrdinaryFunctionCreate(), which creates an "ordinary object" (https://tc39.es/ecma262/#ordinary-object) in contrast to an "exotic object" (https://tc39.es/ecma262/#exotic-object). However, the term "Ordinary Function" is not used anywhere in the spec, instead the created object is referred to as an "ECMAScript Function Object" (https://tc39.es/ecma262/#sec-ecmascript-function-objects), so let's call it that. The "ordinary" vs. "exotic" distinction is important because there are also "Built-in Function Objects", which can be either implemented as ordinary ECMAScript function objects, or as exotic objects (our NativeFunction). More work needs to be done to move a lot of infrastructure to ECMAScriptFunctionObject in order to make FunctionObject nothing more than an interface for objects that implement [[Call]] and optionally [[Construct]].
2021-09-24LibWeb: Skip decoding favicon.ico if downloaded data is emptyMandar Kulkarni
Some sites don't have favicon.ico, so we may get 404 response. In such cases, ResourceLoader still calls success_callback. For favicon loading, we are not checking response headers or payload size. This will ultimately fail in Gfx::ImageDecoder::try_create(). So avoid unnecessary work by returning early, if data is empty.
2021-09-24LibGfx: Forward declare Gfx::FontMetrics as a structAndreas Kling