summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
AgeCommit message (Collapse)Author
2021-10-31LibWeb: Convert all generated bindings to ThrowCompletionOrTimothy Flynn
This also required converting URLSearchParams::for_each and the callback function it invokes to ThrowCompletionOr. With this, the ReturnType enum used by WrapperGenerator is removed as all callers would be using ReturnType::Completion.
2021-10-31LibWeb: Convert the Navigator object to ThrowCompletionOrTimothy Flynn
2021-10-31LibWeb: Convert the CSS namespace object to ThrowCompletionOrTimothy Flynn
2021-10-31LibWeb: Convert the Window object to ThrowCompletionOrTimothy Flynn
2021-10-31LibWeb: Convert the Location object to ThrowCompletionOrTimothy Flynn
2021-10-29LibWeb: Render any specified list-style-image for list itemsTimothy Flynn
2021-10-29LibWeb: Support parsing some data: URLs in CSSTimothy Flynn
For now, data URLs are explicitly limited to expected MIME types. For example, image-related styles accept image MIME types.
2021-10-29LibWeb: Remove extraneous semi-colonTimothy Flynn
2021-10-28LibWeb: Add Element.webkitMatchesSelectorLuke Wilde
This is an alias of Element.matches for web compatibility. https://dom.spec.whatwg.org/#dom-element-webkitmatchesselector Used by particularly old versions of Sizzle, such as 1.10.2: https://github.com/jquery/jquery/blob/16b079b164d62bd807c612806842a13bf9b04d17/jquery.js#L1644 This particular version is used by DuckDuckGo.
2021-10-28LibWeb: Don't try to layout list-item markers in BFCAndreas Kling
Marker boxes are laid out by the corresponding ListItemBox. BFC should just leave them alone. This fixes a jiggling issue on welcome.html :^)
2021-10-28LibWeb: Add Layout::Box::border_box_as_relative_rect()Andreas Kling
This helper returns the border box (content+padding+border) of a given box. Margin not included.
2021-10-28LibWeb: Small fix to height computation for block-with-inline-childrenAndreas Kling
We now compute the used height of height:auto by measuring from the top content edge (y=0) to the bottom of the bottommost line box within the block container. This fixes an issue where we'd fail to account for the topmost line box being taller than any of its fragments (which can happen if the line-height is greater than the height of all fragments on the line.)
2021-10-28LibWeb: Use border edges when computing overflow for the ICBAndreas Kling
2021-10-28LibWeb: Remove unused CSS::Length::relative_length_to_px(Layout::Node)Andreas Kling
2021-10-28LibWeb: Don't force line box fragments height to be at least line-heightAndreas Kling
I don't remember why we did things this way, but it's clearly not right to stretch fragments vertically. Instead, we should just align their bottom to the appropriate line (as we already do.)
2021-10-28LibWeb: Make non-absolute values for line-height fall back to font-sizeAndreas Kling
When using bitmap fonts, the computed *font* that we're using may be smaller than the font-size property asked for. We can still honor the font-size value in layout calculations.
2021-10-28LibWeb: Clip descendants of boxes with overflow:hiddenAndreas Kling
This is a very limited implementation of overflow:hidden, but since it's easy to cover this common scenario, let's do it.
2021-10-28LibWeb: Treat width:auto on tables as fit-contentAndreas Kling
Tables, unlike other block-level elements, should not stretch to fit their containing block by default.
2021-10-28LibWeb: Allow whitespace when parsing "!important" in CSSSam Atkins
This accounts for cases like: ```css .foo { color: blue ! important ; } ``` That's rare now that minifying is so popular, but does appear on some websites. I've added spec comments to `consume_a_declaration()` while I was at it.
2021-10-28LibWeb: Allow whitespace inside CSS attribute selectorsSam Atkins
Noticed this while checking some MediaWiki-based sites. It's not obvious, but the spec does allow this, by not mentioning it in this list of places whitespace is forbidden: https://www.w3.org/TR/selectors-4/#white-space
2021-10-28LibWeb: Remove two lowercase string creations from Element::has_classTimothy Flynn
2021-10-28LibWeb: Do not create lowercase strings in NamedNodeMap::get_attributeTimothy Flynn
Rather than following the spec exactly and creating lowercase strings, we can simply do a case-insensitive string comparison. The caveat is that creating attributes must follow the spec by creating the attribute name with a lowercase string.
2021-10-28LibWeb: Remove duplicated auto height computationBen Wiederhake
Note that these two implementation differ, but the one in FormattingContext.cpp seems to be more complete. It is also more recent.
2021-10-28LibWeb: Remove StyleProperties::set_property(PropertyID, StringView)Andreas Kling
This API has no more clients (and the last client that I just removed wasn't even using it right) so let's get rid of it.
2021-10-28LibWeb: Properly handle the <td align> attributeAndreas Kling
When valid, this attribute needs to result in an IdentifierStyleValue. Before this change we were turning it into a StringStyleValue, which then defaulted to left alignment for all values. For "center" and "middle", we turn it into -libweb-center. All other values are passed verbatim to the CSS parser.
2021-10-27Everywhere: Rename left/right-click to primary/secondaryFiliph Sandström
This resolves #10641.
2021-10-27LibWeb: Don't create anonymous table boxes around whitespaceAndreas Kling
This was confusing table layout by adding empty whitspace table boxes that wound up stealing a bunch of horizontal space.
2021-10-27LibWeb: Remove Layout::Box::width_of_logical_containing_block()Andreas Kling
This was a hack to percentages within tables relative to the nearest table-row ancestor instead of the nearest table container. That didn't actually make sense, so this patch simply removes the hack in favor of containing_block()->width().
2021-10-27LibWeb: Add fast_is<T>() for HTML::HTMLHtmlElementAndreas Kling
Another one spotted in a scroll-up-and-down profile.
2021-10-27LibWeb: Add fast_is<T>() for Layout::LabelAndreas Kling
Spotted this in a profile while wheel scrolling up & down.
2021-10-26LibWeb: Implement URLSearchParams.getAllLuke Wilde
2021-10-26LibWeb: Fix inline blocks swallowing trailing whitespaceFelix Rauch
In #10434 an issue with leading whitespace in new lines after a <br> element was fixed by checking whether the last fragment of LineBox is empty. However, this introduced a regression by which whitespace following inline elements was swallowed, so `<b>Test</b> 123` would appear like `Test123`. By asking specifically if we are handling a forced linebreak instead of implicity asking for a property that may be shared by other Node types, we can maintain the correct behavior in regards to leading whitespace on new lines, as well as trailing whitespace of inline elements.
2021-10-24LibWeb: Remove now-unnecessary String copy when parsing CSS colorsSam Atkins
Color::from_string() now does a case-insensitive comparison of color names, so we don't need this copy. :^)
2021-10-24LibJS: Rename PropertyName to PropertyKeyAndreas Kling
Let's use the same name as the spec. :^)
2021-10-23AK+Everywhere: Make Base64 decoding fallibleBen Wiederhake
2021-10-23LibWeb: Syntax-highlight CSS within HTML :^)Sam Atkins
2021-10-23LibWeb: Implement first draft of CSS syntax highlighting :^)Sam Atkins
This works at the Token level, which is quick and easy but has drawbacks: We don't know when something is a property name or a value, or if something is part of a selector. But, this works for now.
2021-10-23LibWeb: Record position information in CSS TokensSam Atkins
This is a requirement to be able to use the Tokens for syntax highlighting.
2021-10-23LibWeb: Add CSS Tokenizer::consume_as_much_whitespace_as_possible()Sam Atkins
This is a step in the spec in 3 places, and we had it implemented differently in each one. This unifies them and makes it clearer what we're doing.
2021-10-23LibWeb: Add spec links to CSS TokenizerSam Atkins
Also renamed `starts_with_a_number()` -> `would_start_a_number()` to better match spec terminology.
2021-10-23LibWeb: Implement hashless hex color quirkSam Atkins
https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk The CSS parser should now be completely quirky! :^) The code is a bit awkward, especially the prepending-0s step, but at least it won't be running too often.
2021-10-23LibWeb: Explicitly cast parameters to Color::from_hsl/hsla()Sam Atkins
CLion was giving me the angry red underlines about this.
2021-10-23LibGfx+LibWeb: Move "transparent" keyword into Color::from_string()Sam Atkins
It seemed odd to have this one color handled separately, when `Color::from_string()` implements all other CSS colors.
2021-10-23LibWeb: Fix off-by-one in initial containing block overflow calculationAndreas Kling
We're using the outermost right and bottom child edges to determine the width and height of the ICB. However, since these edges are *within* the respective child's rectangle, we have to add 1 when turning them into width and height values. This fixes an issue where scrolling a document would shrink its viewport rect by 1 pixel (on both axes) on every scroll step.
2021-10-23LibWeb: Make CSS ParsingContext's Document* be constSam Atkins
The only reason it wasn't const before (and why we had a const_cast hack) was to support ImageStyleValue's constructor taking it, which no longer applies. `hack_count--;` :^)
2021-10-23LibWeb: Move image resource request out of ImageStyleValue constructorSam Atkins
This always felt awkward to me, and required a few other hacks to make it work. Now, the request is only started when `load_bitmap()` is called, which we do inside `NodeWithStyle::apply_style()`.
2021-10-22LibJS: Convert Array AOs to ThrowCompletionOrIdan Horowitz
2021-10-21LibWeb: Use is_single_line() and add spec comments to FFC step 8Andreas Kling
2021-10-21LibWeb: Include flex-direction in layout tree dumpsAndreas Kling
2021-10-21LibJS: Convert NativeFunction::{call,construct}() to ThrowCompletionOrLinus Groh
Both at the same time because many of them call construct() in call() and I'm not keen on adding a bunch of temporary plumbing to turn exceptions into throw completions. Also changes the return value of construct() to Object* instead of Value as it always needs to return an object; allowing an arbitrary Value is a massive foot gun.