Skip to content

Commit 265751e

Browse files
committed
fix(painter-dom): restore viewing-mode hover suppression on inline SDTs (SD-3110)
The previous fix added a second chained :not([data-appearance='hidden']) to the inline lock-hover rule, which bumped its specificity from (0,4,0) to (0,5,0). The viewing-mode suppression rule below sits at (0,4,0), so it lost the cascade and the lock-hover blue re-appeared on hover in viewing mode — regressing the SD-2232 behavior test "inline SDT hover does not show background in viewing mode". Collapse the two predicates into a single :not(a, b). Comma-list :not() takes the max specificity of its arguments, not the sum, so the selector stays at (0,4,0), viewing-mode suppression wins again, and the hidden-appearance exclusion is preserved. Verified: 22/22 SDT behavior cases on chromium, 44/44 on firefox+webkit; painter-dom unit tests still 1071/1071.
1 parent 3ac7c40 commit 265751e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • packages/layout-engine/painters/dom/src

packages/layout-engine/painters/dom/src/styles.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,13 +667,13 @@ const SDT_CONTAINER_STYLES = `
667667
* Inline SDTs use :hover (single element, no coordination needed).
668668
* Hover is suppressed when the node is selected (SD-1584).
669669
*
670-
* Inline SDTs with appearance=hidden are excluded: this selector has
671-
* higher specificity than the hidden-appearance rule above (its
672-
* :not(.ProseMirror-selectednode) adds a class to the specificity tuple),
673-
* so without the exclusion it would re-introduce the lock-hover blue
674-
* background on hover and contradict the "visually transparent" intent. */
670+
* Inline SDTs with appearance=hidden are excluded via the same :not()
671+
* that handles selection. Both predicates live in one :not(a, b) so the
672+
* selector keeps (0,4,0) specificity. A second chained :not() would push
673+
* it to (0,5,0) and beat the viewing-mode suppression rule below, which
674+
* also sits at (0,4,0). */
675675
.superdoc-structured-content-block[data-lock-mode].sdt-group-hover:not(.ProseMirror-selectednode),
676-
.superdoc-structured-content-inline[data-lock-mode]:hover:not(.ProseMirror-selectednode):not([data-appearance='hidden']) {
676+
.superdoc-structured-content-inline[data-lock-mode]:hover:not(.ProseMirror-selectednode, [data-appearance='hidden']) {
677677
background-color: var(--sd-content-controls-lock-hover-bg, rgba(98, 155, 231, 0.08));
678678
z-index: 9999999;
679679
}

0 commit comments

Comments
 (0)