void StyleSet::DebugCheckSanity() const { for (int i = CatFIRST; i < CatEND; i++) { StyleCategories cat = (StyleCategories) i; StyleAttrib val = Get(cat); XO_DEBUG_ASSERT(val.IsNull() || val.Category == cat); } }
StyleAttrib RenderStack::Get(StyleCategories cat) const { StyleAttrib v = Stack.back().Styles.Get(cat); if (v.IsNull()) return Defaults[cat]; else return v; }
void StyleResolver::SetInherited(RenderStack& stack, const DomEl* node, StyleCategories cat) { RenderStackEl& result = stack.StackBack(); size_t stackSize = stack.StackSize(); for (ssize_t j = stackSize - 2; j >= 0; j--) { StyleAttrib attrib = stack.StackAt(j).Styles.Get(cat); if (!attrib.IsNull()) { SetFinal(result, attrib); break; } } }