Bug 266879
Summary: | Make "Outdent" command to respect CSS display property | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | rniwa, webkit-bug-importer, wenson_hsieh |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ahmad Saleem
Hi Team,
While going through Blink's commit, I came across following commit, which I think can be merged:
Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/73a2d635d5779e1092de3d26e4ee33d758d46444
WebKit Commit: https://github.com/WebKit/WebKit/blob/b2da34277e48164f292542ed493e1c4177fba7ce/Source/WebCore/editing/IndentOutdentCommand.cpp#L47
Below compiles and don't regress anything in 'WPT' (selection / editing etc.):
// Returns true if `node` is UL, OL, or BLOCKQUOTE with "display:block".
// "Outdent" command considers <BLOCKQUOTE style="display:inline"> makes
// indentation.
static bool isListOrIndentBlockquote(const Node& node)
{
const auto& element = dynamicDowncast<HTMLElement>(node);
if (!element)
return false;
if (!node.renderer() || !node.renderer()->isRenderBlock())
return false;
return node.hasTagName(ulTag) || node.hasTagName(olTag) || node.hasTagName(blockquoteTag);
}
____
Just wanted to raise to get input, if we can fix it.
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
*** Bug 266880 has been marked as a duplicate of this bug. ***
Ahmad Saleem
It could be potential optimization as well to early return if it is not 'HTML' document and also if it does not have any renderer.
Radar WebKit Bug Importer
<rdar://problem/120340580>