2362N/A * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * as a typesafe enumeration. The HTML View implementations use 0N/A * CSS attributes to determine how they will render. This also defines 0N/A * properties, such as font, are mapped to the intrinsic properties. 0N/A * <p>The following describes the CSS properties that are suppored by the 0N/A * <ul><li>font-family 0N/A * <li>font-size (supports relative units) 0N/A * <li>background-color (with the exception of transparent) 0N/A * <li>background-image 0N/A * <li>background-repeat 0N/A * <li>background-position 0N/A * <li>text-decoration (with the exception of blink and overline) 0N/A * <li>vertical-align (only sup and super) 0N/A * <li>text-align (justify is treated as center) 0N/A * <li>padding-bottom 0N/A * <li>border-style (only supports inset, outset and none) 0N/A * <li>list-style-type 0N/A * <li>list-style-position 0N/A * The following are modeled, but currently not rendered. 0N/A * <ul><li>font-variant 0N/A * <li>background-attachment (background always treated as scroll) 0N/A * <li>letter-spacing 0N/A * <li>text-transform 0N/A * <li>border-top-width (this is used to indicate if a border should be used) 0N/A * <li>border-right-width 0N/A * <li>border-bottom-width 0N/A * <li>border-left-width 0N/A * <p><b>Note: for the time being we do not fully support relative units, 0N/A * unless noted, so that 0N/A * p { margin-top: 10% } will be treated as if no margin-top was specified. 0N/A * @author Timothy Prinzing 0N/A * @author Scott Violet 0N/A * Definitions to be used as a key on AttributeSet's 0N/A * that might hold CSS attributes. Since this is a 0N/A * closed set (i.e. defined exactly by the specification), 0N/A * it is final and cannot be extended. 0N/A * The string representation of the attribute. This 0N/A * should exactly match the string specified in the 0N/A * CSS specification. 0N/A * Fetch the default value for the attribute. 0N/A * If there is no default value (such as for 0N/A * composite attributes), null will be returned. 0N/A * Indicates if the attribute should be inherited 0N/A * from the parent or not. 0N/A * made up css attributes to describe orientation depended 0N/A * margins. used for <dir>, <menu>, <ul> etc. see 0N/A * 5088268 for more details 0N/A // All possible CSS attribute keys. 0N/A * The string representation of the attribute. This 0N/A * should exactly match the string specified in the 0N/A * CSS specification. 0N/A // background-repeat 0N/A // background-attachment 0N/A // setup the css conversion table 0N/A for (
int i =
0; i < n; i++) {
0N/A * Sets the base font size. <code>sz</code> is a CSS value, and is 0N/A * not necessarily the point size. Use getPointSize to determine the 0N/A * point size corresponding to <code>sz</code>. 0N/A * Sets the base font size from the passed in string. 0N/A * Returns the base font size. 0N/A * Parses the CSS property <code>key</code> with value 0N/A * <code>value</code> placing the result in <code>att</code>. 0N/A * Gets the internal CSS representation of <code>value</code> which is 0N/A * a CSS value of the CSS attribute named <code>key</code>. The receiver 0N/A * should not modify <code>value</code>, and the first <code>count</code> 0N/A * strings are valid. 0N/A * Maps from a StyleConstants to a CSS Attribute. 0N/A * Maps from a StyleConstants value to a CSS value. 0N/A * Converts the passed in CSS value to a StyleConstants value. 0N/A * <code>key</code> identifies the CSS attribute being mapped. 0N/A * Returns the font for the values in the passed in AttributeSet. 0N/A * It is assumed the keys will be CSS.Attribute keys. 0N/A * <code>sc</code> is the StyleContext that will be messaged to get 0N/A * the font once the size, name and style have been determined. 0N/A * If the vertical alignment is set to either superscirpt or 0N/A * subscript we reduce the font size by 2 points. 0N/A // PENDING(prinz) this is a 1.1 based implementation, need to also 0N/A // have a 1.2 version. 0N/A * Takes a set of attributes and turn it into a color 0N/A * specification. This might be used to specify things 0N/A * like brighter, more hue, etc. 0N/A * This will return null if there is no value for <code>key</code>. 0N/A * @param key CSS.Attribute identifying where color is stored. 0N/A * @param a the set of attributes 0N/A * Returns the size of a font from the passed in string. 0N/A * @param size CSS string describing font size 0N/A * @param baseFontSize size to use for relative units. 0N/A * Returns the length of the attribute in <code>a</code> with 0N/A * key <code>key</code>. 0N/A * Convert a set of HTML attributes to an equivalent 0N/A * set of CSS attributes. 611N/A * @param htmlAttrSet AttributeSet containing the HTML attributes. 0N/A * @return AttributeSet containing the corresponding CSS attributes. 0N/A * The AttributeSet will be empty if there are no mapping 0N/A // translate border width into the cells, if it has non-zero value. 4379N/A // If table contains the BORDER attribute cells should have border width equals 1 0N/A * Navigator uses ALIGN for caption placement and IE uses VALIGN. 4379N/A // Some browsers accept <TABLE BORDER> and <TABLE BORDER=""> with the same semantics as BORDER=1 0N/A * The hashtable and the static initalization block below, 0N/A * set up a mapping from well-known HTML attributes to 0N/A * CSS attributes. For the most part, there is a 1-1 mapping 0N/A * between the two. However in the case of certain HTML 0N/A * attributes for example HTML.Attribute.VSPACE or 0N/A * HTML.Attribute.HSPACE, end up mapping to two CSS.Attribute's. 0N/A * Therefore, the value associated with each HTML.Attribute. 0N/A * key ends up being an array of CSS.Attribute.* objects. 0N/A * The hashtable and static initialization that follows sets 0N/A * up a translation from StyleConstants (i.e. the <em>well known</em> 0N/A * attributes) to the associated CSS attributes. 0N/A /** Maps from HTML value to a CSS value. Used in internal mapping. */ 0N/A /** Maps from CSS value (string) to internal value. */ 0N/A // load the attribute map 0N/A // load the value map 0N/A // initialize StyleConstants mapping 0N/A // CSS-> internal CSS 0N/A * Return the set of all possible CSS attribute keys. 0N/A * Translates a string to a <code>CSS.Attribute</code> object. 0N/A * This will return <code>null</code> if there is no attribute 0N/A * by the given name. 0N/A * @param name the name of the CSS attribute to fetch the 0N/A * typesafe enumeration for 0N/A * @return the <code>CSS.Attribute</code> object, 0N/A * or <code>null</code> if the string 0N/A * doesn't represent a valid attribute key 0N/A * Translates a string to a <code>CSS.Value</code> object. 0N/A * This will return <code>null</code> if there is no value 0N/A * by the given name. 0N/A * @param name the name of the CSS value to fetch the 0N/A * typesafe enumeration for 0N/A * @return the <code>CSS.Value</code> object, 0N/A * or <code>null</code> if the string 0N/A * doesn't represent a valid CSS value name; this does 0N/A * not mean that it doesn't represent a valid CSS value 0N/A * Returns a URL for the given CSS url string. If relative, 0N/A * <code>base</code> is used as the parent. If a valid URL can not 0N/A * be found, this will not throw a MalformedURLException, instead 0N/A * null will be returned. 0N/A // Relative URL, try from base 0N/A * Converts a type Color to a hex string 0N/A * in the format "#RRGGBB" 0N/A * Convert a "#FFFFFF" hex string to a Color. 0N/A * If the color specification is bad, an attempt 0N/A * will be made to fix it up. 0N/A * Convert a color string such as "RED" or "#NNNNNN" or "rgb(r, g, b)" 0N/A * Parses a String in the format <code>rgb(r, g, b)</code> where 0N/A * each of the Color components is either an integer, or a floating number 0N/A * with a % after indicating a percentage value of 255. Values are 0N/A * constrained to fit with 0-255. The resulting Color is returned. 0N/A // Find the next numeric char 0N/A * Returns the next integer value from <code>string</code> starting 0N/A * at <code>index[0]</code>. The value can either can an integer, or 0N/A * a percentage (floating number ending with %), in which case it is 0N/A * multiplied by 255. 0N/A // Skip non-decimal chars 0N/A * @return an array of all the strings in <code>value</code> 0N/A * that are separated by whitespace. 0N/A * Return the point size, given a size index. Legal HTML index sizes 0N/A // HR needs special handling due to us treating it as a leaf. 0N/A * HTML.Attribute.ALIGN needs special processing. 0N/A * It can map to to 1 of many(3) possible CSS attributes 0N/A * depending on the nature of the tag the attribute is 0N/A * part off and depending on the value of the attribute. 4379N/A * The html size attribute has a mapping in the CSS world only 4379N/A * if it is par of a font or base font tag. 0N/A * In the case of all remaining HTML.Attribute's they 0N/A * map to 1 or more CCS.Attribute. 0N/A * Given a CSS.Attribute object and its corresponding HTML.Attribute's 0N/A * value, this method returns a CssValue object to associate with the 0N/A * @param the CSS.Attribute 0N/A * @param a String containing the value associated HTML.Attribtue. 0N/A * Maps an HTML.Attribute object to its appropriate CSS.Attributes. 0N/A * @param HTML.Attribute 0N/A * @return CSS.Attribute[] 0N/A * Maps HTML.Attribute.ALIGN to either: 0N/A * CSS.Attribute.TEXT_ALIGN 0N/A * CSS.Attribute.FLOAT 0N/A * CSS.Attribute.VERTICAL_ALIGN 0N/A * based on the tag associated with the attribute and the 0N/A * value of the attribute. 0N/A * @param AttributeSet containing HTML attributes. 0N/A * @return CSS.Attribute mapping for HTML.Attribute.ALIGN. 0N/A String htmlAttrValue = (String)htmlAttrSet.getAttribute(HTML.Attribute.ALIGN); 0N/A CSS.Attribute cssAttr = CSS.Attribute.TEXT_ALIGN; 0N/A if (htmlAttrValue != null && htmlAttrSet instanceof Element) { 0N/A Element elem = (Element)htmlAttrSet; 0N/A if (!elem.isLeaf() && tag.isBlock() && validTextAlignValue(htmlAttrValue)) { 0N/A return CSS.Attribute.TEXT_ALIGN; 0N/A } else if (isFloater(htmlAttrValue)) { 0N/A return CSS.Attribute.FLOAT; 0N/A } else if (elem.isLeaf()) { 0N/A return CSS.Attribute.VERTICAL_ALIGN; 0N/A * Fetches the tag associated with the HTML AttributeSet. 0N/A * @param AttributeSet containing the HTML attributes. 0N/A * Base class to CSS values in the attribute sets. This 0N/A * is intended to act as a convertor to/from other attribute 0N/A * The CSS parser uses the parseCssValue method to convert 0N/A * a string to whatever format is appropriate a given key 0N/A * (i.e. these convertors are stored in a map using the 0N/A * CSS.Attribute as a key and the CssValue as the value). 0N/A * The HTML to CSS conversion process first converts the 0N/A * HTML.Attribute to a CSS.Attribute, and then calls 0N/A * the parseHtmlValue method on the value of the HTML 0N/A * attribute to produce the corresponding CSS value. 0N/A * The StyleConstants to CSS conversion process first 0N/A * converts the StyleConstants attribute to a 0N/A * CSS.Attribute, and then calls the fromStyleConstants 0N/A * method to convert the StyleConstants value to a 0N/A * The CSS to StyleConstants conversion process first 0N/A * converts the StyleConstants attribute to a 0N/A * CSS.Attribute, and then calls the toStyleConstants 0N/A * method to convert the CSS value to a StyleConstants 0N/A * Convert a CSS value string to the internal format 0N/A * (for fast processing) used in the attribute sets. 0N/A * The fallback storage for any value that we don't 0N/A * have a special binary format for is a String. 0N/A * Convert an HTML attribute value to a CSS attribute 0N/A * value. If there is no conversion, return null. 0N/A * This is implemented to simply forward to the CSS 0N/A * parsing by default (since some of the attribute 0N/A * values are the same). If the attribute value 0N/A * isn't recognized as a CSS value it is generally 0N/A * Converts a <code>StyleConstants</code> attribute value to 0N/A * a CSS attribute value. If there is no conversion, 0N/A * returns <code>null</code>. By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @param value the value of a <code>StyleConstants</code> 0N/A * attribute to be converted 0N/A * @return the CSS value that represents the 0N/A * <code>StyleConstants</code> value 0N/A * Converts a CSS attribute value to a 0N/A * <code>StyleConstants</code> 0N/A * value. If there is no conversion, returns 0N/A * <code>null</code>. 0N/A * By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @param v the view containing <code>AttributeSet</code> 0N/A * @return the <code>StyleConstants</code> attribute value that 0N/A * represents the CSS attribute value 0N/A * Return the CSS format of the value 0N/A * The value as a string... before conversion to a 0N/A * By default CSS attributes are represented as simple 0N/A * strings. They also have no conversion to/from 0N/A * StyleConstants by default. This class represents the 0N/A * value as a string (via the superclass), but 0N/A * provides StyleConstants conversion support for the 0N/A * CSS attributes that are held as strings. 0N/A * Convert a CSS value string to the internal format 0N/A * (for fast processing) used in the attribute sets. 0N/A * This produces a StringValue, so that it can be 0N/A * used to convert from CSS to StyleConstants values. 0N/A * Converts a <code>StyleConstants</code> attribute value to 0N/A * a CSS attribute value. If there is no conversion 0N/A * returns <code>null</code>. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @param value the value of a <code>StyleConstants</code> 0N/A * attribute to be converted 0N/A * @return the CSS value that represents the 0N/A * <code>StyleConstants</code> value 0N/A * Converts a CSS attribute value to a 0N/A * <code>StyleConstants</code> value. 0N/A * If there is no conversion, returns <code>null</code>. 0N/A * By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @return the <code>StyleConstants</code> attribute value that 0N/A * represents the CSS attribute value 0N/A // Used by ViewAttributeSet 0N/A * Represents a value for the CSS.FONT_SIZE attribute. 0N/A * The binary format of the value can be one of several 0N/A * types. If the type is Float, 0N/A * the value is specified in terms of point or 0N/A * percentage, depending upon the ending of the 0N/A * associated string. 0N/A * If the type is Integer, the value is specified 0N/A * in terms of a size index. 0N/A * Returns the size in points. This is ultimately 0N/A * @param a the attribute set the value is being 0N/A * requested from. We may need to walk up the 0N/A * resolve hierarchy if it's relative. 0N/A // it's an index, translate from size table 0N/A // a is null, or no resolve parent. 0N/A // relative sizes, larger | smaller (adjust from parent by 0N/A // em, ex refer to parent sizes 0N/A // lengths: pt, mm, cm, pc, in, px 0N/A // em (font height 3em would be 3 times font height) 0N/A // lengths are (+/-) followed by a number and two letter 0N/A * relative sizes in the size attribute are relative 0N/A * to the <basefont>'s size. 0N/A * Converts a <code>StyleConstants</code> attribute value to 0N/A * a CSS attribute value. If there is no conversion 0N/A * returns <code>null</code>. By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @param value the value of a <code>StyleConstants</code> 0N/A * attribute to be converted 0N/A * @return the CSS value that represents the 0N/A * <code>StyleConstants</code> value 0N/A * Converts a CSS attribute value to a <code>StyleConstants</code> 0N/A * value. If there is no conversion, returns <code>null</code>. 0N/A * By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @return the <code>StyleConstants</code> attribute value that 0N/A * represents the CSS attribute value 0N/A * Returns the font family to use. 0N/A * Converts a <code>StyleConstants</code> attribute value to 0N/A * a CSS attribute value. If there is no conversion 0N/A * returns <code>null</code>. By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @param value the value of a <code>StyleConstants</code> 0N/A * attribute to be converted 0N/A * @return the CSS value that represents the 0N/A * <code>StyleConstants</code> value 0N/A * Converts a CSS attribute value to a <code>StyleConstants</code> 0N/A * value. If there is no conversion, returns <code>null</code>. 0N/A * By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @return the <code>StyleConstants</code> attribute value that 0N/A * represents the CSS attribute value 0N/A // PENDING(prinz) add support for relative values 0N/A * Converts a <code>StyleConstants</code> attribute value to 0N/A * a CSS attribute value. If there is no conversion 0N/A * returns <code>null</code>. By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @param value the value of a <code>StyleConstants</code> 0N/A * attribute to be converted 0N/A * @return the CSS value that represents the 0N/A * <code>StyleConstants</code> value 0N/A * Converts a CSS attribute value to a <code>StyleConstants</code> 0N/A * value. If there is no conversion, returns <code>null</code>. 0N/A * By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @return the <code>StyleConstants</code> attribute value that 0N/A * represents the CSS attribute value 0N/A * Returns the color to use. 0N/A * Converts a <code>StyleConstants</code> attribute value to 0N/A * a CSS attribute value. If there is no conversion 0N/A * returns <code>null</code>. By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @param value the value of a <code>StyleConstants</code> 0N/A * attribute to be converted 0N/A * @return the CSS value that represents the 0N/A * <code>StyleConstants</code> value 0N/A * Converts a CSS attribute value to a <code>StyleConstants</code> 0N/A * value. If there is no conversion, returns <code>null</code>. 0N/A * By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @return the <code>StyleConstants</code> attribute value that 0N/A * represents the CSS attribute value 0N/A // CSS.Values are static, don't archive it. 0N/A * if this length value may be negative. 0N/A * Returns the length (span) to use. 0N/A * Returns the length (span) to use. If the value represents 0N/A * a percentage, it is scaled based on <code>currentValue</code>. 0N/A * Returns true if the length represents a percentage of the 0N/A // Not pixels, use LengthUnit 0N/A // PENDING: currently, we only support absolute values and 0N/A * Converts a <code>StyleConstants</code> attribute value to 0N/A * a CSS attribute value. If there is no conversion, 0N/A * returns <code>null</code>. By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @param value the value of a <code>StyleConstants</code> 0N/A * attribute to be converted 0N/A * @return the CSS value that represents the 0N/A * <code>StyleConstants</code> value 0N/A * Converts a CSS attribute value to a <code>StyleConstants</code> 0N/A * value. If there is no conversion, returns <code>null</code>. 0N/A * By default, there is no conversion. 0N/A * @param key the <code>StyleConstants</code> attribute 0N/A * @return the <code>StyleConstants</code> attribute value that 0N/A * represents the CSS attribute value 0N/A /** If true, span is a percentage value, and that to determine 0N/A * the length another value needs to be passed in. */ 0N/A /** Either the absolute value (percentage == false) or 0N/A * a percentage value. */ 0N/A * BorderWidthValue is used to model BORDER_XXX_WIDTH and adds support 0N/A // Assume its a length. 0N/A /** Values used to represent border width. */ 0N/A private static final float[]
values = {
1,
2,
4 };
0N/A * Handles uniquing of CSS values, like lists, and background image 0N/A * Used for background images, to represent the position. 0N/A // bitmask: bit 0, horizontal relative, bit 1 horizontal relative to 0N/A // font size, 2 vertical relative to size, 3 vertical relative to 0N/A // 'top left' and 'left top' both mean the same as '0% 0%'. 0N/A // 'top', 'top center' and 'center top' mean the same as '50% 0%'. 0N/A // 'right top' and 'top right' mean the same as '100% 0%'. 0N/A // 'left', 'left center' and 'center left' mean the same as 0N/A // 'center' and 'center center' mean the same as '50% 50%'. 0N/A // 'right', 'right center' and 'center right' mean the same as 0N/A // 'bottom left' and 'left bottom' mean the same as '0% 100%'. 0N/A // 'bottom', 'bottom center' and 'center bottom' mean the same as 0N/A // 'bottom right' and 'right bottom' mean the same as '100% 100%'. 0N/A // bit 0 for vert, 1 hor, 2 for center 0N/A // First, check for keywords 0N/A // vert and no horiz. 0N/A // horiz and no vert. 0N/A // no horiz, no vert, but center 0N/A * Used for BackgroundImages. 0N/A // PENDING: this base is wrong for linked style sheets. 0N/A synchronized(
this) {
0N/A * Parses a length value, this is used internally, and never added 0N/A * to an AttributeSet or returned to the developer. 0N/A // Not sure about 1.3, determined by experiementation. 0N/A // mapping according to the CSS2 spec 0N/A // treat like points. 0N/A // treat like points. 0N/A // 0 - value indicates real value 0N/A // 1 - % value, value relative to depends upon key. 0N/A // 50% will have a value = .5 0N/A // 2 - add value to parent value. 0N/A // 3 - em/ex relative to font size of element (except for 0N/A // font-size, which is relative to parent). 0N/A * Class used to parse font property. The font property is shorthand 0N/A * for the other font properties. This expands the properties, placing 0N/A * them in the attributeset. 0N/A * Parses the shorthand font string <code>value</code>, placing the 0N/A * result in <code>attr</code>. 0N/A // font is of the form: 0N/A // [ <font-style> || <font-variant> || <font-weight> ]? <font-size> 0N/A // [ / <line-height> ]? <font-family> 0N/A // bitmask, 1 for style, 2 for variant, 3 for weight 0N/A // Check for font-style font-variant font-weight 0N/A // string at index should be the font-size 0N/A // Check for line height 0N/A // remainder of strings are font-family 0N/A * Parses the background property into its intrinsic values. 0N/A * Parses the shorthand font string <code>value</code>, placing the 0N/A * result in <code>attr</code>. 0N/A // bitmask: 0 for image, 1 repeat, 2 attachment, 3 position, 0N/A // Currently, there is no good way to express this. 0N/A if ((found & 16) == 0) { 0N/A css.addInternalCSSValue(attr, CSS.Attribute.BACKGROUND_COLOR, 0N/A * Used to parser margin and padding. 0N/A * <code>value</code>, placing the result in <code>attr</code>. 0N/A * <code>names</code> give the 4 instrinsic property names. 0N/A // Identifies all values. 0N/A // 0 & 2 = strings[0], 1 & 3 = strings[1] 0N/A // Part is non-parseable or occured more than once. 0N/A // Unspecified parts get default values. 0N/A // Dispatch collected values to individual properties. 0N/A * Calculate the requirements needed to tile the requirements 0N/A * given by the iterator that would be tiled. The calculation 0N/A * takes into consideration margin and border spacing. 0N/A for (
int i =
0; i < n; i++) {
0N/A // adjust for the spacing area 0N/A * Calculate a tiled layout for the given iterator. 0N/A * This should be done collapsing the neighboring 0N/A * margins to be a total of the maximum of the two 0N/A * neighboring margin areas as described in the CSS spec. 0N/A * first pass, calculate the preferred sizes, adjustments needed because 0N/A * of margin collapsing, and the flexibility to adjust the sizes. 0N/A //max gain we can get adjusting elements with adjustmentWeight <= i 0N/A //max loss we can get adjusting elements with adjustmentWeight <= i 0N/A for (
int i =
0; i < n; i++) {
0N/A * Second pass, expand or contract by as much as possible to reach 0N/A * the target span. This takes the margin collapsing into account 0N/A * prior to adjusting the span. 0N/A // determine the adjustment to be made 0N/A // adjustmentsArray[] is sorted. I do not bother about 0N/A // binary search though 0N/A // make the adjustments 0N/A for (
int i =
0; i < n; i++) {
0N/A // while rounding we could lose several pixels. 0N/A // check for infinite loop 0N/A // try to distribute roundError. one pixel per cell 0N/A for (
int i =
0; i < n; i++) {
0N/A * An iterator to express the requirements to use when computing 0N/A //float getAlignment(); 0N/A // Serialization support 0N/A // Determine what values in valueConvertor need to be written out. 0N/A // Should we throw an exception here? 0N/A // Should we throw an exception here? 0N/A // Reconstruct the hashtable. 0N/A * we need StyleSheet for resolving lenght units. (see 0N/A * we can not pass stylesheet for handling relative sizes. (do not 0N/A * think changing public API is necessary) 0N/A * CSS is not likely to be accessed from more then one thread. 0N/A * Having local storage for StyleSheet for resolving relative 0N/A // Instance variables 0N/A /** Maps from CSS key to CssValue. */ 0N/A /** Size used for relative units. */