mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb: Support cellpadding=0 and invalidate table cells when it changes
We were incorrectly treating cellpadding=0 as if the attribute was missing. This commit fixes it so it behaves as `padding: 0` on cells. When adding a test, I discovered that we were not invalidating style for cells when their containing table's cellpadding attribute changed. So this commit fixes that as well.
This commit is contained in:
parent
fe2dff4944
commit
20c859519b
Notes:
github-actions[bot]
2025-02-21 01:17:42 +00:00
Author: https://github.com/awesomekling
Commit: 20c859519b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3651
Reviewed-by: https://github.com/tcl3 ✅
6 changed files with 44 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2020-2025, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -48,7 +48,7 @@ public:
|
|||
virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::table; }
|
||||
|
||||
unsigned border() const;
|
||||
unsigned padding() const;
|
||||
[[nodiscard]] Optional<u32> cellpadding() const;
|
||||
|
||||
private:
|
||||
HTMLTableElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
@ -64,7 +64,7 @@ private:
|
|||
|
||||
GC::Ptr<DOM::HTMLCollection> mutable m_rows;
|
||||
GC::Ptr<DOM::HTMLCollection> mutable m_t_bodies;
|
||||
unsigned m_padding { 1 };
|
||||
Optional<u32> m_cellpadding;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue