View Single Post
Old 11-05-2019, 09:39 AM   #15
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,810
Karma: 6000000
Join Date: Nov 2009
Device: many
Just for the record, the bug in qtwebengine is here:

qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.cc

In these specific routines which leaves out "h6" in two key places:

Code:
void InsertParagraphSeparatorCommand::ApplyStyleAfterInsertion(
    Element* original_enclosing_block,
    EditingState* editing_state) {
  // Not only do we break out of header tags, but we also do not preserve the
  // typing style, in order to match other browsers.
  if (original_enclosing_block->HasTagName(h1Tag) ||
      original_enclosing_block->HasTagName(h2Tag) ||
      original_enclosing_block->HasTagName(h3Tag) ||
      original_enclosing_block->HasTagName(h4Tag) ||
      original_enclosing_block->HasTagName(h5Tag)) {
    return;
  }

...

bool InsertParagraphSeparatorCommand::ShouldUseDefaultParagraphElement(
    Element* enclosing_block) const {
  DCHECK(!GetDocument().NeedsLayoutTreeUpdate());

  if (must_use_default_paragraph_element_)
    return true;

  // Assumes that if there was a range selection, it was already deleted.
  if (!IsEndOfBlock(EndingVisibleSelection().VisibleStart()))
    return false;

  return enclosing_block->HasTagName(h1Tag) ||
         enclosing_block->HasTagName(h2Tag) ||
         enclosing_block->HasTagName(h3Tag) ||
         enclosing_block->HasTagName(h4Tag) ||
         enclosing_block->HasTagName(h5Tag);
}
So this is clearly a bug and the fix would be quite easy to make but getting anyone at Apple or Google to actually fix this code to include h6 as it is obviously a heading element would be next to impossible.

Sad really....

If anyone knows someone on the Webkit or Blink teams ....


ps: found by grepping the blink editing code for files with h1-h5 without h6. This is the only place that occurs.

Last edited by KevinH; 11-05-2019 at 10:07 AM.
KevinH is offline   Reply With Quote