Changeset 147261 in webkit


Ignore:
Timestamp:
Mar 29, 2013 4:32:46 PM (11 years ago)
Author:
ojan@chromium.org
Message:

Source/WebCore: Flexitems no longer default min-width to min-content
https://bugs.webkit.org/show_bug.cgi?id=111790

Reviewed by Tony Chang.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):
Disallow auto as a valid min-size value.

  • css/html.css:

(input::-webkit-datetime-edit):
(input[type="range"]::-webkit-slider-container, input[type="range"]::-webkit-media-slider-container):
(input[type="range"]::-webkit-slider-runnable-track):
Remove now unnecessary min-width: 0's.

  • css/mediaControlsChromium.css:

(audio::-webkit-media-controls-enclosure, video::-webkit-media-controls-enclosure):
(video::-webkit-media-controls-enclosure):
Set a flex-shrink: 0 to avoid shrinking these items below the designated height.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::constrainLogicalHeightByMinMax):
(WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
(WebCore::RenderBox::computeLogicalWidthInRegionUsing):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computeLogicalHeightUsing):
(WebCore::RenderBox::computeContentLogicalHeight):
(WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
(WebCore::RenderBox::computeReplacedLogicalWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalWidthUsing):
(WebCore::RenderBox::computePositionedLogicalHeight):
(WebCore::RenderBox::computePositionedLogicalHeightUsing):
Remove all the unneeded SizeType arguments now that we don't need to
specially handle MinSize in all these functions.

  • rendering/RenderBox.h:
  • rendering/RenderButton.cpp:

(WebCore::RenderButton::styleWillChange):
(WebCore::RenderButton::setupInnerStyle):
No longer need to explicitly set min-width:0.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
Remove the code for specially handling auto.

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):

  • rendering/RenderRegion.cpp:

(WebCore::RenderRegion::maxPageLogicalHeight):

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::computeReplacedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalHeight):
Remove all the now unneeded SizeType arguments.

  • rendering/style/RenderStyle.h:

Change the default min-size back to 0.

Source/WebKit2: Crash when "willSendRequest" causes the ResourceLoader to be cancelled.
<rdar://problem/13531679> and https://bugs.webkit.org/show_bug.cgi?id=113616

Patch by Brady Eidson <beidson@apple.com> on 2013-03-29
Reviewed by Alexey Proskuryakov.

These callbacks to the WebCore ResourceLoader can cause the WebResourceLoader to be destroyed.
A RefPtr<> protector fixes that.

Additionally we can invalidate the WebResourceLoader to avoid unnecessary callbacks to the NetworkProcess.

  • WebProcess/Network/WebResourceLoadScheduler.cpp:

(WebKit::WebResourceLoadScheduler::remove): Call detachFromCoreLoader() on a removed WebResourceLoader.

  • WebProcess/Network/WebResourceLoader.cpp:

(WebKit::WebResourceLoader::detachFromCoreLoader): Clear out the ResourceLoader pointer.
(WebKit::WebResourceLoader::willSendRequest): Protect this, and don't message back to the NetworkProcess if its not needed.
(WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace): Ditto
(WebKit::WebResourceLoader::didReceiveResource): Paranoid hardening - Protect this before delivering the data to the WebCore

ResourceLoader, and null check it before delivering the "didFinishLoader" call.

  • WebProcess/Network/WebResourceLoader.h:

LayoutTests: Flexitems no longer default min-width to min-content
https://bugs.webkit.org/show_bug.cgi?id=111790

Reviewed by Tony Chang.

  • css3/flexbox/content-height-with-scrollbars.html:
  • css3/flexbox/cross-axis-scrollbar.html:

Set flex:none to avoid flex-shrinking.

  • css3/flexbox/flex-item-min-size-expected.txt: Removed.
  • css3/flexbox/flex-item-min-size.html: Removed.

These tests are now redundant with tests in fast/css-intrinsic-dimensions.

  • css3/flexbox/flexbox-baseline.html:

Set flex:none to avoid flex-shrinking.

  • css3/flexbox/line-wrapping.html:

Auto-size the flex items so that the column flexboxes have an auto-height.

  • css3/flexbox/preferred-widths.html:

Set flex:none to avoid flex-shrinking.

  • fast/css/auto-min-size-expected.txt:
  • fast/css/auto-min-size.html:

Update to no longer allow parsing auto as a valid value for min-width/min-height.

Location:
trunk
Files:
2 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147255 r147261  
     12013-03-29  Ojan Vafai  <ojan@chromium.org>
     2
     3        Flexitems no longer default min-width to min-content
     4        https://bugs.webkit.org/show_bug.cgi?id=111790
     5
     6        Reviewed by Tony Chang.
     7
     8        * css3/flexbox/content-height-with-scrollbars.html:
     9        * css3/flexbox/cross-axis-scrollbar.html:
     10        Set flex:none to avoid flex-shrinking.
     11
     12        * css3/flexbox/flex-item-min-size-expected.txt: Removed.
     13        * css3/flexbox/flex-item-min-size.html: Removed.
     14        These tests are now redundant with tests in fast/css-intrinsic-dimensions.
     15
     16        * css3/flexbox/flexbox-baseline.html:
     17        Set flex:none to avoid flex-shrinking.
     18
     19        * css3/flexbox/line-wrapping.html:
     20        Auto-size the flex items so that the column flexboxes have an auto-height.
     21
     22        * css3/flexbox/preferred-widths.html:
     23        Set flex:none to avoid flex-shrinking.
     24
     25        * fast/css/auto-min-size-expected.txt:
     26        * fast/css/auto-min-size.html:
     27        Update to no longer allow parsing auto as a valid value for min-width/min-height.
     28
     292013-03-29  Aaron Colwell  <acolwell@chromium.org>
     30
     31        Add LayoutTests that verify MediaSource.duration behavior.
     32        https://bugs.webkit.org/show_bug.cgi?id=113438
     33
     34        Reviewed by Eric Carlson.
     35
     36        * http/tests/media/media-source/video-media-source-duration-boundaryconditions-expected.txt: Added.
     37        * http/tests/media/media-source/video-media-source-duration-boundaryconditions.html: Added.
     38        * http/tests/media/media-source/video-media-source-duration-expected.txt: Added.
     39        * http/tests/media/media-source/video-media-source-duration.html: Added.
     40
     412013-03-29  Joshua Bell  <jsbell@chromium.org>
     42
     43        [Chromium] IndexedDB: Update terminated worker connection test
     44        https://bugs.webkit.org/show_bug.cgi?id=113608
     45
     46        Reviewed by Tony Chang.
     47
     48        Update layout test only run under Chromium's content_shell that ensures that
     49        worker termination does not result in stuck connections. The test was using
     50        the obsolete setVersion() API.
     51
     52        * storage/indexeddb/pending-version-change-stuck-works-with-terminate-expected.txt:
     53        * storage/indexeddb/pending-version-change-stuck-works-with-terminate.html:
     54        * storage/indexeddb/resources/pending-version-change-stuck.js:
     55        (test.request.onblocked):
     56        (test):
     57
    1582013-03-29  Aaron Colwell  <acolwell@chromium.org>
    259
  • trunk/LayoutTests/css3/flexbox/content-height-with-scrollbars.html

    r130457 r147261  
    77    height: 100px;
    88    overflow: scroll;
     9}
     10.flexbox > div {
     11    -webkit-flex: none;
     12    flex: none;
    913}
    1014.flexbox > :nth-child(1) {
  • trunk/LayoutTests/css3/flexbox/cross-axis-scrollbar.html

    r130457 r147261  
    2121
    2222.column > div {
     23    -webkit-flex: none;
     24    flex: none;
    2325    background-color: green;
    2426    width: 100px;
     
    2931    background-color: green;
    3032    -webkit-flex: 1;
    31     -moz-flex: 1;
     33    flex: 1;
    3234    height: 50px;
    3335    min-height: 0;
     
    3537
    3638.vertical-lr > .column > div {
     39    -webkit-flex: none;
     40    flex: none;
    3741    height: 50px;
    3842    width: 20px;
     
    4145.vertical-lr > .row > div {
    4246    -webkit-flex: 1;
    43     -moz-flex: 1;
     47    flex: 1;
    4448    width: 100px;
    4549}
  • trunk/LayoutTests/css3/flexbox/line-wrapping.html

    r130979 r147261  
    4848
    4949.horizontal-tb.column > div {
    50     -webkit-flex: 1;
     50    -webkit-flex: 1 auto;
    5151}
    5252.vertical-lr.column > div, .vertical-rl.column > div {
    53     -webkit-flex: 1;
     53    -webkit-flex: 1 auto;
    5454}
    5555
  • trunk/LayoutTests/css3/flexbox/preferred-widths.html

    r130979 r147261  
    1010    padding: 2px 13px 8px 17px;
    1111    margin: 2px 13px 8px 17px;
     12    -webkit-flex: none;
     13    flex: none;
    1214}
    1315.title {
  • trunk/LayoutTests/fast/css/auto-min-size-expected.txt

    r122264 r147261  
    11PASS div.style.minWidth is ""
    22PASS getComputedStyle(div)["min-width"] is "0px"
     3PASS div.style.minWidth is ""
     4PASS div.style.maxWidth is ""
     5PASS getComputedStyle(div).minWidth is "0px"
    36PASS div.style.minWidth is "0px"
    47PASS getComputedStyle(div)["min-width"] is "0px"
    5 PASS div.style.minWidth is "auto"
    6 PASS div.style.maxWidth is ""
    7 PASS getComputedStyle(div).minWidth is "0px"
    88PASS div.style.minHeight is ""
    99PASS getComputedStyle(div)["min-height"] is "0px"
     10PASS div.style.minHeight is ""
     11PASS div.style.maxHeight is ""
     12PASS getComputedStyle(div).minHeight is "0px"
    1013PASS div.style.minHeight is "0px"
    1114PASS getComputedStyle(div)["min-height"] is "0px"
    12 PASS div.style.minHeight is "auto"
    13 PASS div.style.maxHeight is ""
    14 PASS getComputedStyle(div).minHeight is "0px"
    1515PASS successfullyParsed is true
    1616
  • trunk/LayoutTests/fast/css/auto-min-size.html

    r122264 r147261  
    77shouldBe('getComputedStyle(div)["min-width"]', '"0px"');
    88
     9div.style.minWidth = 'auto';
     10div.style.maxWidth = 'auto';
     11shouldBe('div.style.minWidth', '""');
     12shouldBe('div.style.maxWidth', '""');
     13shouldBe('getComputedStyle(div).minWidth', '"0px"');
     14
    915div.style.minWidth = 0;
    1016shouldBe('div.style.minWidth', '"0px"');
    1117shouldBe('getComputedStyle(div)["min-width"]', '"0px"');
    1218
    13 div.style.minWidth = 'auto';
    14 div.style.maxWidth = 'auto';
    15 shouldBe('div.style.minWidth', '"auto"');
    16 shouldBe('div.style.maxWidth', '""');
    17 shouldBe('getComputedStyle(div).minWidth', '"0px"');
    18 
    1919shouldBe('div.style.minHeight', '""');
    2020shouldBe('getComputedStyle(div)["min-height"]', '"0px"');
     21
     22div.style.minHeight = 'auto';
     23div.style.maxHeight = 'auto';
     24shouldBe('div.style.minHeight', '""');
     25shouldBe('div.style.maxHeight', '""');
     26shouldBe('getComputedStyle(div).minHeight', '"0px"');
    2127
    2228div.style.minHeight = 0;
     
    2430shouldBe('getComputedStyle(div)["min-height"]', '"0px"');
    2531
    26 div.style.minHeight = 'auto';
    27 div.style.maxHeight = 'auto';
    28 shouldBe('div.style.minHeight', '"auto"');
    29 shouldBe('div.style.maxHeight', '""');
    30 shouldBe('getComputedStyle(div).minHeight', '"0px"');
    3132</script>
    3233<script src='../js/resources/js-test-post.js'></script>
  • trunk/Source/WebCore/ChangeLog

    r147260 r147261  
     12013-03-29  Ojan Vafai  <ojan@chromium.org>
     2
     3        Flexitems no longer default min-width to min-content
     4        https://bugs.webkit.org/show_bug.cgi?id=111790
     5
     6        Reviewed by Tony Chang.
     7
     8        * css/CSSParser.cpp:
     9        (WebCore::CSSParser::parseValue):
     10        Disallow auto as a valid min-size value.
     11
     12        * css/html.css:
     13        (input::-webkit-datetime-edit):
     14        (input[type="range"]::-webkit-slider-container, input[type="range"]::-webkit-media-slider-container):
     15        (input[type="range"]::-webkit-slider-runnable-track):
     16        Remove now unnecessary min-width: 0's.
     17
     18        * css/mediaControlsChromium.css:
     19        (audio::-webkit-media-controls-enclosure, video::-webkit-media-controls-enclosure):
     20        (video::-webkit-media-controls-enclosure):
     21        Set a flex-shrink: 0 to avoid shrinking these items below the designated height.
     22
     23        * rendering/RenderBox.cpp:
     24        (WebCore::RenderBox::constrainLogicalHeightByMinMax):
     25        (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
     26        (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
     27        (WebCore::RenderBox::computeLogicalHeight):
     28        (WebCore::RenderBox::computeLogicalHeightUsing):
     29        (WebCore::RenderBox::computeContentLogicalHeight):
     30        (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
     31        (WebCore::RenderBox::computeReplacedLogicalWidth):
     32        (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
     33        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
     34        (WebCore::RenderBox::computeReplacedLogicalHeight):
     35        (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
     36        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
     37        (WebCore::RenderBox::availableLogicalHeightUsing):
     38        (WebCore::RenderBox::computePositionedLogicalWidth):
     39        (WebCore::RenderBox::computePositionedLogicalWidthUsing):
     40        (WebCore::RenderBox::computePositionedLogicalHeight):
     41        (WebCore::RenderBox::computePositionedLogicalHeightUsing):
     42        Remove all the unneeded SizeType arguments now that we don't need to
     43        specially handle MinSize in all these functions.
     44
     45        * rendering/RenderBox.h:
     46        * rendering/RenderButton.cpp:
     47        (WebCore::RenderButton::styleWillChange):
     48        (WebCore::RenderButton::setupInnerStyle):
     49        No longer need to explicitly set min-width:0.
     50
     51        * rendering/RenderFlexibleBox.cpp:
     52        (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
     53        (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
     54        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
     55        Remove the code for specially handling auto.
     56
     57        * rendering/RenderGrid.cpp:
     58        (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
     59        * rendering/RenderRegion.cpp:
     60        (WebCore::RenderRegion::maxPageLogicalHeight):
     61        * rendering/RenderReplaced.cpp:
     62        (WebCore::RenderReplaced::computeReplacedLogicalWidth):
     63        (WebCore::RenderReplaced::computeReplacedLogicalHeight):
     64        Remove all the now unneeded SizeType arguments.
     65
     66        * rendering/style/RenderStyle.h:
     67        Change the default min-size back to 0.
     68
    1692013-03-29  Alexey Proskuryakov  <ap@apple.com>
    270
  • trunk/Source/WebCore/css/CSSParser.cpp

    r147034 r147261  
    22152215    case CSSPropertyMinWidth:
    22162216    case CSSPropertyWebkitMinLogicalWidth:
     2217        validPrimitive = validWidth(value);
     2218        break;
     2219
    22172220    case CSSPropertyWidth:
    22182221    case CSSPropertyWebkitLogicalWidth:
     
    22272230    case CSSPropertyMinHeight:
    22282231    case CSSPropertyWebkitMinLogicalHeight:
     2232        validPrimitive = validHeight(value);
     2233        break;
     2234
    22292235    case CSSPropertyHeight:
    22302236    case CSSPropertyWebkitLogicalHeight:
  • trunk/Source/WebCore/css/html.css

    r146847 r147261  
    565565    -webkit-user-modify: read-only !important;
    566566    display: inline-block;
    567     min-width: 0;
    568567    overflow: hidden;
    569568}
     
    830829input[type="range"]::-webkit-slider-container, input[type="range"]::-webkit-media-slider-container {
    831830    -webkit-flex: 1;
    832     min-width: 0;
    833 
    834831    box-sizing: border-box;
    835832    -webkit-user-modify: read-only !important;
     
    840837input[type="range"]::-webkit-slider-runnable-track {
    841838    -webkit-flex: 1;
    842     min-width: 0;
    843839    -webkit-align-self: center;
    844840
  • trunk/Source/WebCore/css/mediaControlsChromium.css

    r146992 r147261  
    5656    max-width: 800px;
    5757    height: 30px;
     58    -webkit-flex-shrink: 0;
    5859    bottom: 0;
    5960    text-indent: 0;
     
    6566    padding: 0px 5px 5px 5px;
    6667    height: 35px;
     68    -webkit-flex-shrink: 0;
    6769}
    6870
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r147127 r147261  
    512512    RenderStyle* styleToUse = style();
    513513    if (!styleToUse->logicalMaxHeight().isUndefined()) {
    514         LayoutUnit maxH = computeLogicalHeightUsing(MaxSize, styleToUse->logicalMaxHeight());
     514        LayoutUnit maxH = computeLogicalHeightUsing(styleToUse->logicalMaxHeight());
    515515        if (maxH != -1)
    516516            logicalHeight = min(logicalHeight, maxH);
    517517    }
    518     return max(logicalHeight, computeLogicalHeightUsing(MinSize, styleToUse->logicalMinHeight()));
     518    return max(logicalHeight, computeLogicalHeightUsing(styleToUse->logicalMinHeight()));
    519519}
    520520
     
    523523    RenderStyle* styleToUse = style();
    524524    if (!styleToUse->logicalMaxHeight().isUndefined()) {
    525         LayoutUnit maxH = computeContentLogicalHeight(MaxSize, styleToUse->logicalMaxHeight());
     525        LayoutUnit maxH = computeContentLogicalHeight(styleToUse->logicalMaxHeight());
    526526        if (maxH != -1)
    527527            logicalHeight = min(logicalHeight, maxH);
    528528    }
    529     return max(logicalHeight, computeContentLogicalHeight(MinSize, styleToUse->logicalMinHeight()));
     529    return max(logicalHeight, computeContentLogicalHeight(styleToUse->logicalMinHeight()));
    530530}
    531531
     
    22022202    const RenderBlock* cb, RenderRegion* region, LayoutUnit offsetFromLogicalTopOfFirstPage) const
    22032203{
    2204     if (widthType == MinSize && logicalWidth.isAuto())
    2205         return adjustBorderBoxLogicalWidthForBoxSizing(0);
    2206    
    22072204    if (!logicalWidth.isIntrinsicOrAuto()) {
    22082205        // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead.
     
    25142511        LayoutUnit heightResult;
    25152512        if (checkMinMaxHeight) {
    2516             heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight());
     2513            heightResult = computeLogicalHeightUsing(style()->logicalHeight());
    25172514            if (heightResult == -1)
    25182515                heightResult = computedValues.m_extent;
     
    25612558}
    25622559
    2563 LayoutUnit RenderBox::computeLogicalHeightUsing(SizeType heightType, const Length& height) const
    2564 {
    2565     LayoutUnit logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heightType, height);
     2560LayoutUnit RenderBox::computeLogicalHeightUsing(const Length& height) const
     2561{
     2562    LayoutUnit logicalHeight = computeContentAndScrollbarLogicalHeightUsing(height);
    25662563    if (logicalHeight != -1)
    25672564        logicalHeight = adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight);
     
    25692566}
    25702567
    2571 LayoutUnit RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height) const
    2572 {
    2573     LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(heightType, height);
     2568LayoutUnit RenderBox::computeContentLogicalHeight(const Length& height) const
     2569{
     2570    LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(height);
    25742571    if (heightIncludingScrollbar == -1)
    25752572        return -1;
     
    25772574}
    25782575
    2579 LayoutUnit RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height) const
    2580 {
    2581     if (height.isAuto())
    2582         return heightType == MinSize ? 0 : -1;
     2576LayoutUnit RenderBox::computeContentAndScrollbarLogicalHeightUsing(const Length& height) const
     2577{
    25832578    if (height.isFixed())
    25842579        return height.value();
     
    26942689LayoutUnit RenderBox::computeReplacedLogicalWidth(ShouldComputePreferred shouldComputePreferred) const
    26952690{
    2696     return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(MainOrPreferredSize, style()->logicalWidth()), shouldComputePreferred);
     2691    return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style()->logicalWidth()), shouldComputePreferred);
    26972692}
    26982693
    26992694LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred shouldComputePreferred) const
    27002695{
    2701     LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMinWidth().isPercent()) || style()->logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(MinSize, style()->logicalMinWidth());
    2702     LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMaxWidth().isPercent()) || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(MaxSize, style()->logicalMaxWidth());
     2696    LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMinWidth().isPercent()) || style()->logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMinWidth());
     2697    LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMaxWidth().isPercent()) || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth());
    27032698    return max(minLogicalWidth, min(logicalWidth, maxLogicalWidth));
    27042699}
    27052700
    2706 LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(SizeType sizeType, Length logicalWidth) const
    2707 {
    2708     if (sizeType == MinSize && logicalWidth.isAuto())
    2709         return adjustContentBoxLogicalWidthForBoxSizing(0);
    2710 
     2701LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(Length logicalWidth) const
     2702{
    27112703    switch (logicalWidth.type()) {
    27122704        case Fixed:
     
    27542746LayoutUnit RenderBox::computeReplacedLogicalHeight() const
    27552747{
    2756     return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight()));
     2748    return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style()->logicalHeight()));
    27572749}
    27582750
    27592751LayoutUnit RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const
    27602752{
    2761     LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(MinSize, style()->logicalMinHeight());
    2762     LayoutUnit maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(MaxSize, style()->logicalMaxHeight());
     2753    LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMinHeight());
     2754    LayoutUnit maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight());
    27632755    return max(minLogicalHeight, min(logicalHeight, maxLogicalHeight));
    27642756}
    27652757
    2766 LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType sizeType, Length logicalHeight) const
    2767 {
    2768     if (sizeType == MinSize && logicalHeight.isAuto())
    2769         return adjustContentBoxLogicalHeightForBoxSizing(0);
    2770 
     2758LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) const
     2759{
    27712760    switch (logicalHeight.type()) {
    27722761        case Fixed:
     
    28542843    }
    28552844
    2856     LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(MainOrPreferredSize, h);
     2845    LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(h);
    28572846    if (heightIncludingScrollbar != -1)
    28582847        return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight());
     
    31263115   
    31273116    // Calculate constraint equation values for 'width' case.
    3128     computePositionedLogicalWidthUsing(MainOrPreferredSize, style()->logicalWidth(), containerBlock, containerDirection,
     3117    computePositionedLogicalWidthUsing(style()->logicalWidth(), containerBlock, containerDirection,
    31293118                                       containerLogicalWidth, bordersPlusPadding,
    31303119                                       logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    31353124        LogicalExtentComputedValues maxValues;
    31363125
    3137         computePositionedLogicalWidthUsing(MaxSize, style()->logicalMaxWidth(), containerBlock, containerDirection,
     3126        computePositionedLogicalWidthUsing(style()->logicalMaxWidth(), containerBlock, containerDirection,
    31383127                                           containerLogicalWidth, bordersPlusPadding,
    31393128                                           logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    31523141        LogicalExtentComputedValues minValues;
    31533142
    3154         computePositionedLogicalWidthUsing(MinSize, style()->logicalMinWidth(), containerBlock, containerDirection,
     3143        computePositionedLogicalWidthUsing(style()->logicalMinWidth(), containerBlock, containerDirection,
    31553144                                           containerLogicalWidth, bordersPlusPadding,
    31563145                                           logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
     
    31983187}
    31993188
    3200 void RenderBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
     3189void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
    32013190                                                   LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
    32023191                                                   Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
    32033192                                                   LogicalExtentComputedValues& computedValues) const
    32043193{
    3205     if (widthSizeType == MinSize && logicalWidth.isAuto())
    3206         logicalWidth = Length(0, Fixed);
    3207     else if (logicalWidth.isIntrinsic())
     3194    if (logicalWidth.isIntrinsic())
    32083195        logicalWidth = Length(computeIntrinsicLogicalWidthUsing(logicalWidth, containerLogicalWidth, bordersPlusPadding) - bordersPlusPadding, Fixed);
    32093196
     
    34463433    // Calculate constraint equation values for 'height' case.
    34473434    LayoutUnit logicalHeight = computedValues.m_extent;
    3448     computePositionedLogicalHeightUsing(MainOrPreferredSize, styleToUse->logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
     3435    computePositionedLogicalHeightUsing(styleToUse->logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
    34493436                                        logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    34503437                                        computedValues);
     
    34573444        LogicalExtentComputedValues maxValues;
    34583445
    3459         computePositionedLogicalHeightUsing(MaxSize, styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
     3446        computePositionedLogicalHeightUsing(styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
    34603447                                            logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    34613448                                            maxValues);
     
    34733460        LogicalExtentComputedValues minValues;
    34743461
    3475         computePositionedLogicalHeightUsing(MinSize, styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
     3462        computePositionedLogicalHeightUsing(styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight,
    34763463                                            logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
    34773464                                            minValues);
     
    35303517}
    35313518
    3532 void RenderBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
     3519void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
    35333520                                                    LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight,
    35343521                                                    Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter,
    35353522                                                    LogicalExtentComputedValues& computedValues) const
    35363523{
    3537     if (heightSizeType == MinSize && logicalHeightLength.isAuto())
    3538         logicalHeightLength = Length(0, Fixed);
    3539 
    35403524    // 'top' and 'bottom' cannot both be 'auto' because 'top would of been
    35413525    // converted to the static position in computePositionedLogicalHeight()
  • trunk/Source/WebCore/rendering/RenderBox.h

    r146955 r147261  
    412412    LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlock* cb, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
    413413
    414     LayoutUnit computeLogicalWidthInRegionUsing(SizeType, Length, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
    415     LayoutUnit computeLogicalHeightUsing(SizeType, const Length& height) const;
    416     LayoutUnit computeContentLogicalHeight(SizeType, const Length& height) const;
    417     LayoutUnit computeContentAndScrollbarLogicalHeightUsing(SizeType, const Length& height) const;
    418     LayoutUnit computeReplacedLogicalWidthUsing(SizeType, Length width) const;
     414    LayoutUnit computeLogicalWidthInRegionUsing(SizeType, Length logicalWidth, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
     415    LayoutUnit computeLogicalHeightUsing(const Length& height) const;
     416    LayoutUnit computeContentLogicalHeight(const Length& height) const;
     417    LayoutUnit computeContentAndScrollbarLogicalHeightUsing(const Length& height) const;
     418    LayoutUnit computeReplacedLogicalWidthUsing(Length width) const;
    419419    LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred  = ComputeActual) const;
    420     LayoutUnit computeReplacedLogicalHeightUsing(SizeType, Length height) const;
     420    LayoutUnit computeReplacedLogicalHeightUsing(Length height) const;
    421421    LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const;
    422422
     
    648648
    649649    void computePositionedLogicalHeight(LogicalExtentComputedValues&) const;
    650     void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
     650    void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
    651651                                            LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
    652652                                            Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
    653653                                            LogicalExtentComputedValues&) const;
    654     void computePositionedLogicalHeightUsing(SizeType, Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
     654    void computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
    655655                                             LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight,
    656656                                             Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom,
  • trunk/Source/WebCore/rendering/RenderButton.cpp

    r143643 r147261  
    8181        // FIXME: Make this hack unnecessary.
    8282        m_inner->style()->setFlexGrow(newStyle->initialFlexGrow());
    83         m_inner->style()->setMinWidth(newStyle->initialMinSize());
    8483        m_inner->style()->setMarginTop(newStyle->initialMargin());
    8584        m_inner->style()->setMarginBottom(newStyle->initialMargin());
     
    114113    // safe to modify.
    115114    innerStyle->setFlexGrow(1.0f);
    116     // min-width: 0; is needed for correct shrinking.
    117     // FIXME: If and when the spec changes to not require this, we should
    118     // remove this line and the corresponding line in styleWillChange.
    119     // See: http://lists.w3.org/Archives/Public/www-style/2013Feb/0364.html
    120     innerStyle->setMinWidth(Length(0, Fixed));
    121115    // Use margin:auto instead of align-items:center to get safe centering, i.e.
    122116    // when the content overflows, treat it the same as align-items: flex-start.
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r146684 r147261  
    535535    // FIXME: This is wrong for orthogonal flows. It should use the flexbox's writing-mode, not the child's in order
    536536    // to figure out the logical height/width.
     537    // FIXME: This is wrong if the height is set to an intrinsic keyword value. computeContentLogicalHeight will return -1.
     538    // Instead, we need to layout the child an get the appropriate height value.
     539    // https://bugs.webkit.org/show_bug.cgi?id=113610
    537540    if (isColumnFlow())
    538         return child->computeContentLogicalHeight(sizeType, size);
    539     if (size.isAuto())
    540         return -1;
     541        return child->computeContentLogicalHeight(size);
    541542    // FIXME: Figure out how this should work for regions and pass in the appropriate values.
    542543    LayoutUnit offsetFromLogicalTopOfFirstPage = 0;
     
    907908
    908909        // Only need to layout here if we will need to get the logicalHeight of the child in computeNextFlexLine.
    909         Length childMainAxisMin = isHorizontalFlow() ? child->style()->minWidth() : child->style()->minHeight();
    910         if (hasOrthogonalFlow(child) && (flexBasisForChild(child).isAuto() || childMainAxisMin.isAuto())) {
     910        if (hasOrthogonalFlow(child) && flexBasisForChild(child).isAuto()) {
    911911            child->setChildNeedsLayout(true, MarkOnlyThis);
    912912            child->layout();
     
    938938    if (min.isSpecifiedOrIntrinsic())
    939939        minExtent = computeMainAxisExtentForChild(child, MinSize, min);
    940     else if (min.isAuto()) {
    941         if (hasOrthogonalFlow(child))
    942             minExtent = child->logicalHeight() - child->borderAndPaddingLogicalHeight();
    943         else
    944             minExtent = computeMainAxisExtentForChild(child, MinSize, Length(MinContent));
    945     }
    946940    return std::max(childSize, minExtent);
    947941}
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r147140 r147261  
    318318    // FIXME: We still need to support calc() here (https://webkit.org/b/103761).
    319319    ASSERT(trackLength.isFixed() || trackLength.isPercent() || trackLength.isViewportPercentage());
    320     return valueForLength(trackLength, direction == ForColumns ? logicalWidth() : computeContentLogicalHeight(MainOrPreferredSize, style()->logicalHeight()), view());
     320    return valueForLength(trackLength, direction == ForColumns ? logicalWidth() : computeContentLogicalHeight(style()->logicalHeight()), view());
    321321}
    322322
  • trunk/Source/WebCore/rendering/RenderRegion.cpp

    r147082 r147261  
    7575{
    7676    ASSERT(hasAutoLogicalHeight() && view()->normalLayoutPhase());
    77     return style()->logicalMaxHeight().isUndefined() ? LayoutUnit::max() / 2 : computeReplacedLogicalHeightUsing(MaxSize, style()->logicalMaxHeight());
     77    return style()->logicalMaxHeight().isUndefined() ? LayoutUnit::max() / 2 : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight());
    7878}
    7979
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r146279 r147261  
    322322{
    323323    if (style()->logicalWidth().isSpecified() || style()->logicalWidth().isIntrinsic())
    324         return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(MainOrPreferredSize, style()->logicalWidth()), shouldComputePreferred);
     324        return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogicalWidthUsing(style()->logicalWidth()), shouldComputePreferred);
    325325
    326326    RenderBox* contentRenderer = embeddedContentBox();
     
    358358                LayoutUnit logicalWidth;
    359359                if (RenderBlock* blockWithWidth = firstContainingBlockWithLogicalWidth(this))
    360                     logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(MainOrPreferredSize, blockWithWidth->style()->logicalWidth()), shouldComputePreferred);
     360                    logicalWidth = blockWithWidth->computeReplacedLogicalWidthRespectingMinMaxWidth(blockWithWidth->computeReplacedLogicalWidthUsing(blockWithWidth->style()->logicalWidth()), shouldComputePreferred);
    361361                else
    362362                    logicalWidth = containingBlock()->availableLogicalWidth();
     
    390390    // 10.5 Content height: the 'height' property: http://www.w3.org/TR/CSS21/visudet.html#propdef-height
    391391    if (hasReplacedLogicalHeight())
    392         return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight()));
     392        return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style()->logicalHeight()));
    393393
    394394    RenderBox* contentRenderer = embeddedContentBox();
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r146408 r147261  
    16121612    static int initialLetterWordSpacing() { return 0; }
    16131613    static Length initialSize() { return Length(); }
    1614     static Length initialMinSize() { return Length(); }
     1614    static Length initialMinSize() { return Length(Fixed); }
    16151615    static Length initialMaxSize() { return Length(Undefined); }
    16161616    static Length initialOffset() { return Length(); }
  • trunk/Source/WebKit2/ChangeLog

    r147260 r147261  
     12013-03-29  Brady Eidson  <beidson@apple.com>
     2
     3        Crash when "willSendRequest" causes the ResourceLoader to be cancelled.
     4        <rdar://problem/13531679> and https://bugs.webkit.org/show_bug.cgi?id=113616
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        These callbacks to the WebCore ResourceLoader can cause the WebResourceLoader to be destroyed.
     9        A RefPtr<> protector fixes that.
     10
     11        Additionally we can invalidate the WebResourceLoader to avoid unnecessary callbacks to the NetworkProcess.
     12
     13        * WebProcess/Network/WebResourceLoadScheduler.cpp:
     14        (WebKit::WebResourceLoadScheduler::remove): Call detachFromCoreLoader() on a removed WebResourceLoader.
     15
     16        * WebProcess/Network/WebResourceLoader.cpp:
     17        (WebKit::WebResourceLoader::detachFromCoreLoader): Clear out the ResourceLoader pointer.
     18        (WebKit::WebResourceLoader::willSendRequest): Protect this, and don't message back to the NetworkProcess if its not needed.
     19        (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace): Ditto
     20        (WebKit::WebResourceLoader::didReceiveResource): Paranoid hardening - Protect this before delivering the data to the WebCore
     21          ResourceLoader, and null check it before delivering the "didFinishLoader" call.
     22        * WebProcess/Network/WebResourceLoader.h:
     23
     242013-03-29  Brady Eidson  <beidson@apple.com>
     25
     26        Should never send events to plugins waiting on asynchronous initialization.
     27        <rdar://problem/13538945> and https://bugs.webkit.org/show_bug.cgi?id=113612
     28
     29        Reviewed by Anders Carlsson.
     30
     31        Sending mouse and keyboard events to a plugin in the middle of asynchronous initialization is silly.
     32
     33        A quick audit of the sendSync() messages in PluginProxy suggests the following 8 can just have an early return:
     34
     35        * WebProcess/Plugins/PluginProxy.cpp:
     36        (WebKit::PluginProxy::handleMouseEvent):
     37        (WebKit::PluginProxy::handleWheelEvent):
     38        (WebKit::PluginProxy::handleMouseEnterEvent):
     39        (WebKit::PluginProxy::handleMouseLeaveEvent):
     40        (WebKit::PluginProxy::handleKeyboardEvent):
     41        (WebKit::PluginProxy::handleEditingCommand):
     42        (WebKit::PluginProxy::isEditingCommandEnabled):
     43        (WebKit::PluginProxy::handlesPageScaleFactor):
     44
     452013-03-29  Brady Eidson  <beidson@apple.com>
     46
     47        Should never send events to plugins waiting on asynchronous initialization.
     48        <rdar://problem/13538945> and https://bugs.webkit.org/show_bug.cgi?id=113612
     49
     50        Reviewed by Anders Carlsson.
     51
     52        Sending mouse and keyboard events to a plugin in the middle of asynchronous initialization is silly.
     53
     54        A quick audit of the sendSync() messages in PluginProxy suggests the following 8 can just have an early return:
     55
     56        * WebProcess/Plugins/PluginProxy.cpp:
     57        (WebKit::PluginProxy::handleMouseEvent):
     58        (WebKit::PluginProxy::handleWheelEvent):
     59        (WebKit::PluginProxy::handleMouseEnterEvent):
     60        (WebKit::PluginProxy::handleMouseLeaveEvent):
     61        (WebKit::PluginProxy::handleKeyboardEvent):
     62        (WebKit::PluginProxy::handleEditingCommand):
     63        (WebKit::PluginProxy::isEditingCommandEnabled):
     64        (WebKit::PluginProxy::handlesPageScaleFactor):
     65
    1662013-03-29  Alexey Proskuryakov  <ap@apple.com>
    267
Note: See TracChangeset for help on using the changeset viewer.