Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8257664: HTMLEditorKit: Wrong CSS relative font sizes #1759

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1728,6 +1728,19 @@ private synchronized void refreshResolvedRules(String selectorName,
}
}

/**
* Proxy value to compute inherited {@code font-size}.
*
* @see <a href="https://www.w3.org/TR/CSS2/cascade.html">Assigning
* property values, Cascading, and Inheritance</a>
*/
Object fontSizeInherit() {
if (fontSizeInherit == null) {
fontSizeInherit = css.new FontSize().parseCssValue("100%");
}
return fontSizeInherit;
}


/**
* A temporary class used to hold a Vector, a StringBuffer and a
@@ -2814,7 +2827,7 @@ Object doGetAttribute(Object key) {
// CSS.FontSize represents a specified value and we need
// to inherit a computed value so don't resolve percentage
// value from parent.
return FONT_SIZE_INHERIT;
return fontSizeInherit();
}

Object retValue = super.getAttribute(key);
@@ -3213,6 +3226,8 @@ else if (firstChar == '#') {

static final int DEFAULT_FONT_SIZE = 3;

private transient Object fontSizeInherit;

private CSS css;

/**
@@ -3413,15 +3428,6 @@ boolean isW3CLengthUnits() {
return w3cLengthUnits;
}

/**
* Proxy value to compute inherited {@code font-size}.
*
* @see <a href="https://www.w3.org/TR/CSS2/cascade.html">Assigning
* property values, Cascading, and Inheritance</a>
*/
static final Object FONT_SIZE_INHERIT =
new CSS().new FontSize().parseCssValue("100%");

/**
* The HTML/CSS size model has seven slots
* that one can assign sizes to.