<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>248432</bug_id>
          
          <creation_ts>2022-11-28 15:24:46 -0800</creation_ts>
          <short_desc>Remove non-standard: overflow: -webkit-paged-* (x|y)</short_desc>
          <delta_ts>2023-12-15 17:35:48 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=165304</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=112909</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=113004</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=109681</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=113183</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>karlcow</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>ntim</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1915133</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-11-28 15:24:46 -0800</bug_when>
    <thetext>Hi Team,

While going through Blink&apos;s commit, I came across another interesting one, where Safari is still failing test case (STP158 &amp; Safari 16.1) compared to Chrome Canary 110 and Firefox Nightly 109:

Failing Test Case - https://jsfiddle.net/bajc7h9p/ (Can&apos;t scroll from yellow div)

Blink Commit - https://src.chromium.org/viewvc/blink?view=revision&amp;revision=190656

Webkit Merge is difficult to 1-1 (At least for me), because this commit removed code, where I could&apos;ve added this bit:

https://github.com/WebKit/WebKit/commit/38512761f8da553f42c566ea425d045351531469

Just wanted to raise bug for future purposes.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916635</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-12-04 21:07:30 -0800</bug_when>
    <thetext>Instead it should probably be removed. 
https://bugs.chromium.org/p/chromium/issues/detail?id=940652

With 
```
data:text/html,&lt;div%20style=&quot;line-height:2em;%20height:9em;%20overflow:-webkit-paged-y;%20background:yellow;&quot;&gt;%20%20%20%20%20scroll%20me&lt;br&gt;%20%20%20%20%20Please%20scroll%20me&lt;br&gt;%20%20%20%20%20Pretty%20please%20scroll%20me&lt;br&gt;%20%20%20%20%20Pretty%20please%20scroll%20me!&lt;br&gt;%20%20%20%20%20This%20is%20where%20page%202%20starts&lt;br&gt;%20%20%20%20%20more%20page%202%20content&lt;br&gt;%20%20%20%20%20even%20more%20page%202%20content&lt;br&gt;%20%20%20%20%20PASS%20&lt;/div&gt;
```

and `window.getComputedStyle(document.querySelector(&apos;div&apos;)).overflow`

Safari: `auto -webkit-paged-y`
Firefox: `visible`
Chrome: `visible`


https://searchfox.org/wubkat/search?q=WebkitPaged&amp;path=&amp;case=false&amp;regexp=false</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916817</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-12-05 15:25:18 -0800</bug_when>
    <thetext>&lt;rdar://problem/103000377&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1916912</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-12-06 04:15:32 -0800</bug_when>
    <thetext>(In reply to Karl Dubost from comment #1)
&gt; Instead it should probably be removed. 
&gt; https://bugs.chromium.org/p/chromium/issues/detail?id=940652
&gt; 
&gt; With 
&gt; ```
&gt; data:text/html,&lt;div%20style=&quot;line-height:2em;%20height:9em;%20overflow:-
&gt; webkit-paged-y;%20background:yellow;
&gt; &quot;&gt;%20%20%20%20%20scroll%20me&lt;br&gt;%20%20%20%20%20Please%20scroll%20me&lt;br&gt;%20%20
&gt; %20%20%20Pretty%20please%20scroll%20me&lt;br&gt;%20%20%20%20%20Pretty%20please%20sc
&gt; roll%20me!
&gt; &lt;br&gt;%20%20%20%20%20This%20is%20where%20page%202%20starts&lt;br&gt;%20%20%20%20%20mo
&gt; re%20page%202%20content&lt;br&gt;%20%20%20%20%20even%20more%20page%202%20content&lt;br
&gt; &gt;%20%20%20%20%20PASS%20&lt;/div&gt;
&gt; ```
&gt; 
&gt; and `window.getComputedStyle(document.querySelector(&apos;div&apos;)).overflow`
&gt; 
&gt; Safari: `auto -webkit-paged-y`
&gt; Firefox: `visible`
&gt; Chrome: `visible`
&gt; 
&gt; 
&gt; https://searchfox.org/wubkat/
&gt; search?q=WebkitPaged&amp;path=&amp;case=false&amp;regexp=false

Sweet! If we can remove it then it is better since then we would more web-compatible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966971</commentid>
    <comment_count>4</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2023-07-16 13:06:55 -0700</bug_when>
    <thetext>Why do we think removing this is safe? We generally don&apos;t remove things unless we are confident it&apos;s A) not used and B) causing us harm somehow</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966984</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2023-07-16 15:10:39 -0700</bug_when>
    <thetext>(In reply to Myles C. Maxfield from comment #4)
&gt; Why do we think removing this is safe? We generally don&apos;t remove things
&gt; unless we are confident it&apos;s A) not used and B) causing us harm somehow

I don&apos;t know about A, but regarding B, this can cause behavior differences on websites between Safari and other browsers which is undesirable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966985</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-16 15:17:28 -0700</bug_when>
    <thetext>Blink - Intent To Remove - https://groups.google.com/a/chromium.org/g/blink-dev/c/_UhJEz04sqA

__________

https://chromestatus.com/metrics/feature/timeline/popularity/1867

^ Usage is about 0.005%

_______

Firefox -&gt; Never supported this.

Blink / Chrome -&gt; Removed it in 2019.

_______

So Safari is only browser with support for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967326</commentid>
    <comment_count>7</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-07-19 01:42:38 -0700</bug_when>
    <thetext>The question becomes are there other WebKit-powered applications using this specific feature?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967717</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-22 04:35:59 -0700</bug_when>
    <thetext>Local Page:

&gt;&gt; Source/WebCore/rendering/style/RenderStyleConstants.h

Line 273 &amp; 274: enum class Overflow : uint8_t

Remove &apos;PagedX&apos; and &apos;PagedY&apos;

&gt;&gt; Source/WebCore/style/StyleAdjuster.cpp:

Remove following FIXME:

// FIXME: Once we implement pagination controls, overflow-x should default to hidden
// if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, we&apos;ll let it
// default to auto so we can at least scroll through the pages.

and following:

// Call setStylesForPaginationMode() if a pagination mode is set for any non-root elements. If these
    // styles are specified on a root element, then they will be incorporated in
    // Style::createForm_document.
    if ((style.overflowY() == Overflow::PagedX || style.overflowY() == Overflow::PagedY) &amp;&amp; !(m_element &amp;&amp; (m_element-&gt;hasTagName(htmlTag) || m_element-&gt;hasTagName(bodyTag))))
        style.setColumnStylesFromPaginationMode(WebCore::paginationModeForRenderStyle(style));

&gt;&gt; Source/WebCore/rendering/style/RenderStyleConstants.cpp:

In &apos;TextStream&amp; operator&lt;&lt;(TextStream&amp; ts, Overflow overflow)&apos;

Remove case Overflow::PagedX: and case Overflow::PagedY:

&gt;&gt; Source/WebCore/rendering/RenderBlockFlow.cpp

In &apos;RenderBlockFlow::willCreateColumns&apos;, delete following:

// If overflow-y is set to paged-x or paged-y on the body or html element, we&apos;ll handle the paginating in the RenderView instead.
    if ((style().overflowY() == Overflow::PagedX || style().overflowY() == Overflow::PagedY) &amp;&amp; !(isDocumentElementRenderer() || isBody()))
        return true;

&gt;&gt; Source/WebCore/page/LocalFrameView.h:

Delete &apos;Pagination::Mode paginationModeForRenderStyle&apos;

&gt;&gt; Source/WebCore/page/LocalFrameView.cpp:

Delete &apos;Pagination::Mode paginationModeForRenderStyle&apos;

and following comment:

&apos;Don&apos;t set it at all. Values of Overflow::PagedX and Overflow::PagedY are handled by applyPaginationToViewPort().&apos;


and in LocalFrameView::applyPaginationToViewport(), change it to this (* Not sure on this one *):

void LocalFrameView::applyPaginationToViewport()
{
    auto* document = m_frame-&gt;document();
    auto* documentElement = document ? document-&gt;documentElement() : nullptr;
    if (!documentElement || !documentElement-&gt;renderer()) {
        setPagination(Pagination());
        return;
    }
    Pagination pagination;
    setPagination(pagination);
}

&gt;&gt; Source/WebCore/css/parser/CSSPropertyParser.cpp:

In &apos;CSSPropertyParser::consumeOverflowShorthand&apos;: Delete following:

// FIXME: -webkit-paged-x or -webkit-paged-y only apply to overflow-y. If this value has been
        // set using the shorthand, then for now overflow-x will default to auto, but once we implement
        // pagination controls, it should default to hidden. If the overflow-y value is anything but
        // paged-x or paged-y, then overflow-x and overflow-y should have the same value.
        if (xValueID == CSSValueWebkitPagedX || xValueID == CSSValueWebkitPagedY)
            xValueID = CSSValueAuto;

&gt;&gt; Source/WebCore/css/CSSValueKeywords.in:

Delete following:

// overflow
-webkit-paged-x
-webkit-paged-y

&gt;&gt; Source/WebCore/css/CSSProperties.json:

Delete following:


},
                {
                    &quot;value&quot;: &quot;-webkit-paged-x&quot;,
                    &quot;status&quot;: &quot;non-standard&quot;
                },
                {
                    &quot;value&quot;: &quot;-webkit-paged-y&quot;,
                    &quot;status&quot;: &quot;non-standard&quot;

&gt;&gt; Source/WebCore/css/CSSPrimitiveValueMappings.h:

In &apos;constexpr CSSValueID toCSSValueID(Overflow e)&apos;: Delete following cases: &apos;case Overflow::PagedX:&apos; and &apos;case Overflow::PagedY:&apos;


In &apos;template&lt;&gt; constexpr Overflow fromCSSValueID(CSSValueID valueID)&apos;: Delete following cases: &apos;case CSSValueWebkitPagedX:&apos; and &apos;case CSSValueWebkitPagedY:&apos;

_____________

Just wanted to document for someone else to try locally.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980259</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-26 12:43:57 -0700</bug_when>
    <thetext>@Karl - do you have any insight from internal Apple products perspective, which might rely on it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980392</commentid>
    <comment_count>10</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-09-26 20:59:29 -0700</bug_when>
    <thetext>I&apos;m not sure, but it could probably be removed after the poking I have done internally. And given it has removed for a long time from chrome and was never be in Firefox. 

Content is probably not relying on it. 

Though on the other hand we can see things like

https://github.com/jarek-foksa/xel/blob/f977219f127492ab714e4b1c55c9726b6103aa29/themes/base.css#L792-L795


And comment like this
https://stackoverflow.com/questions/59599461/equivalent-to-uiwebviews-paginationmode-on-wkwebview


It is probably necessary to check if these cases have been solved. 


&gt; Practically speaking these aren&apos;t used. Most developers use them accidentally, and typically when they are they force a new formatting context similar to setting overflow: hidden.
— https://developer.chrome.com/blog/chrome-75-deps-rems/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>