WebKit Bugzilla
Attachment 371034 Details for
Bug 198032
: Inherited width does not respect max-width and min-width algorithm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add a WPT test
bug-198032-20190531140319.patch (text/plain), 6.84 KB, created by
Joonghun Park
on 2019-05-30 22:03:45 PDT
(
hide
)
Description:
Add a WPT test
Filename:
MIME Type:
Creator:
Joonghun Park
Created:
2019-05-30 22:03:45 PDT
Size:
6.84 KB
patch
obsolete
>Subversion Revision: 245940 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a368a5fe6fae518c82cb76f47c4a48b8a6d79f42..caef45e4f489159fdb136dbdba2013caa4d60e76 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2019-05-30 Joonghun Park <jh718.park@samsung.com> >+ >+ Always min-width should win over max-width. >+ https://bugs.webkit.org/show_bug.cgi?id=198032 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In the spec, https://www.w3.org/TR/CSS21/visudet.html#min-max-widths, >+ the following algorithm describes how the two properties influence >+ the used value of the 'width' property. >+ >+ 1. The tentative used width is calculated (without 'min-width' and 'max-width') >+ following the rules under "Calculating widths and margins" above. >+ 2. If the tentative used width is greater than 'max-width', >+ the rules above are applied again, but this time using the computed value of 'max-width' >+ as the computed value for 'width'. >+ 3. If the resulting width is smaller than 'min-width', the rules above are applied again, >+ but this time using the value of 'min-width' as the computed value for 'width'. >+ >+ * rendering/RenderBlock.cpp: >+ (WebCore::RenderBlock::computePreferredLogicalWidths): >+ > 2019-05-30 Andres Gonzalez <andresg_22@apple.com> > > Inserting a newline in contenteditable causes two characters to be added instead of one >diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp >index 051e0854236971437654355151692ed542862fb2..14a16e99d8c23650675432bf12fd474c44c1b1ad 100644 >--- a/Source/WebCore/rendering/RenderBlock.cpp >+++ b/Source/WebCore/rendering/RenderBlock.cpp >@@ -2262,17 +2262,17 @@ void RenderBlock::computePreferredLogicalWidths() > m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value()); > else > computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); >+ >+ if (styleToUse.logicalMaxWidth().isFixed()) { >+ m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value())); >+ m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value())); >+ } > > if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) { > m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); > m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); > } > >- if (styleToUse.logicalMaxWidth().isFixed()) { >- m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value())); >- m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value())); >- } >- > LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth(); > m_minPreferredLogicalWidth += borderAndPadding; > m_maxPreferredLogicalWidth += borderAndPadding; >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 35dc951041ebca726f244768929570d1590c0e8e..1456cc25c7f9cfd384ab5a72f6496e422368ad6a 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,25 @@ >+2019-05-30 Joonghun Park <jh718.park@samsung.com> >+ >+ Always min-width should win over max-width. >+ https://bugs.webkit.org/show_bug.cgi?id=198032 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In the spec, https://www.w3.org/TR/CSS21/visudet.html#min-max-widths, >+ the following algorithm describes how the two properties influence >+ the used value of the 'width' property. >+ >+ 1. The tentative used width is calculated (without 'min-width' and 'max-width') >+ following the rules under "Calculating widths and margins" above. >+ 2. If the tentative used width is greater than 'max-width', >+ the rules above are applied again, but this time using the computed value of 'max-width' >+ as the computed value for 'width'. >+ 3. If the resulting width is smaller than 'min-width', the rules above are applied again, >+ but this time using the value of 'min-width' as the computed value for 'width'. >+ >+ * web-platform-tests/css/css-sizing/min-width-max-width-precedence-expected.txt: Added. >+ * web-platform-tests/css/css-sizing/min-width-max-width-precedence.html: Added. >+ > 2019-05-29 Said Abou-Hallawa <sabouhallawa@apple.com> > > REGRESSION (r244182) [Mac WK2] Layout Test imported/w3c/web-platform-tests/visual-viewport/viewport-resize-event-on-load-overflowing-page.html is a flaky failure >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/min-width-max-width-precedence-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/min-width-max-width-precedence-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..92b8714a97c40a7bec678462bf1625622faebb9b >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/min-width-max-width-precedence-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS When used value is resolved, min-width should win over max-width >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/min-width-max-width-precedence.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/min-width-max-width-precedence.html >new file mode 100644 >index 0000000000000000000000000000000000000000..43d575cdc791989f0867c4ac02899d3d5e0c8f88 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/min-width-max-width-precedence.html >@@ -0,0 +1,30 @@ >+<!DOCTYPE html> >+<title>CSS Test: check precedence between min-width and max-width</title> >+<link rel="help" href="https://www.w3.org/TR/CSS21/visudet.html#min-max-widths" /> >+<meta name="assert" content="Test that the used value of 'width' is resolved properly." /> >+<script src="/resources/testharness.js"></script> >+<script src="/resources/testharnessreport.js"></script> >+<style> >+.tooltip { >+ height: 68px; >+ position: relative; >+ max-width: 200px; >+ min-width: 260px; >+ background-color: red; >+} >+ >+#outer { >+ background-color: blue; >+ position: absolute; >+ height: 136px; >+} >+</style> >+ >+<div id="outer"> >+ <div id="inner" class="tooltip" role="tooltip"></div> >+</div> >+<script> >+test(() => { >+ assert_equals(getComputedStyle(document.querySelector("#outer")).width, '260px'); >+}, "When used value is resolved, min-width should win over max-width"); >+</script>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198032
:
370942
|
371034
|
371035
|
371036