https://github.com/web-platform-tests/wpt
Revision 2eafc77a24f2d1b635a2c1c442056455e4b273e4 authored by Morten Stenshorne on 14 March 2018, 06:40:47 UTC, committed by Chromium WPT Sync on 14 March 2018, 06:40:47 UTC
We cannot use the content size (intrinsic block size) as min-height or
max-height (min-width or max-width, if writing mode is vertical).
Doing so would cause min-height to incorrectly override any specified
height or max-height that is less than the intrinsic block size, and
max-height to override any specified height that's greater than the
intrinsic block size. Do what the spec says [1] instead: max-height
to become 'none', and min-height to become 0.

This fixes the final rendering problem with Acid2 (this was about the
min-height issue). It now renders correctly with LayoutNG!

Since no other tests than Acid2 started to pass with this change, I wrote
a couple.

[1] https://www.w3.org/TR/CSS22/visudet.html#min-max-heights

     XXXXXX
   XX      XX
  X          X
 X   O    O   X
 X            X
X      /\      X
X      \/      X
X              X
 X X        X X
 X  XXXXXXXX  X
  X          X
   XX      XX
     XXXXXX

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ic4f2c3c1dbc2bd66956ed4b270b08058999bc351
Reviewed-on: https://chromium-review.googlesource.com/960085
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Aleks Totic <atotic@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543018}
1 parent 07b4a27
Raw File
Tip revision: 2eafc77a24f2d1b635a2c1c442056455e4b273e4 authored by Morten Stenshorne on 14 March 2018, 06:40:47 UTC
[LayoutNG] Don't resolve unresolvable percentage min-height and max-height.
Tip revision: 2eafc77
storagemanager-estimate.https.html
<!DOCTYPE html>
<meta charset=utf-8>
<title>StorageManager: estimate()</title>
<meta name="help" href="https://storage.spec.whatwg.org/#dom-storagemanager-estimate">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

test(function(t) {
    assert_true(navigator.storage.estimate() instanceof Promise);
}, 'estimate() method returns a Promise');

promise_test(function(t) {
    return navigator.storage.estimate().then(function(result) {
        assert_true(typeof result === 'object');
        assert_true('usage' in result);
        assert_equals(typeof result.usage, 'number');
        assert_true('quota' in result);
        assert_equals(typeof result.quota, 'number');
    });
}, 'estimate() resolves to dictionary with members');

promise_test(function(t) {
    const large_value = new Uint8Array(1e6);
    const dbname = `db-${location}-${t.name}`;
    let db, before, after;

    indexedDB.deleteDatabase(dbname);
    return new Promise((resolve, reject) => {
            const open = indexedDB.open(dbname);
            open.onerror = () => { reject(open.error); };
            open.onupgradeneeded = () => {
                const connection = open.result;
                connection.createObjectStore('store');
            };
            open.onsuccess = () => {
                const connection = open.result;
                t.add_cleanup(() => {
                    connection.close();
                    indexedDB.deleteDatabase(dbname);
                });
                resolve(connection);
            };
        })
        .then(connection => {
            db = connection;
            return navigator.storage.estimate();
        })
        .then(estimate => {
            before = estimate.usage;
            return new Promise((resolve, reject) => {
                const tx = db.transaction('store', 'readwrite');
                tx.objectStore('store').put(large_value, 'key');
                tx.onabort = () => { reject(tx.error); };
                tx.oncomplete = () => { resolve(); };
            });
        })
        .then(() => {
            return navigator.storage.estimate();
        })
        .then(estimate => {
            after = estimate.usage;
            assert_greater_than(after, before,
                                'estimated usage should increase');
        });
}, 'estimate() shows usage increase after 1MB IndexedDB record is stored');

</script>
back to top