-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17725 from ckeditor/improve-performance-in-placeh…
…older-2 Other (engine): Improve performance of the placeholders. Other (image): Attribute `loading="lazy"` will be automatically added in editing view to images with `height` and `width` attributes set to improve loading performance. Tests: Added new `ghs` manual performance test. MINOR BREAKING CHANGE (image): Starting from this release, images that have `height` and `width` attributes set will automatically receive `loading="lazy"` attribute in the editing area. This happens only for the content loaded into the editor, the data output produced by the editor remains the same. The reason for this change is to improve user experience in documents that may contain hundreds of images.
- Loading branch information
Showing
7 changed files
with
150 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** | ||
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options | ||
*/ | ||
|
||
// This is main Wikipedia page source copied four times. This is to test content with a lot of messy / unsupported markup. | ||
// After it is loaded in the editor, it is ~150 A4 pages (however there are a lot of very short paragraphs and list items). | ||
|
||
/* eslint-disable */ | ||
|
||
const initialData = | ||
`<p style="color:blue;">Feature paragraph</p> | ||
<h2 style="color:green">Feature heading1</h2> | ||
<h3 style="color:green">Feature heading2</h3> | ||
<h4 style="color:green">Feature heading3</h4> | ||
<p><strong style="color:blue;">Feature bold</strong></p> | ||
<p><i style="color:blue;">Feature italic</i></p> | ||
<p><s style="color:blue;">Feature strike</s></p> | ||
<p><u style="color:blue;">Feature underline</u></p> | ||
<p><code style="color:blue;">Feature code</code></p> | ||
<p><sub style="color:blue;">Feature subscript</sub></p> | ||
<p><sup style="color:blue;">Feature superscript</sup></p> | ||
<p><a style="color:green;" href="https://example.com">Link feature</a></p> | ||
<p><a name="anchor" id="anchor">Anchor (name, ID only)</a></p> | ||
<p><mark class="marker-yellow" data-mark>Mark feature</mark></p> | ||
<p><span class="text-big text-italic" style="background-color:hsl(60, 75%, 60%);color:hsl(240, 75%, 60%);font-family:'Courier New', Courier, monospace;border:1px solid black">Font feature</span></p> | ||
<ul style="background:blue;"> | ||
<li style="color:yellow;">Bulleted List feature</li> | ||
<li style="color:yellow;">Bulleted List feature</li> | ||
<li style="color:yellow;">Bulleted List feature</li> | ||
</ul> | ||
<ol style="background:blue;"> | ||
<li style="color:yellow;">Numbered List feature</li> | ||
<li style="color:yellow;">Numbered List feature</li> | ||
<li style="color:yellow;">Numbered List feature</li> | ||
</ol> | ||
<ul class="todo-list" style="background:blue;"> | ||
<li style="color:yellow;"> | ||
<label class="todo-list__label"> | ||
<input type="checkbox" disabled="disabled"> | ||
<span class="todo-list__label__description">Todo List feature</span> | ||
</label> | ||
</li> | ||
<li style="color:yellow;"> | ||
<label class="todo-list__label"> | ||
<input type="checkbox" disabled="disabled"> | ||
<span class="todo-list__label__description">Todo List feature</span> | ||
</label> | ||
</li> | ||
<li style="color:yellow;"> | ||
<label class="todo-list__label"> | ||
<input type="checkbox" disabled="disabled"> | ||
<span class="todo-list__label__description">Todo List feature</span> | ||
</label> | ||
</li> | ||
</ul> | ||
<blockquote style="color:blue;"><p>Blockquote Feature</p></blockquote> | ||
<figure style="border: 1px solid blue;" class="image"> | ||
<img src="/ckeditor5/tests/manual/sample.jpg" width="826" height="388"/> | ||
<figcaption style="background:yellow;">Caption</figcaption> | ||
</figure> | ||
<pre style="background:blue;"><code style="color:yellow;" class="language-plaintext">Code Block</code></pre> | ||
<div style="border: 1px solid blue" class="raw-html-embed">HTML snippet</div> | ||
<div data-foo class="page-break" style="page-break-after:always;"><span style="display:none;"> </span></div> | ||
<p><i class="inline-icon"></i> empty inline at start</p> | ||
<p>Text with <i class="inline-icon"></i> empty inline inside</p> | ||
<p>Text with empty inline at the end <i class="inline-icon"></i></p>`; | ||
|
||
export default function makeData() { | ||
return initialData.repeat( 250 ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters