Andreas Kling
d9ece296f0
LibWeb: Fix LayoutImage stupidly painting backgrounds over itself
...
The good boy fix here would be to implement all of the CSS paint phases
but for now, let's at least not paint a background over our image. :^)
2020-06-13 22:18:12 +02:00
Andreas Kling
d51c1c136e
LibGfx: Painter::draw_line() can just return early if alpha == 0
2020-06-13 20:38:36 +02:00
Andreas Kling
502b5b76c8
LibWeb: Have DOM nodes start out in "needs style update" state
...
Otherwise we won't get the first fully styled look until you interact
with the page (e.g via hovering an element.)
2020-06-13 20:10:43 +02:00
Andreas Kling
0e65fc3a6d
LibWeb: Expand background:none into background-color:transparent
2020-06-13 20:03:41 +02:00
Andreas Kling
3bba163574
LibGfx: Add Color::Transparent as a named color
2020-06-13 20:03:19 +02:00
Andreas Kling
2650005af8
LibWeb: <link rel> is actually a space-separated list of tokens
...
...so when we check for rel=stylesheet, we have to split it up into
parts first. :^)
2020-06-13 20:02:36 +02:00
Andreas Kling
d200385c1a
LibWeb: Sort style properties by name in the inspector window
2020-06-13 19:53:28 +02:00
Paul Roukema
eb11ab2480
Base: Add some interlaced PNGs to the local copies of the pngsuite tests
2020-06-13 19:47:43 +02:00
Paul Roukema
b6147de1cb
LibGfx: Implement support for decoding interlaced PNGs
...
This adds support for decoding the Adam7 interlacing used in some PNGs.
Notably this includes many of the images (such as the eyes) used in the acid2 test :^)
Note that the HTML engine still doesn't understand the <object> tag well enough to show the eyes on the test.
2020-06-13 19:47:43 +02:00
Paul Roukema
76553f9f06
LibGfx: Fix PNG decoder handling of 16-bit RGB images
2020-06-13 19:47:43 +02:00
Andreas Kling
1e15fa30e4
LibWeb: Don't try to be clever about -libweb-center relative position
...
Let's just say that -libweb-center centers the block in its containing
block for now. We can get fancy with relative offsets later.
2020-06-13 15:44:52 +02:00
Andreas Kling
bc5a862cbe
LibGfx: Silence debug spam in the PNG decoder
2020-06-13 15:37:10 +02:00
Andreas Kling
1f48d5a80d
LibWeb: Remove some unused functions in LayoutTableRow
2020-06-13 15:30:27 +02:00
Andreas Kling
dc0ed5c860
LibGfx: Don't keep an unused GIF decoder plugin in failed ImageDecoders
...
If we can't decode the input data, just have a null decoder. In this
state we simply return a null bitmap and whatever empty values make
sense for each API.
This way, we don't try to decode the same thing over and over since
it's not gonna work anyway. :^)
2020-06-13 15:29:29 +02:00
Andreas Kling
e46ee46ed6
LibWeb: Silence debug spam about reuse of cached resources
2020-06-13 15:27:53 +02:00
Andreas Kling
7e8945601a
LibWeb: Turn <td align> into CSS text-align
...
Note that align=center and align=middle both behave like the <center>
element, and not like text-align:center.
2020-06-13 15:16:56 +02:00
Andreas Kling
07ccaa1934
LibWeb: Teach line layout to collapse whitespace across fragments
...
This kind of HTML now produces a single piece of whitespace:
<span> </span> <span> </span> <span> </span>
We achieve this by checking if the last fragment on the last line ends
in whitespace. If so, we either don't add a fragment at all (for the
current chunk) or we simply skip over all whitespace at the head of
the current chunk (instead of collapsing it to a single ' '.)
2020-06-13 15:03:16 +02:00
Andreas Kling
4ab1b0b436
LibIPC: Only start responsiveness timer after sending client a message
...
Instead of always running the responsiveness timer for IPC clients,
we now only start it after sending a message. This avoids waking up
otherwise idle clients to do ping/pong busywork.
2020-06-13 13:47:01 +02:00
Andreas Kling
47df0cbbc8
LibWeb: Fix broken tokenization of hexadecimal character references
...
We were interpreting 'A'-'F' as decimal digits which didn't work right.
2020-06-13 13:46:12 +02:00
Andreas Kling
784ed004e6
LibWeb: Implement <center> as -libweb-center
...
To get the expected behavior for <center>, we needed a special text
alignment mode that centers block-level elements (and not just line
box fragments.)
2020-06-13 12:49:20 +02:00
Andreas Kling
6de937a689
LibWeb: Turn <table bgcolor> into CSS background-color
...
More presentational attribute stuff. HN looking more and more like it's
supposed to. :^)
2020-06-13 12:49:20 +02:00
Andreas Kling
0b4f92e452
LibWeb: Tweak UA style to reset text-align on table elements
...
I think maybe this is only supposed to happen in quirks mode but I'm
not entirely sure. This makes "<center><table>..." behave as expected.
2020-06-13 12:49:20 +02:00
Matthew Olsson
b155e64b67
LibJS: Add JSON.parse
2020-06-13 12:43:22 +02:00
Matthew Olsson
e8e728454c
AK: JsonParser improvements
...
- Parsing invalid JSON no longer asserts
Instead of asserting when coming across malformed JSON,
JsonParser::parse now returns an Optional<JsonValue>.
- Disallow trailing commas in JSON objects and arrays
- No longer parse 'undefined', as that is a purely JS thing
- No longer allow non-whitespace after anything consumed by the initial
parse() call. Examples of things that were valid and no longer are:
- undefineddfz
- {"foo": 1}abcd
- [1,2,3]4
- JsonObject.for_each_member now iterates in original insertion order
2020-06-13 12:43:22 +02:00
Matthew Olsson
39576b2238
LibJS: Add JSON.stringify
2020-06-13 12:43:22 +02:00
Hüseyin ASLITÜRK
b4577ffcf3
Kernel: KeyboardDevice, remove char mapping logic
...
Remove char mapping logic and constant character map.
2020-06-13 12:36:30 +02:00
Hüseyin ASLITÜRK
f4d14c42d0
Kernel: Process, replace internal data type to CharacterMapData
2020-06-13 12:36:30 +02:00
Hüseyin ASLITÜRK
f79b410baa
LibKeyboard: Move character map from Kernel to LibKeyboard
2020-06-13 12:36:30 +02:00
Hüseyin ASLITÜRK
3ebdb5ea30
Application: KeyboardMapper, make button to like a real key
...
Change key paint to more like a real key :)
2020-06-13 12:36:30 +02:00
Hüseyin ASLITÜRK
8733da652e
Base: Add numpad keys to keymap files
2020-06-13 12:36:30 +02:00
Andreas Kling
384b5f15c9
LibWeb: Sort matched style rules by specificity, document order
...
If two rules have equal specificity, they should be applied in the
order in which we encountered them.
2020-06-13 00:44:26 +02:00
Andreas Kling
fa5e8be31c
LibWeb: Fix broken Specificity::operator==
2020-06-13 00:43:32 +02:00
Andreas Kling
ae3e5e9d37
LibWeb: Include selector pseudo-class in style sheet dumps
2020-06-13 00:43:06 +02:00
Andreas Kling
256898431c
LibWeb: Simplify Node::is_link()
...
No need to check for presence of the href attribute as that is already
checked by enclosing_link_element().
2020-06-13 00:23:32 +02:00
Andreas Kling
483b371a7b
LibWeb: Parse and match the :visited pseudo-class (always fails)
...
If we don't do this, something like "a:visited" is parsed as "a" which
may then take precedence over a previous "a:link" etc.
2020-06-13 00:23:30 +02:00
Andreas Kling
62893a54cc
LibWeb: More work on table layout
...
Table row layout is now split into two phases:
1. Compute all the column widths (even taking colspan into account!)
2. Place all cells at the correct x,y offsets based on column widths.
Both phases visit all rows and all cells.
2020-06-13 00:12:23 +02:00
Andreas Kling
365703e3f3
LibWeb: Allow url("foo") and url('foo') in CSS background-image values
...
This is very hackish and will be fixed by writing a proper CSS parser.
2020-06-13 00:11:38 +02:00
Andreas Kling
0306ada1ff
LibWeb: Add "colspan" to HTML::AttributeNames
2020-06-13 00:11:14 +02:00
Andreas Kling
0061a82be3
LibWeb: Add LayoutTableCell::colspan()
...
A convenient function for looking up a cell's colspan attribute.
2020-06-13 00:10:52 +02:00
Andreas Kling
196a3986d6
LibWeb: First cut of extremely naive table row layout
...
This first version simply auto-sizes all table cells and then places
them on a horizontal line.
2020-06-12 23:18:51 +02:00
Andreas Kling
c5a3d99dd5
LibWeb: Turn <table width> into the CSS width property
2020-06-12 22:52:38 +02:00
Andreas Kling
ca41c2e4a0
LibWeb: Turn <td bgcolor> into background-color
2020-06-12 22:47:51 +02:00
Andreas Kling
e9e2226544
LibWeb: Add "bgcolor" to HTML::AttributeNames
2020-06-12 22:47:41 +02:00
Andreas Kling
6f19067c9a
LibWeb+Browser: Add a barebones LayoutTreeModel to the inspector window
...
This allows you to inspect the layout tree, along side the DOM tree.
It will need more functionality to be truly useful, but it's a start.
2020-06-12 22:30:11 +02:00
Andreas Kling
68ae1de463
Browser: Be a little bit smarter about interpretering command line URLs
...
If the (optional) URL specified on the command line is an existing file
we now resolve its real path before turning into a URL. This makes
relative URLs inside the loaded document work correctly.
Also interpret all other specified URLs the same way we would if you
had typed them into the location bar.
2020-06-12 21:29:27 +02:00
Andreas Kling
d54ace5f04
LibCore: Add Core::File::real_path_for()
...
A slightly convenient wrapper around realpath(3).
2020-06-12 21:29:01 +02:00
Andreas Kling
fdfda6dec2
AK: Make string-to-number conversion helpers return Optional
...
Get rid of the weird old signature:
- int StringType::to_int(bool& ok) const
And replace it with sensible new signature:
- Optional<int> StringType::to_int() const
2020-06-12 21:28:55 +02:00
sppmacd
15f4043a7a
AudioServer: removed AS prefix from class and file names
...
And moved everything to AudioServer namespace
2020-06-12 20:42:22 +02:00
Andreas Kling
c91981eba8
LibWeb: Handle negative values when collapsing vertical margins
...
In the presence of negative margins, we subtract the largest negative
margin from max(0, largest positive margin).
2020-06-12 18:47:18 +02:00
Andreas Kling
21b1f1653d
LibWeb: Implement very basic margin collapsing
...
We now collapse a block's top margin with the previous sibling's
bottom margin so that the larger margin wins.
2020-06-12 18:47:18 +02:00