mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1511570 - Make content-language invalidate style data. r=jfkthame
This is needed because content-language can affect the default computed values for a given document. Differential Revision: https://phabricator.services.mozilla.com/D13636 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
ef8f9622b4
commit
df6ab0194b
@ -3579,6 +3579,9 @@ void nsIDocument::SetHeaderData(nsAtom* aHeaderField, const nsAString& aData) {
|
||||
|
||||
if (aHeaderField == nsGkAtoms::headerContentLanguage) {
|
||||
CopyUTF16toUTF8(aData, mContentLanguage);
|
||||
if (auto* presContext = GetPresContext()) {
|
||||
presContext->ContentLanguageChanged();
|
||||
}
|
||||
}
|
||||
|
||||
if (aHeaderField == nsGkAtoms::headerDefaultStyle) {
|
||||
|
@ -1720,6 +1720,11 @@ void nsPresContext::CacheAllLangs() {
|
||||
mFontGroupCacheDirty = false;
|
||||
}
|
||||
|
||||
void nsPresContext::ContentLanguageChanged() {
|
||||
mFontGroupCacheDirty = true;
|
||||
PostRebuildAllStyleDataEvent(nsChangeHint(0), eRestyle_ForceDescendants);
|
||||
}
|
||||
|
||||
void nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint,
|
||||
nsRestyleHint aRestyleHint) {
|
||||
if (!mShell) {
|
||||
|
@ -273,6 +273,8 @@ class nsPresContext : public nsISupports,
|
||||
void PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint,
|
||||
nsRestyleHint aRestyleHint);
|
||||
|
||||
void ContentLanguageChanged();
|
||||
|
||||
/**
|
||||
* Handle changes in the values of media features (used in media
|
||||
* queries).
|
||||
|
3
layout/reftests/bugs/1511570-ref.html
Normal file
3
layout/reftests/bugs/1511570-ref.html
Normal file
@ -0,0 +1,3 @@
|
||||
<!doctype html>
|
||||
<meta http-equiv="Content-Language" content="zh-CN">
|
||||
<p style="font-family: sans-serif">Some test in the default font for zh-CN.
|
2
layout/reftests/bugs/1511570.html
Normal file
2
layout/reftests/bugs/1511570.html
Normal file
@ -0,0 +1,2 @@
|
||||
<!doctype html>
|
||||
<p lang="zh-CN" style="font-family: sans-serif">Some test in the default font for zh-CN.
|
@ -2094,3 +2094,4 @@ test-pref(layout.css.visited_links_enabled,false) == 1488155.html 1488155-ref.ht
|
||||
== 1492660-1.html 1492660-1-ref.html
|
||||
pref(layout.css.supports-selector.enabled,true) == 1499386.html 1499386-ref.html
|
||||
pref(layout.css.supports-selector.enabled,false) != 1499386.html 1499386-ref.html
|
||||
== 1511570.html 1511570-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user