Open yarusome opened 1 year ago
I can offer to do the reorganization, but since it's quite a large modification, I'd like to hear some feedback first.
@yarusome , sorry to be slow giving you feedback. I've read your proposal in detail and think it sounds like a great plan.
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Whitespace
What specific section or headline is this issue about?
No response
What information was incorrect, unhelpful, or incomplete?
Factual error:
In the "Explanation" subsection of How does CSS process whitespace?, Step 3 is incorrect:
In 4.1.3. Segment Break Transformation Rules of the CSS Text Module, in particular Step 2 and the note at the end of 4.1.3, it is explicitly stated that segment breaks can be removed contextually. This is verified by the following HTML code on Firefox:
In the same subsection, Step 5 is incorrect:
In 4.1.2. Phase II: Trimming and Positioning, Step 1 and 3 shows that spaces are removed not because they're at the start or end of a (block-level) element, but because they appear at the start or end of a line during layout.
Structual issues:
The How does CSS process whitespace? subsection may use a more consistent heading with the subsections that follow, e.g. "Whitespaces in inline formatting contexts", since all the subsections in this section deal with whitespaces in CSS.
The phenomenon described in Spaces in between inline and inline-block elements is merely a special case of "How does CSS process whitespace?", but it is given the most lengthy presence in this section along with an ensuing "Solution" subsection.
This page doesn't mention whitespaces in selections. For the following HTML code:
the rendered text is
你好世界!
. But when selecting all the visible texts, e.g. pressing Ctrl + A on the page on Windows,getSelection().toString()
returns你好 世界!
, which is also what gets copied by Ctrl + C on Firefox on Windows (note that the tab is transformed into a space), whereasgetSelection().getRangeAt(0).toString()
returns你好\n\t世界!
.What did you expect to see?
The factual errors be corrected.
Split the CSS-related content on this page into a new guide page under CSS.
Add a section about whitespace on the page of the Selection API.
Crossref these whitespace sections with each other.
Do you have any supporting links, references, or citations?
CSS Text Module: https://drafts.csswg.org/css-text/#white-space-processing Selection API issue: https://www.w3.org/Bugs/Public/show_bug.cgi?id=10583 https://github.com/w3c/selection-api/issues/165
Do you have anything more you want to share?
Relates to: https://github.com/mdn/translated-content/issues/14702
I can offer to do the reorganization, but since it's quite a large modification, I'd like to hear some feedback first.
PS: I'd soon be away until mid-August, so the offer will only be effective since mid-August.