summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2022-01-20LibWeb: Remove reference_for_percent parameter from Length::resolved()Sam Atkins
Despite looking like it was still needed, it was only used for passing to other calls to Length::resolved() recursively. This makes the various `foo.resolved().resolved()` calls a lot less awkward. (Though, still quite awkward.) I think we'd need to separate calculated lengths out to properly tidy these calls up, but one yak at a time. :^)
2022-01-20LibWeb: Remove Length::Type::Percentage :^)Sam Atkins
All `<percentage>`s in the CSS grammar are now represented by the `Percentage` class, and `<length-percentage>` by `LengthPercentage`.
2022-01-20LibWeb: Convert opacity property from Length to PercentageSam Atkins
2022-01-20LibWeb: Convert width/height and min-/max- versions to LengthPercentageSam Atkins
A lot of this is quite ugly, but it should only be so until I remove Length::Type::Percentage entirely. (Which should happen later in this PR, otherwise, yell at me!) For now, a lot of things have to be resolved twice, first from a LengthPercentage to a Length, and then from a Length to a pixel one.
2022-01-20LibWeb: Convert flex-basis to LengthPercentageSam Atkins
The flexbox logic confuses me so regressions are possible, though our test page looks the same as before so it should be fine. Renamed FlexBasis::Length -> LengthPercentage too, for clarity.
2022-01-20LibWeb: Convert background-position to LengthPercentageSam Atkins
Not much needed changing this time, hurrah! :^)
2022-01-20LibWeb: Handle percentage font sizesSam Atkins
2022-01-20LibWeb: Remove Node::m_font_sizeSam Atkins
This was only ever used in order to set the m_font_size for another Node, so it can just go. :^)
2022-01-20LibWeb: Handle percentage and number line-heightsSam Atkins
This does undo the changes in 88c32836d858564a8664f0fc85f8fd36021945bf, which accounted for our bitmap fonts being a different size than the `font-size` property requests. I think this would be better handled inside Length::to_px(), which would then apply to all font-size-relative lengths (eg, em and rem) instead of only for the line-height property.
2022-01-20LibWeb: Add missing "auto" identifiers for min-width/heightSam Atkins
Both of these have "auto" as their initial value, so the only reason they work currently is that "auto" is implicitly a Length.
2022-01-20LibWeb: Convert background-size from Length to LengthPercentageSam Atkins
Checking these for `auto` is awkward, but separating that will come later. :^)
2022-01-20LibWeb: Convert border-radii from Length to LengthPercentage :^)Sam Atkins
The visit_lengths() code is a bit awkward but we'll clean that up later.
2022-01-20LibWeb: Remove BorderRadiusStyleValue::to_length() hackSam Atkins
Layout::Node still treats border radii as having a single value instead of horizontal and vertical, but one less hack is nice, and helps with conversion to LengthPercentage. :^)
2022-01-20LibWeb: Convert `stroke-width` to LengthPercentageSam Atkins
This is a guinea pig. So far so good?
2022-01-20LibWeb: Remove unused StyleProperties::background_repeat()Sam Atkins
2022-01-20LibWeb: Add PercentageStyleValue, and parse itSam Atkins
This is in a slightly weird state, where Percentages are sometimes Lengths and sometimes not, which I will be cleaning up in subsequent commits, in an attempt not to change all of LibWeb in one go. :^)
2022-01-20LibWeb: Alphabetize StyleValue classesSam Atkins
2022-01-20LibWeb: Add CSS::Percentage, PercentageOr and LengthPercentage typesSam Atkins
Length and Percentage are different types, and sometimes only one or the other is allowed in a given CSS property. This is a first step towards separating them.
2022-01-19LibJS: Add in-tree test for Json parsing of negative zerosForLoveOfCats
This mirrors the cases in `built-ins/JSON/parse/text-negative-zero` in test262
2022-01-19LibWeb: Remove `unknown` value in `@supports` query logicSam Atkins
This is in line with this recent change to Conditional-3: > Removed the “unknown” value in CSS feature queries’ boolean logic, > defining unrecognized syntaxes as “false” instead. > https://github.com/w3c/csswg-drafts/issues/6175
2022-01-19LibJS: Remove now unnecessary FIXME comments about LocalTime's [[InDST]]Timothy Flynn
2022-01-19LibJS+LibUnicode: Return the appropriate time zone name depending on DSTTimothy Flynn
2022-01-19LibJS+LibTimeZone+LibUnicode: Indicate whether a time zone is in DSTTimothy Flynn
Return whether the time zone is in DST during the provided time from TimeZone::get_time_zone_offset,
2022-01-19LibJS+LibTimeZone: Begin handling DST when computing time zone offsetsTimothy Flynn
This also updates some expectations in a Temporal time zone offset test that is using a time stamp which is in DST for a few time zones.
2022-01-19LibTimeZone: Begin parsing and generating DaylightSavings rulesTimothy Flynn
2022-01-19LibJS: Implement Function.prototype.toString() according to the specLinus Groh
That's an old yak :^) No, past me, AST nodes do not need to learn to stringify themselves. This is now massively simplified by using the [[SourceText]] internal slot. Also updates a bunch of tests that are incorrect due to the old implementation not being spec compliant, and add plenty more.
2022-01-19LibJS: Pass source text to ECMAScriptFunctionObject::create()Linus Groh
2022-01-19LibJS: Let class_definition_evaluation() return a ESFnObject*, not ValueLinus Groh
No need to hide this very specific Object type in a generic Value.
2022-01-19LibJS: Capture source text of FunctionNode and ClassExpressionLinus Groh
2022-01-19LibJS: Set Token's m_offset to the value's start indexLinus Groh
This makes much more sense than the current way of setting it to the Lexer's m_position after consuming the full value.
2022-01-19LibJS: Add missing definition of AsyncFunction.prototype.constructorLinus Groh
We also forgot to allocate an AsyncFunctionConstructor and assign it to m_async_function_constructor during GlobalObject initialization, whoops!
2022-01-19LibJS: Remove duplicate definition of AsyncGeneratorFunction.prototypeLinus Groh
2022-01-19LibSoftGPU: Reduce number of samplers to 2Stephan Unverwerth
OpenGL mandates at least 2 texture units when multitexturing is supported. This keeps our vertices lean and gives a nice speed improvement in glquake. Until we support shaders this should be enough.
2022-01-19LibGL+LibSoftGPU: Support generation of multiple texture coordinatesStephan Unverwerth
2022-01-19LibGL: Also track active texture unit indexStephan Unverwerth
In addition to tracking a pointer to the active texture unit we also track its index in the array.
2022-01-19LibGL: Track multiple current texture coordinates in GLContextStephan Unverwerth
Previously we only had a single current texture coordinate, set by the glTexCoord family of functions. Since we now can have multiple texture coordinates we track a vector of current texture coordinates and set the requested one in glMultiTexCoord(). glTexCoord() Always sets the first texture coordinate.
2022-01-19LibGL: Handle multiple texture coordinates in client stateStephan Unverwerth
This now tracks one vertex attribute pointer per texture unit and calls glMultiTexCoord() to set the texture coordinates for the correct texture unit.
2022-01-19LibGL+LibSoftGPU: Add multiple texture coordinates to vertex structStephan Unverwerth
We now have one set of texture coordinates per texture unit. Texture coordinate generation and texture coordinate assignment is currently only stubbed. This will be rectified in another commit.
2022-01-19LibGL: Add stubs for multitexturing and announce GL_ARB_multitextureStephan Unverwerth
This makes glquake recognize multitexture support and choose the multitexture rendering path.
2022-01-19LibGL: Implement glActiveTextureARB()Stephan Unverwerth
This is the equivalent of glActiveTexture() before it got promoted to the OpenGL core specification. It is needed by glquake to enable the multitexturing render path.
2022-01-19LibGL: Generate GL extension string dynamically during constructionStephan Unverwerth
LibGL will now generate the GL extension string in the constructor and refer to it later on when the string is queried via glGetString(). Currently we only check whether the device supports non-power-of-two textures and add GL_ARB_texture_non_power_of_two to the supported extensions in that case.
2022-01-19LibSoftGPU: Announce NPOT texture support via DeviceInfo structStephan Unverwerth
2022-01-19HackStudio: Change ProjectBuilder dependency declaration logicItamar
Previously when generating the HackStudio CMake build file, we used all dependency libraries that are specified in target_link_libraries commands as the dependencies of a library. The recent addition of LibCryptSHA2 broke things because that library is not declared with serenity_lib like most other libraries (it uses special linking properties). This means that we don't declare it in the CMake file we generate. To fix this, we now filter the dependencies and only include libraries that we define in the build CMake file.
2022-01-18LibCrypo: Simplify mixed-sign bitwise_orNico Weber
No behavior change.
2022-01-18LibCrypto: Remove some now-unused (and incorrect) methodsNico Weber
Removes the UnsignedBigInteger overloads of SignedBigInteger::binary_{and,or,xor}(). They're now unused, and they also didn't work when *this was negative.
2022-01-18LibCrypto+LibJS: Better bitwise binary_xor binopNico Weber
We went through some trouble to make & and | work right. Reimplement ^ in terms of & and | to make ^ work right as well. This is less fast than a direct implementation, but let's get things working first.
2022-01-18LibCrypto+LibJS: Better bigint bitwise_or binopNico Weber
Similar to the bitwise_and change, but we have to be careful to sign-extend two's complement numbers only up to the highest set bit in the positive number.
2022-01-18LibCrypto+LibJS: Better bigint bitwise_and binopNico Weber
Bitwise and is defined in terms of two's complement, so some converting needs to happen for SignedBigInteger's sign/magnitude representation to work out. UnsignedBigInteger::bitwise_not() is repurposed to convert all high-order zero bits to ones up to a limit, for the two's complement conversion to work. Fixes test262/test/language/expressions/bitwise-and/bigint.js.
2022-01-18LibJS+LibCrypto: Fix SignedBitInteger::bitwise_not and use it in LibJSNico Weber
Bitwise operators are defined on two's complement, but SignedBitInteger uses sign-magnitude. Correctly convert between the two. Let LibJS delegate to SignedBitInteger for bitwise_not, like it does for all other bitwise_ operations on bigints. No behavior change (LibJS is now the only client of SignedBitInteger::bitwise_not()).
2022-01-18LibCrypto: Add Formatter<SignedBigInteger>Nico Weber
Useful for seeing SignedBigInteger values in test failure messages.