Title: [291044] trunk/Source/WebCore
Revision
291044
Author
[email protected]
Date
2022-03-09 05:29:13 -0800 (Wed, 09 Mar 2022)

Log Message

[WinCairo] SpatialNavigation.h(93): error C2365: 'WebCore::None': redefinition; previous definition was 'enumerator'
https://bugs.webkit.org/show_bug.cgi?id=237647

Unreviewed build fix.

Changed WebCore::RectsAlignment to an enum class.


* page/FocusController.cpp:
(WebCore::updateFocusCandidateIfNeeded):
* page/SpatialNavigation.cpp:
(WebCore::FocusCandidate::FocusCandidate):
(WebCore::alignmentForRects):
(WebCore::distanceDataForNode):
* page/SpatialNavigation.h:
(WebCore::FocusCandidate::FocusCandidate):
(): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291043 => 291044)


--- trunk/Source/WebCore/ChangeLog	2022-03-09 13:01:55 UTC (rev 291043)
+++ trunk/Source/WebCore/ChangeLog	2022-03-09 13:29:13 UTC (rev 291044)
@@ -1,3 +1,22 @@
+2022-03-09  Fujii Hironori  <[email protected]>
+
+        [WinCairo] SpatialNavigation.h(93): error C2365: 'WebCore::None': redefinition; previous definition was 'enumerator'
+        https://bugs.webkit.org/show_bug.cgi?id=237647
+
+        Unreviewed build fix.
+
+        Changed WebCore::RectsAlignment to an enum class.
+
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfNeeded):
+        * page/SpatialNavigation.cpp:
+        (WebCore::FocusCandidate::FocusCandidate):
+        (WebCore::alignmentForRects):
+        (WebCore::distanceDataForNode):
+        * page/SpatialNavigation.h:
+        (WebCore::FocusCandidate::FocusCandidate):
+        (): Deleted.
+
 2022-03-09  Antoine Quint  <[email protected]>
 
         [web-animations] color-interpolation-filters should support discrete animation

Modified: trunk/Source/WebCore/page/FocusController.cpp (291043 => 291044)


--- trunk/Source/WebCore/page/FocusController.cpp	2022-03-09 13:01:55 UTC (rev 291043)
+++ trunk/Source/WebCore/page/FocusController.cpp	2022-03-09 13:29:13 UTC (rev 291044)
@@ -972,7 +972,7 @@
     if (candidate.distance == maxDistance())
         return;
 
-    if (candidate.isOffscreenAfterScrolling && candidate.alignment < Full)
+    if (candidate.isOffscreenAfterScrolling && candidate.alignment < RectsAlignment::Full)
         return;
 
     if (closest.isNull()) {

Modified: trunk/Source/WebCore/page/SpatialNavigation.cpp (291043 => 291044)


--- trunk/Source/WebCore/page/SpatialNavigation.cpp	2022-03-09 13:01:55 UTC (rev 291043)
+++ trunk/Source/WebCore/page/SpatialNavigation.cpp	2022-03-09 13:29:13 UTC (rev 291044)
@@ -60,7 +60,7 @@
     , focusableNode(nullptr)
     , enclosingScrollableBox(nullptr)
     , distance(maxDistance())
-    , alignment(None)
+    , alignment(RectsAlignment::None)
     , isOffscreen(true)
     , isOffscreenAfterScrolling(true)
 {
@@ -96,15 +96,15 @@
 {
     // If we found a node in full alignment, but it is too far away, ignore it.
     if (areRectsMoreThanFullScreenApart(direction, curRect, targetRect, viewSize))
-        return None;
+        return RectsAlignment::None;
 
     if (areRectsFullyAligned(direction, curRect, targetRect))
-        return Full;
+        return RectsAlignment::Full;
 
     if (areRectsPartiallyAligned(direction, curRect, targetRect))
-        return Partial;
+        return RectsAlignment::Partial;
 
-    return None;
+    return RectsAlignment::None;
 }
 
 static inline bool isHorizontalMove(FocusDirection direction)
@@ -648,7 +648,7 @@
     if (areElementsOnSameLine(current, candidate)) {
         if ((direction == FocusDirection::Up && current.rect.y() > candidate.rect.y()) || (direction == FocusDirection::Down && candidate.rect.y() > current.rect.y())) {
             candidate.distance = 0;
-            candidate.alignment = Full;
+            candidate.alignment = RectsAlignment::Full;
             return;
         }
     }

Modified: trunk/Source/WebCore/page/SpatialNavigation.h (291043 => 291044)


--- trunk/Source/WebCore/page/SpatialNavigation.h	2022-03-09 13:01:55 UTC (rev 291043)
+++ trunk/Source/WebCore/page/SpatialNavigation.h	2022-03-09 13:29:13 UTC (rev 291044)
@@ -89,7 +89,7 @@
 // "Totally Aligned" elements are preferable candidates to move
 // focus to over "Partially Aligned" ones, that on its turns are
 // more preferable than "Not Aligned".
-enum RectsAlignment {
+enum class RectsAlignment {
     None = 0,
     Partial,
     Full
@@ -101,7 +101,7 @@
         , focusableNode(nullptr)
         , enclosingScrollableBox(nullptr)
         , distance(maxDistance())
-        , alignment(None)
+        , alignment(RectsAlignment::None)
         , isOffscreen(true)
         , isOffscreenAfterScrolling(true)
     {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to