summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
AgeCommit message (Collapse)Author
2021-01-01LibWeb: Use is<T> in XMLHttpRequestPrototypeAndreas Kling
2021-01-01LibWeb: Remove hand-rolled is_foo() helpers in Layout::Node classesAndreas Kling
2021-01-01LibWeb: Remove more hand-rolled type information :^)Andreas Kling
Hoo boy, we've really accumulated a lot of this stuff.
2021-01-01LibJS+LibWeb: Stop generating is_foo_wrapper() for JS DOM wrappersAndreas Kling
2021-01-01LibJS: Use RTTI for inheritance checksAndreas Kling
This replaces the hand-rolled string-based inheritance check tech.
2021-01-01LibWeb: Demangle the names returned by Layout::Node::class_name()Andreas Kling
Note that these are only used in debugging/test output so it's not performance sensitive.
2021-01-01LibWeb: Simplify Layout::Node::class_name() with RTTIAndreas Kling
2021-01-01AK+LibGUI+LibWeb: Remove AK::TypeTraits in favor of RTTI-based helpersAndreas Kling
Now that we have RTTI in userspace, we can do away with all this manual hackery and use dynamic_cast. We keep the is<T> and downcast<T> helpers since they still provide good readability improvements. Note that unlike dynamic_cast<T>, downcast<T> does not fail in a recoverable way, but will assert if the object being casted is not a T.
2020-12-31LibWeb: Clear circular download reference when download finishedTom
2020-12-31Everywhere: Re-format with clang-format-11Linus Groh
Compared to version 10 this fixes a bunch of formatting issues, mostly around structs/classes with attributes like [[gnu::packed]], and incorrect insertion of spaces in parameter types ("T &"/"T &&"). I also removed a bunch of // clang-format off/on and FIXME comments that are no longer relevant - on the other hand it tried to destroy a couple of neatly formatted comments, so I had to add some as well.
2020-12-31LibWeb: Don't hold on to the Download instance after it's finishedAnotherTest
Fixes* 4668
2020-12-30LibGFX: Move default_xxx_font() methods from Font to FontDatabaseStephan Unverwerth
When we have an abstract font class it makes no sense to keep these methods in the Font class.
2020-12-30LibWeb: Re-enable favicons after forgotten if-0AnotherTest
2020-12-30ProtocolServer: Stream the downloaded data if possibleAnotherTest
This patchset makes ProtocolServer stream the downloads to its client (LibProtocol), and as such changes the download API; a possible download lifecycle could be as such: notation = client->server:'>', server->client:'<', pipe activity:'*' ``` > StartDownload(GET, url, headers, {}) < Response(0, fd 8) * {data, 1024b} < HeadersBecameAvailable(0, response_headers, 200) < DownloadProgress(0, 4K, 1024) * {data, 1024b} * {data, 1024b} < DownloadProgress(0, 4K, 2048) * {data, 1024b} < DownloadProgress(0, 4K, 1024) < DownloadFinished(0, true, 4K) ``` Since managing the received file descriptor is a pain, LibProtocol implements `Download::stream_into(OutputStream)`, which can be used to stream the download into any given output stream (be it a file, or memory, or writing stuff with a delay, etc.). Also, as some of the users of this API require all the downloaded data upfront, LibProtocol also implements `set_should_buffer_all_input()`, which causes the download instance to buffer all the data until the download is complete, and to call the `on_buffered_download_finish` hook.
2020-12-29LibWeb: Expose three more attribute methods on ElementLuke
Exposes removeAttribute, hasAttribute and hasAttributes.
2020-12-29LibWeb: Fix character references losing characters in certain situationsLuke
This fixes 4 issues: - RECONSUME_IN_RETURN_STATE was functionally equivalent to SWITCH_TO_RETURN_STATE, which caused us to lose characters. For example, &test= would lose the = - & characters by themselves would be lost. For example, 1 & 2 would become 1 2. This is because we forgot to flush characters in the the ANYTHING_ELSE path in CharacterReference - Named character references didn't work at all in attributes. This is because there was a path that was checking the entity code points instead of the entity itself. Plus, the path that was checking the entity itself wasn't quite spec compliant. - If we fail to match a named character reference, the first character is lost. For example &test would become &est. However, this relies on a little hack since I can't wrap my head around on how to change the code to do as the spec says. The hack is to reconsume in AmbigiousAmpersand instead of just switching to it. Fixes #3957
2020-12-29LibWeb: Fill OOPWV with the palette base color until we have pixelsAndreas Kling
We were painting unfinished pixels while waiting for the WebContent process to render the page. This caused OOPWV to flicker black sometimes, which looked pretty bad. This way we still flicker, but at least we flicker with the correct palette color. :^)
2020-12-28LibGUI: Show tooltip after a small delayAndreas Kling
It always felt a bit jarring that tooltips would pop in right away when you hover over a toolbar button. This patch adds a 700ms delay before they appear, and a 50ms delay before they disappear. Once a tooltip is up, moving the cursor between two widgets that both have tooltips will leave the tooltip on screen without delays.
2020-12-27Base+LibJS+LibWeb: Make prettier cleanLinus Groh
Also use "// prettier-ignore" comments where necessary rather than excluding whole files (via .prettierignore).
2020-12-26LibC: Fix some incorrect printf usagesSahan Fernando
2020-12-21Everywhere: Switch from (void) to [[maybe_unused]] (#4473)Lenny Maiorani
Problem: - `(void)` simply casts the expression to void. This is understood to indicate that it is ignored, but this is really a compiler trick to get the compiler to not generate a warning. Solution: - Use the `[[maybe_unused]]` attribute to indicate the value is unused. Note: - Functions taking a `(void)` argument list have also been changed to `()` because this is not needed and shows up in the same grep command.
2020-12-20LibWeb: Don't leave "border" CSS property around after expansionAndreas Kling
The "border" property is a shorthand that expands into multiple longhand properties. We shouldn't leave it set in a StyleProperties after expanding it.
2020-12-19LibWeb: Don't use ByteBuffer::wrap() when loading about: URLsAndreas Kling
Let's just copy an empty string here to make ourselves a ByteBuffer.
2020-12-19LibProtocol: Remove use of ByteBuffer::wrap() in protocol APIAndreas Kling
2020-12-18LibWeb: Only preserve full whitspace for white-space: pre{,-wrap}Andreas Kling
2020-12-18LibWeb: Silence BFC spam about not knowing how to place boxesAndreas Kling
This gets way too noisy on some pages, and isn't even interesting.
2020-12-17LibWeb: Whitespace that causes a line to wrap should be hiddenAndreas Kling
We were only pruning trailing whitespace on lines. This patch makes it so we also don't add whitespace as the leading line box fragment on new lines. This logic is pretty crufty and I think we can do better, but for now I've just made it handle this extra case so we can stop having lines that start with a space character. :^)
2020-12-17LibWeb: Escape text nodes in innerHTML getterLinus Groh
2020-12-17LibWeb: Include element attributes in innerHTML getterLinus Groh
2020-12-17LibWeb: Notify the PageClient when the children of <title> changeAndreas Kling
2020-12-17LibWeb: Fix shrink-to-fit layout for position:absoluteAndreas Kling
We were following the spec incorrectly. The comment was right, but the code was wrong.
2020-12-17LibWeb: Use the correct containing block for position:absolute widthAndreas Kling
2020-12-17LibWeb: Always break around inline-blocks in AllPossibleLineBreaks modeAndreas Kling
2020-12-17LibWeb: Make sure the ICB is at least as tall as the viewportAndreas Kling
This is a hack until we implement a proper overflow mechanism. For now, this allows us to right-click below the lowest content on the page.
2020-12-16LibWeb: The fallback 'color' value should be black, not transparentAndreas Kling
Fixes #4425.
2020-12-15LibWeb: Remove use of specified_style() in Layout::ImageBoxAndreas Kling
2020-12-15LibWeb: Actually apply recomputed style to element's layout nodeAndreas Kling
Otherwise fetching stuff via LayoutNode::style() will have stale values since we were only updating the specified_style() here. LayoutNode::specified_style() should eventually go away since there's no need to carry those uncooked values around with the layout tree.
2020-12-15LibWeb: Update text-decoration hack to use text-decoration-lineAndreas Kling
We have a hack that propagates text-decoration-line through inheritance even though it's not an inherited property. Once we implement the CSS cascade properly we can stop doing this.
2020-12-15LibWeb: Generate the CSS::ValueID enum and its helper functionsAndreas Kling
2020-12-15LibWeb: Oops, not all length boxes should default to 'auto' valuesAndreas Kling
Only the offset box (left/top/right/bottom) box defaults to 'auto'. Both the padding and margin boxes default to '0' for all values.
2020-12-15LibWeb: Add equals() for LengthStyleValue and ColorStyleValueAndreas Kling
The default equals() does to_string() on both sides which is pretty silly when they are of the same type.
2020-12-15LibWeb: Add hack to disable StyleInvalidator while parsing documentAndreas Kling
Running a StyleInvalidator for every attribute set in a new document was making it impossible to load larger sites. :^)
2020-12-15LibWeb: Dimension inline-block and replaced boxes during splittingAndreas Kling
Don't wait until fragment layout to compute width/height of boxes on the line, just do it while we're splitting into lines.
2020-12-15LibWeb: Remove unused Element::set_attributes()Andreas Kling
2020-12-15LibWeb: Use IdentifierStyleValue for CSS 'list-style-type'Andreas Kling
2020-12-15LibWeb: Put final foreground/background colors in LayoutStyleAndreas Kling
This way we don't have to look them up in the CSS::StyleProperties every time we want to paint with them.
2020-12-15LibWeb: Use IdentifierStyleValue for CSS 'text-transform'Andreas Kling
2020-12-15LibWeb: Use IdentifierStyleValue for CSS 'text-decoration-line'Andreas Kling
Also 'text-decoration' is actually a shorthand, so treat it that way.
2020-12-15LibWeb: Make CSS "background: none" work againAndreas Kling
This broke since "none" is now always going to be an identifier value.
2020-12-14LibWeb: Add a simple StyleInvalidator classLinus Groh
This patch adds a simple, naive & inefficient class for document-wide style invalidation, e.g. after element attribute updates. During construction it collects a HashMap of a document's elements and their matching rules, during destruction it does the same and then compares the results; dirtying all elements that have a different number or order of matching rules afterwards. Much room for improvement, but it solves the problem of stale element styling after attribute updates for now :^) Fixes #4404.