style: Update comments to no longer point to nsRuleNode.

There are a few mentions of nsRuleNode left but they are mostly
historical references so it makes sense to keep them.

Differential Revision: https://phabricator.services.mozilla.com/D5505
This commit is contained in:
Cameron McCormack 2018-09-12 17:37:37 +10:00 committed by Emilio Cobos Álvarez
parent 6d57cbd881
commit 1f45fc0339
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 19 additions and 18 deletions

View file

@ -2403,7 +2403,8 @@ fn static_assert() {
/// Calculates the constrained and unconstrained font sizes to be inherited
/// from the parent.
///
/// See ComputeScriptLevelSize in Gecko's nsRuleNode.cpp
/// This is a port of Gecko's old ComputeScriptLevelSize function:
/// https://dxr.mozilla.org/mozilla-central/rev/35fbf14b9/layout/style/nsRuleNode.cpp#3197-3254
///
/// scriptlevel is a property that affects how font-size is inherited. If scriptlevel is
/// +1, for example, it will inherit as the script size multiplier times
@ -2511,17 +2512,18 @@ fn static_assert() {
= self.calculate_script_level_size(parent, device);
if adjusted_size.0 != parent.gecko.mSize ||
adjusted_unconstrained_size.0 != parent.gecko.mScriptUnconstrainedSize {
// This is incorrect. When there is both a keyword size being inherited
// and a scriptlevel change, we must handle the keyword size the same
// way we handle em units. This complicates things because we now have
// to keep track of the adjusted and unadjusted ratios in the kw font size.
// This only affects the use case of a generic font being used in MathML.
// FIXME(Manishearth): This is incorrect. When there is both a
// keyword size being inherited and a scriptlevel change, we must
// handle the keyword size the same way we handle em units. This
// complicates things because we now have to keep track of the
// adjusted and unadjusted ratios in the kw font size. This only
// affects the use case of a generic font being used in MathML.
//
// If we were to fix this I would prefer doing it by removing the
// ruletree walk on the Gecko side in nsRuleNode::SetGenericFont
// and instead using extra bookkeeping in the mSize and mScriptUnconstrainedSize
// values, and reusing those instead of font_size_keyword.
// If we were to fix this I would prefer doing it not doing
// something like the ruletree walk that Gecko used to do in
// nsRuleNode::SetGenericFont and instead using extra bookkeeping in
// the mSize and mScriptUnconstrainedSize values, and reusing those
// instead of font_size_keyword.
// In the case that MathML has given us an adjusted size, apply it.
// Keep track of the unconstrained adjusted size.

View file

@ -1200,9 +1200,6 @@ impl StrongRuleNode {
}
}
/// Implementation of `nsRuleNode::HasAuthorSpecifiedRules` for Servo rule
/// nodes.
///
/// Returns true if any properties specified by `rule_type_mask` was set by
/// an author rule.
#[cfg(feature = "gecko")]

View file

@ -746,7 +746,12 @@ impl ToComputedValue for KeywordSize {
fn to_computed_value(&self, cx: &Context) -> NonNegativeLength {
use context::QuirksMode;
use values::specified::length::au_to_int_px;
// Data from nsRuleNode.cpp in Gecko
// The tables in this function are originally from
// nsRuleNode::CalcFontPointSize in Gecko:
//
// https://dxr.mozilla.org/mozilla-central/rev/35fbf14b9/layout/style/nsRuleNode.cpp#3262-3336
// Mapping from base size and HTML size to pixels
// The first index is (base_size - 9), the second is the
// HTML size. "0" is CSS keyword xx-small, not HTML size 0,
@ -765,9 +770,6 @@ impl ToComputedValue for KeywordSize {
[9, 10, 13, 16, 18, 24, 32, 48],
];
// Data from nsRuleNode.cpp in Gecko
// (https://dxr.mozilla.org/mozilla-central/rev/35fbf14b9/layout/style/nsRuleNode.cpp#3303)
//
// This table gives us compatibility with WinNav4 for the default fonts only.
// In WinNav4, the default fonts were:
//