summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
AgeCommit message (Collapse)Author
2021-09-24LibWeb: Let <br> elements have styleAndreas Kling
At the very least, we need to respect `<br style="display: none">`
2021-09-24LibWeb: Make HTML::EventLoop::process() a no-op if there are no tasksAndreas Kling
2021-09-21LibWeb: Paint bitmaps with rounded_int_rect(), not enclosing_int_rect()Sam Atkins
This fixes the issue where an `<img>` set to its native size would sometimes still appear blurry, because it had a fractional position, causing `enclosing_int_rect()` to expand by 1px.
2021-09-21Libraries: Use AK::Variant default initialization where appropriateBen Wiederhake
2021-09-20LibWeb: Enable bilinear blending for bitmapsSam Atkins
This is slower, but looks a lot nicer. :^)
2021-09-20LibWeb: Implement <script src> execution for non-blocking scriptsAndreas Kling
2021-09-20LibWeb: Make <script src> loads partially async (by following the spec)Andreas Kling
Instead of firing up a network request and synchronously blocking for it to finish via a nested event loop, we now start an asynchronous request when encountering <script src>. Once the script load finishes (or fails), it gets executed at one of the synchronization points in the HTML parser. This solves some long-standing issues with random unexpected events getting dispatched in the middle of parsing.
2021-09-20LibWeb: Pop entire stack of open elements at the end of parsingAndreas Kling
2021-09-20LibWeb: Implement an ad-hoc version of EventLoop::spin_until(condition)Andreas Kling
This doesn't follow the exact spec steps but instead simply makes a nested Core::EventLoop and spins it while a periodic timer tests the goal condition.
2021-09-20LibWeb: Use Document::realm() in HTMLScriptElement::prepare_script()Andreas Kling
2021-09-19LibWeb: Implement basic support for MessageChannel and MessagePortAndreas Kling
This patch adds a basic initial implementation of these API's. Since LibWeb currently doesn't support workers, this implementation of messaging doesn't bother with serializing and deserializing messages.
2021-09-19LibWeb: Add HTML::Task::Source::PostedMessageAndreas Kling
This is the task source used by MessagePort.postMessage().
2021-09-19LibWeb: Remove duplicated event handler attribute code in WebSocketAndreas Kling
This functionality is now inherited from EventTarget, so we can simply remove the whole thing in WebSocket. :^)
2021-09-19LibWeb: Move `onfoo` attribute handling to EventTargetAndreas Kling
This logic was kept in the GlobalEventHandlers mixing for sharing between Document and HTMLElement, but there are other interfaces who need to support `onfoo` attribute event listeners as well.
2021-09-18LibWeb: Don't attempt to run unparsed scriptsAndreas Kling
2021-09-17LibWeb: Add HTML::Task::Source::IdleTaskAndreas Kling
This represents what the spec calls the "idle-task task source".
2021-09-16LibWeb: Add fast_is<HTMLTemplateElement>()Andreas Kling
This was showing up as hot in profiles, as the HTML parser calls it quite a lot.
2021-09-16LibWeb: Move Attribute into the DOM namespaceAndreas Kling
2021-09-14LibWeb: Improvements to error handling in HTML foreign content parsingAndreas Kling
Follow the spec more closely when encountering an invalid start or end tag during foreign content parsing.
2021-09-14LibJS+LibWeb: Move script parse time logging from JS::Script to LibWebAndreas Kling
Let's only log HTML::ClassicScript parse times for now. Otherwise things will get excessively noisy in test-js and the test262 runner.
2021-09-14LibJS+LibWeb: Let JS::Script::parse() return a list of errors (on error)Andreas Kling
These are really supposed to be a list of SyntaxError objects, but for now we simply return all the Parser::Error objects we got from Parser.
2021-09-14LibWeb: Implement HTML fragment serialisation and use it in innerHTMLLuke Wilde
The previous implementation was about a half implementation and was tied to Element::innerHTML. This separates it and puts it into HTMLDocumentParser, as this is in the parsing section of the spec. This provides a near finished HTML fragment serialisation algorithm, bar namespaces in attributes and the `is` value.
2021-09-13LibWeb: Add the Web::URL namespace and move URLEncoder to itIdan Horowitz
This namespace will be used for all interfaces defined in the URL specification, like URL and URLSearchParams. This has the unfortunate side-effect of requiring us to use the fully qualified AK::URL name whenever we want to refer to the AK class, so this commit also fixes all such references.
2021-09-12LibWeb: Log classic script start, finish, and durationAndreas Kling
When waiting for a page to load, it's nice to see which scripts run, and how long they take to finish.
2021-09-12LibJS: Change Interpreter::create_with_existing_{global_object => realm}Linus Groh
We need both a GlobalObject and Realm now, but can get the former from the latter (once initialized). This also fixes JS execution in LibWeb, as we failed to set the Realm of the newly created Interpreter in this function.
2021-09-12LibJS+LibWeb: Make JS::Script and Web::HTML::ClassicScript use RealmsLinus Groh
The spec wants Script Records to have a Realm, not a GlobalObject.
2021-09-12LibWeb+Browser: Add Debug menu action for toggling Same-Origin PolicyAndreas Kling
Sometimes it's useful to turn off the SOP for testing purposes. Let's make that easy by having a Debug menu item for it. :^)
2021-09-12LibWeb: Add the History object and stub pushState and replaceStateLuke Wilde
The spec allows us to optionally return from these for any reason. Our reason is that we don't have all the infrastructure in place yet to implement them.
2021-09-11LibWeb+LibJS: Remember source filenames when using HTML::ScriptAndreas Kling
It's a lot easier to debug JavaScript problems if you can see which file the errors are in. :^)
2021-09-10LibWeb: Make "top-level browsing context" concept more spec-compliantAndreas Kling
Any browsing context that doesn't have a parent browsing context is now considered a top-level browsing context. This matches the HTML spec. This means we no longer keep a pointer to the top-level context, since we can simply walk the parent chain until we find the topmost ancestor.
2021-09-09LibWeb: Make HTMLScriptElement create and run ClassicScriptsAndreas Kling
Before this patch, HTMLScriptElement would cache the full script source text in a String member, and parse that just-in-time via Document's run_javascript() helpers. We now follow the spec more closely and turn the incoming source text into a ClassicScript object ("the script's script" in the spec.)
2021-09-09LibWeb: Implement the "create" and "run" methods of ClassicScriptAndreas Kling
These correspond to "create a classic script" and "run a classic script" from the HTML specification. :^)
2021-09-09LibWeb: Annotate HTMLScriptElement::execute_script() with spec commentsAndreas Kling
2021-09-09LibWeb: Rename HTMLScriptElement::m_script_source => m_source_textAndreas Kling
2021-09-09LibWeb: Rename Document::complete_url() => parse_url()Andreas Kling
This better matches the spec nomenclature.
2021-09-09LibWeb: Start working on spec-aligned HTML scripting semanticsAndreas Kling
This patch adds HTML::Script and HTML::ClassicScript (subclass of the former.)
2021-09-09LibWeb: Rename DOM::Window::document() => associated_document()Andreas Kling
Match the spec nomenclature.
2021-09-09LibWeb: Rename BrowsingContext::document() => active_document()Andreas Kling
This better matches the spec nomenclature. Note that we don't yet *retrieve* the active document according to spec.
2021-09-09LibWeb: Spin the event loop in HTML parser until scripts can runAndreas Kling
Call HTML::EventLoop::spin_until() from the HTML parser when deciding whether we can run a script yet. Note that spin_until() actually doesn't do any work yet.
2021-09-09LibWeb: Use the task queue to fire "error" events on scriptsAndreas Kling
2021-09-09LibWeb: Use the task queue to fire "load" and "error" events on imagesAndreas Kling
2021-09-09LibWeb: Schedule HTML::EventLoop processing when there are queued tasksAndreas Kling
Since we can't simply give HTML::EventLoop control of the whole program, we have to integrate with Core::EventLoop. We do this by having a single-shot 0ms Core::Timer that we start when a task is added to the queue, and restart after processing the queue and there are still tasks in the queue.
2021-09-09LibWeb: Give HTML::EventLoop a pointer to the JS::VMAndreas Kling
This will be required for event loop processing.
2021-09-09LibWeb: Let HTML::EventLoop know its typeAndreas Kling
There are three types of event loop: window, worker and worklet. For now, we only have window event loops.
2021-09-09LibWeb: Stub out HTML::EventLoop::process() with spec FIXME'sAndreas Kling
2021-09-09LibWeb: Give HTML::EventLoop a "currently running task"Andreas Kling
2021-09-09LibWeb: Add HTML::Task::Source to model "generic task sources"Andreas Kling
2021-09-09LibWeb: Stub out HTML::EventLoop::spin_until() with spec FIXME'sAndreas Kling
2021-09-09LibWeb: Add a bare-bones HTML event loop with a task queueAndreas Kling
This patch attaches a HTML::EventLoop to the main thread JS::VM used for JavaScript bindings in the web engine. The goal here is to model the various task scheduling mechanisms of the HTML specification.
2021-09-08LibWeb: Tweak for/event whitespace stripping in <script> to match specAndreas Kling
This is not a functional change, it merely reorders operations so that we match spec language better.