hyperframes 0.8.30 → 0.8.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -439,7 +439,7 @@
439
439
  return false;
440
440
  }
441
441
 
442
- function textOverflowIssues(element, root, rootRect, time, tolerance) {
442
+ function textOverflowIssues(element, root, rootRect, time, tolerance, clippedIssue) {
443
443
  const textRect = textRectFor(element, true);
444
444
  if (!textRect) return [];
445
445
  const text = textContentFor(element, true);
@@ -462,8 +462,15 @@
462
462
  ? tolerance
463
463
  : Math.max(tolerance, parsePx(elementStyle.fontSize) * 0.2);
464
464
  const containerOverflow = overflowFor(textRect, containerRect, tolerance, verticalTolerance);
465
+ const billedAsClippedText =
466
+ container === element &&
467
+ clippedIssue != null &&
468
+ containerOverflow != null &&
469
+ containerOverflow.left == null &&
470
+ containerOverflow.top == null;
465
471
  if (
466
472
  containerOverflow &&
473
+ !billedAsClippedText &&
467
474
  !hasTextClipOptOut(element) &&
468
475
  !clippedByAncestor(element, container)
469
476
  ) {
@@ -663,8 +670,8 @@
663
670
  code: "content_overlap",
664
671
  severity: "warning",
665
672
  time,
666
- selector: selectorFor(a.element),
667
- containerSelector: selectorFor(b.element),
673
+ selector: uniqueSelectorFor(a.element),
674
+ containerSelector: uniqueSelectorFor(b.element),
668
675
  text: textContentFor(a.element),
669
676
  message: "Two text blocks overlap and may render unreadable.",
670
677
  rect: a.rect,
@@ -1021,8 +1028,8 @@
1021
1028
  code: "text_occluded",
1022
1029
  severity: "error",
1023
1030
  time,
1024
- selector: selectorFor(element),
1025
- containerSelector: selectorFor(occluder),
1031
+ selector: uniqueSelectorFor(element),
1032
+ containerSelector: uniqueSelectorFor(occluder),
1026
1033
  text,
1027
1034
  message: "Text is hidden beneath an opaque element.",
1028
1035
  rect: textRect,
@@ -1444,7 +1451,7 @@
1444
1451
  if (!hasOwnTextCandidate(element)) continue;
1445
1452
  const clipped = clippedTextIssue(element, time, tolerance);
1446
1453
  if (clipped) issues.push(clipped);
1447
- issues.push(...textOverflowIssues(element, root, rootRect, time, tolerance));
1454
+ issues.push(...textOverflowIssues(element, root, rootRect, time, tolerance, clipped));
1448
1455
  const occluded = occludedTextIssue(element, time, proseCoverageFloor);
1449
1456
  if (occluded) issues.push(occluded);
1450
1457
  const invisible = invisibleTextIssue(element, time);