Prechádzať zdrojové kódy

LibWeb: Rename PaintPhase::FocusOutline -> Outline

Any element can have an outline, whether because of focus or not.
Sam Atkins 2 rokov pred
rodič
commit
8520afaa11

+ 1 - 1
Userland/Libraries/LibWeb/Painting/Paintable.h

@@ -23,7 +23,7 @@ enum class PaintPhase {
     Background,
     Border,
     Foreground,
-    FocusOutline,
+    Outline,
     Overlay,
 };
 

+ 2 - 2
Userland/Libraries/LibWeb/Painting/PaintableBox.cpp

@@ -217,7 +217,7 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const
         context.painter().draw_text(size_text_device_rect, size_text, font, Gfx::TextAlignment::Center, context.palette().color(Gfx::ColorRole::TooltipText));
     }
 
-    if (phase == PaintPhase::FocusOutline && layout_box().dom_node() && layout_box().dom_node()->is_element() && verify_cast<DOM::Element>(*layout_box().dom_node()).is_focused()) {
+    if (phase == PaintPhase::Outline && layout_box().dom_node() && layout_box().dom_node()->is_element() && verify_cast<DOM::Element>(*layout_box().dom_node()).is_focused()) {
         // FIXME: Implement this as `outline` using :focus-visible in the default UA stylesheet to make it possible to override/disable.
         auto focus_outline_rect = context.enclosing_device_rect(absolute_border_box_rect()).inflated(4, 4);
         context.painter().draw_focus_rect(focus_outline_rect.to_type<int>(), context.palette().focus_outline());
@@ -641,7 +641,7 @@ void PaintableWithLines::paint(PaintContext& context, PaintPhase phase) const
     }
 
     // FIXME: Merge this loop with the above somehow..
-    if (phase == PaintPhase::FocusOutline) {
+    if (phase == PaintPhase::Outline) {
         for (auto& line_box : m_line_boxes) {
             for (auto& fragment : line_box.fragments()) {
                 auto* node = fragment.layout_node().dom_node();

+ 3 - 3
Userland/Libraries/LibWeb/Painting/StackingContext.cpp

@@ -125,7 +125,7 @@ void StackingContext::paint_descendants(PaintContext& context, Layout::Node cons
             break;
         case StackingContextPaintPhase::FocusAndOverlay:
             if (context.has_focus()) {
-                paint_node(child, context, PaintPhase::FocusOutline);
+                paint_node(child, context, PaintPhase::Outline);
             }
             paint_node(child, context, PaintPhase::Overlay);
             paint_descendants(context, child, phase);
@@ -213,7 +213,7 @@ void StackingContext::paint_internal(PaintContext& context) const
         paint_descendants(context, layout_node, StackingContextPaintPhase::BackgroundAndBordersForInlineLevelAndReplaced);
         paint_node(layout_node, context, PaintPhase::Foreground);
         paint_descendants(context, layout_node, StackingContextPaintPhase::Foreground);
-        paint_node(layout_node, context, PaintPhase::FocusOutline);
+        paint_node(layout_node, context, PaintPhase::Outline);
         paint_node(layout_node, context, PaintPhase::Overlay);
         paint_descendants(context, layout_node, StackingContextPaintPhase::FocusAndOverlay);
         if (parent_paintable)
@@ -230,7 +230,7 @@ void StackingContext::paint_internal(PaintContext& context) const
             paint_child(child);
     }
 
-    paint_node(m_box, context, PaintPhase::FocusOutline);
+    paint_node(m_box, context, PaintPhase::Outline);
     paint_node(m_box, context, PaintPhase::Overlay);
     paint_descendants(context, m_box, StackingContextPaintPhase::FocusAndOverlay);
 }