Ojan Vafai fc1dff4288 Expose minContentWidth/maxContentWidth and a callback for computing them.
This exposes the last hooks needed to implement flexbox layout. For now,
I didn't worry too much about the exact API we're exposing since this will
all change with the upcoming redesign (e.g. https://codereview.chromium.org/1093633002).

minContentWidth == the width if the element were to wrap at every wrapping point (not including border/padding)

maxContentWidth == the width if the element were to only wrap at hard wrapping points (e.g. \n inside a whitespace: pre).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1101793003
2015-04-24 13:14:41 -07:00

54 lines
1.8 KiB
Plaintext

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
CustomConstructor,
] interface Element : ParentNode {
readonly attribute DOMString tagName;
boolean hasAttribute(DOMString name);
[TreatReturnedNullStringAs=Null] DOMString getAttribute(DOMString name);
[CustomElementCallbacks, RaisesException] void setAttribute(DOMString name, optional DOMString? value);
[CustomElementCallbacks] void removeAttribute(DOMString name);
sequence<Attr> getAttributes();
readonly attribute ShadowRoot shadowRoot;
void requestPaint(PaintingCallback callback);
void setNeedsLayout();
void layout();
void setLayoutManager(LayoutCallback layout, LayoutCallback computeIntrinsicWidths);
// TODO(abarth): Move to Node.
readonly attribute CSSStyleDeclaration style;
// TODO(abarth): Remove these when we implement more of the system.
[RaisesException] boolean matches(DOMString selectors);
void focus();
void blur();
attribute long tabIndex;
readonly attribute DOMTokenList classList;
[RaisesException] ShadowRoot ensureShadowRoot();
ClientRect getBoundingClientRect();
readonly attribute long offsetLeft;
readonly attribute long offsetTop;
readonly attribute long offsetWidth;
readonly attribute long offsetHeight;
readonly attribute Element offsetParent;
readonly attribute long clientLeft;
readonly attribute long clientTop;
readonly attribute long clientWidth;
readonly attribute long clientHeight;
attribute double x;
attribute double y;
attribute double width;
attribute double height;
attribute double minContentWidth; // Intrinsic width if all wrappable points wrap.
attribute double maxContentWidth; // Intrinsic width if no wrappable points wrap.
};