| { |
| // This file specifies the fields we want to diff in the various diff functions |
| // in ComputedStyle. |
| |
| parameters: { |
| // The name parameter represents the name of the function to be created. |
| |
| fields_to_diff: { |
| default: [], |
| }, |
| |
| // A list of methods to diff (these can be public getters of fields or |
| // functions that use fields to determine a value). |
| // Each entry is expressed as a dict of two fields: |
| // 1. method: the method to be diffed |
| // 2. field_dependencies: lists the properties this method depends on. |
| methods_to_diff: { |
| default: [], |
| }, |
| |
| // A list of predicates that have the diff logic built into them and are only |
| // called by the diff functions in ComputedStyle. |
| // Each entry is expressed as a dict of two fields: |
| // 1. predicate: the predicate to be tested |
| // 2. field_dependencies: lists the properties this predicate test depends on. |
| // TODO: Note that you also have to pass in the arguments for the predicate. |
| // This may be removed in the future if we are always passing the other ComputedStyle |
| predicates_to_test: { |
| default: [], |
| }, |
| }, |
| data: [ |
| { |
| name: "ScrollAnchorDisablingPropertyChanged", |
| fields_to_diff: ["width", "min-width", "max-width", "height", "min-height", "max-height", "margin-top", "margin-left", "margin-right", "margin-bottom", |
| "left", "right", "top", "bottom", "padding-top", |
| "padding-left", "padding-right", "padding-bottom", |
| "contain-intrinsic-size"], |
| methods_to_diff: [ |
| { |
| method: "GetPosition()", |
| field_dependencies: ["position"] |
| }, |
| ] |
| }, |
| { |
| name: "DiffNeedsReshapeAndFullLayoutAndPaintInvalidation", |
| fields_to_diff: ["font"], |
| methods_to_diff: [ |
| { |
| method: "TextTransform()", |
| field_dependencies: ["text-transform"] |
| }, |
| { |
| method: "WhiteSpace()", |
| field_dependencies: ["white-space"] |
| }, |
| { |
| method: "Direction()", |
| field_dependencies: ["direction"] |
| }, |
| { |
| method: "RtlOrdering()", |
| field_dependencies: ["-webkit-rtl-ordering"] |
| }, |
| { |
| method: "GetUnicodeBidi()", |
| field_dependencies: ["unicode-bidi"] |
| }, |
| ] |
| }, |
| { |
| name: "DiffNeedsFullLayoutAndPaintInvalidation", |
| fields_to_diff: ["padding-top", "padding-left", "padding-right", |
| "padding-bottom", "appearance", "-webkit-line-clamp", |
| "text-overflow", "shape-margin", "order", "-webkit-highlight", |
| "text-indent", "text-align-last", "TextIndentLine", "EffectiveZoom", |
| "word-break", "overflow-wrap", "-webkit-line-break", |
| "-webkit-text-security", "hyphens", "HyphenationLimitBefore", |
| "HyphenationLimitAfter", "-webkit-hyphenate-character", |
| "image-orientation", "-webkit-ruby-position", |
| "TextEmphasisMark", "-webkit-text-emphasis-position", |
| "TextEmphasisCustomMark", "text-justify", "text-orientation", |
| "text-combine-upright", "tab-size", "text-size-adjust", |
| "list-style-image", "line-height-step", |
| "-webkit-text-stroke-width", "line-height", |
| "-webkit-border-horizontal-spacing", |
| "-webkit-border-vertical-spacing", "TextAutosizingMultiplier", |
| "NamedGridColumnLines", "NamedGridRowLines", "OrderedNamedGridColumnLines", |
| "OrderedNamedGridRowLines", "AutoRepeatNamedGridColumnLines", |
| "AutoRepeatNamedGridRowLines", "AutoRepeatOrderedNamedGridColumnLines", |
| "AutoRepeatOrderedNamedGridRowLines", "ImplicitNamedGridColumnLines", |
| "ImplicitNamedGridRowLines", "NamedGridArea", "grid-auto-rows", |
| "grid-template-rows", "grid-template-columns", "grid-auto-columns", "row-gap", |
| "NamedGridAreaRowCount", "NamedGridAreaColumnCount", |
| "GridAutoRepeatColumns", "GridAutoRepeatRows", "GridAutoRepeatColumnsInsertionPoint", |
| "GridAutoRepeatRowsInsertionPoint", "grid-auto-flow", "GridAutoRepeatColumnsType", |
| "GridAutoRepeatRowsType", "-webkit-box-flex", |
| "-webkit-box-ordinal-group", "flex-basis", |
| "flex-shrink", "flex-grow", "flex-direction", "flex-wrap", "-webkit-box-align", |
| "-webkit-box-pack", "-webkit-box-orient", |
| "grid-row-start", "grid-row-end", "grid-column-start", "grid-column-end", |
| "column-gap", "column-width", "column-rule-style", |
| "column-rule-width", "column-rule-color", "-internal-visited-column-rule-color", |
| "column-count", "HasAutoColumnCount", "HasAutoColumnWidth", "column-fill", "column-span", |
| "cx", "cy", "d", "rx", "ry", "x", "y", "r", "alignment-baseline", "vector-effect", |
| "BaselineShiftType", "baseline-shift", "dominant-baseline", "text-anchor", |
| "stroke-width", "stroke-miterlimit", "stroke-linecap", "stroke-linejoin", |
| "marker-end", "marker-mid", "marker-start",], |
| methods_to_diff: [ |
| { |
| method: "BorderLeftWidth()", |
| field_dependencies: ["border-left-width"] |
| }, |
| { |
| method: "BorderTopWidth()", |
| field_dependencies: ["border-top-width"] |
| }, |
| { |
| method: "BorderBottomWidth()", |
| field_dependencies: ["border-bottom-width"] |
| }, |
| { |
| method: "BorderRightWidth()", |
| field_dependencies: ["border-right-width"] |
| }, |
| { |
| method: "HasPseudoElementStyle(kPseudoIdScrollbar)", |
| field_dependencies: ["StyleType"] |
| }, |
| { |
| method: "BoxDirection()", |
| field_dependencies: ["-webkit-box-direction"] |
| }, |
| { |
| method: "GetTextAlign()", |
| field_dependencies: ["text-align"] |
| }, |
| { |
| method: "GetWritingMode()", |
| field_dependencies: ["writing-mode"] |
| }, |
| { |
| method: "OverflowX()", |
| field_dependencies: ["overflow-x"] |
| }, |
| { |
| method: "OverflowY()", |
| field_dependencies: ["overflow-y"] |
| }, |
| { |
| method: "Clear()", |
| field_dependencies: ["clear"] |
| }, |
| { |
| method: "Floating()", |
| field_dependencies: ["float"] |
| }, |
| { |
| method: "DisplayLayoutCustomName()", |
| field_dependencies: ["DisplayLayoutCustomName"] |
| }, |
| { |
| method: "OriginalDisplay()", |
| field_dependencies: ["OriginalDisplay"] |
| }, |
| { |
| method: "HasStroke()", |
| field_dependencies: ["stroke"] |
| }, |
| { |
| method: "HasDashArray()", |
| field_dependencies: ["stroke-dasharray"] |
| }, |
| ], |
| predicates_to_test: [ |
| { |
| predicate: "a.TextShadowDataEquivalent(b)", |
| field_dependencies: ["text-shadow"] |
| }, |
| { |
| predicate: "a.QuotesDataEquivalent(b)", |
| field_dependencies: ["quotes"] |
| }, |
| { |
| predicate: "a.OpacityChangedStackingContext(b)", |
| field_dependencies: ["IsStackingContextWithoutContainment", |
| "opacity"] |
| }, |
| ] |
| }, |
| { |
| name: "DiffNeedsFullLayoutAndPaintInvalidationDisplayTableType", |
| methods_to_diff: [ |
| { |
| method: "BorderCollapse()", |
| field_dependencies: ["border-collapse"] |
| }, |
| { |
| method: "EmptyCells()", |
| field_dependencies: ["empty-cells"] |
| }, |
| { |
| method: "CaptionSide()", |
| field_dependencies: ["caption-side"] |
| }, |
| { |
| method: "TableLayout()", |
| field_dependencies: ["table-layout"] |
| }, |
| ] |
| }, |
| { |
| name: "DiffNeedsFullLayoutAndPaintInvalidationDisplayListItem", |
| methods_to_diff: [ |
| { |
| method: "ListStylePosition()", |
| field_dependencies: ["list-style-position"] |
| }, |
| ], |
| predicates_to_test: [ |
| { |
| predicate: "a.ListStyleTypeDataEquivalent(b)", |
| field_dependencies: ["list-style-type"] |
| }, |
| ] |
| }, |
| { |
| name: "DiffNeedsFullLayout", |
| fields_to_diff: ["width", "min-width", "max-width", "height", "min-height", |
| "max-height", "VerticalAlignLength", "box-sizing", "align-content", |
| "align-items", "align-self", "justify-content", "justify-items", |
| "justify-self", "contain", "contain-intrinsic-size", "aspect-ratio", |
| "overflow-clip-margin", "-internal-align-self-block", "orphans", |
| "widows"], |
| methods_to_diff: [ |
| { |
| method: "VerticalAlign()", |
| field_dependencies: ["VerticalAlign"] |
| }, |
| { |
| method: "GetPosition()", |
| field_dependencies: ["position"] |
| }, |
| ] |
| }, |
| { |
| name: "DiffNeedsPaintInvalidation", |
| fields_to_diff: ["-webkit-user-modify", "user-select", "image-rendering", |
| "-webkit-user-drag", "object-fit", "object-position", |
| "mix-blend-mode", "isolation", "Mask", "MaskBoxImage", "mask", "mask-type", |
| "stop-color", "stop-opacity", "flood-color", "flood-opacity", |
| "lighting-color", "shape-rendering", "clip-rule", "fill-rule", |
| "color-interpolation", "color-interpolation-filters", "paint-order", |
| "fill", "fill-opacity", "stroke", "stroke-opacity", |
| "-internal-visited-stroke", "stroke-dashoffset"], |
| methods_to_diff: [ |
| { |
| method: "Visibility()", |
| field_dependencies: ["visibility"] |
| }, |
| { |
| method: "PrintColorAdjust()", |
| field_dependencies: ["-webkit-print-color-adjust"] |
| }, |
| { |
| method: "InsideLink()", |
| field_dependencies: ["InsideLink"] |
| }, |
| { |
| method: "InternalVisitedBackgroundColor()", |
| field_dependencies: ["-internal-visited-background-color"] |
| }, |
| { |
| method: "Resize()", |
| field_dependencies: ["resize"] |
| }, |
| { |
| method: "UsedColorScheme()", |
| field_dependencies: ["color-scheme"] |
| }, |
| ], |
| predicates_to_test: [ |
| { |
| predicate: "a.BoxShadowDataEquivalent(b)", |
| field_dependencies: ["box-shadow"] |
| }, |
| { |
| predicate: "a.ShapeOutsideDataEquivalent(b)", |
| field_dependencies: ["shape-outside"] |
| }, |
| { |
| predicate: "a.ClipPathDataEquivalent(b)", |
| field_dependencies: ["clip-path"] |
| }, |
| { |
| predicate: "a.OutlineVisuallyEqual(b)", |
| field_dependencies: ["outline-width", "outline-color", "outline-offset", "outline-style", "OutlineStyleIsAuto"] |
| }, |
| { |
| predicate: "a.InternalVisitedBorderLeftColorHasNotChanged(b)", |
| field_dependencies: ["-internal-visited-border-left-color"] |
| }, |
| { |
| predicate: "a.InternalVisitedBorderRightColorHasNotChanged(b)", |
| field_dependencies: ["-internal-visited-border-right-color"] |
| }, |
| { |
| predicate: "a.InternalVisitedBorderBottomColorHasNotChanged(b)", |
| field_dependencies: ["-internal-visited-border-bottom-color"] |
| }, |
| { |
| predicate: "a.InternalVisitedBorderTopColorHasNotChanged(b)", |
| field_dependencies: ["-internal-visited-border-top-color"] |
| }, |
| { |
| predicate: "a.InternalVisitedOutlineColorHasNotChanged(b)", |
| field_dependencies: ["-internal-visited-outline-color"] |
| }, |
| { |
| predicate: "a.StrokeDashArrayDataEquivalent(b)", |
| field_dependencies: ["stroke-dasharray"] |
| }, |
| ] |
| }, |
| { |
| name: "DiffNeedsVisualRectUpdate", |
| methods_to_diff: [ |
| { |
| method: "Visibility()", |
| field_dependencies: ["visibility"] |
| }, |
| { |
| method: "Resize()", |
| field_dependencies: ["resize"] |
| }, |
| ], |
| predicates_to_test: [ |
| { |
| predicate: "a.ClipPathDataEquivalent(b)", |
| field_dependencies: ["clip-path"] |
| } |
| ] |
| }, |
| { |
| name: "UpdatePropertySpecificDifferencesZIndex", |
| fields_to_diff: ["z-index"], |
| methods_to_diff: [ |
| { |
| method: "IsStackingContextWithoutContainment()", |
| field_dependencies: ["IsStackingContextWithoutContainment"] |
| }, |
| ] |
| }, |
| { |
| name: "DiffTransformData", |
| fields_to_diff: ["transform", "translate", "rotate", |
| "scale", "offset-path", "offset-rotate", "transform-origin", |
| "offset-position", "offset-anchor", "offset-distance", |
| "transform-box"], |
| }, |
| { |
| name: "UpdatePropertySpecificDifferencesTransform", |
| fields_to_diff: ["transform", "translate", "rotate", |
| "scale", "offset-path", "offset-rotate", "transform-origin", |
| "offset-position", "offset-anchor", "offset-distance", |
| "perspective", "perspective-origin", "transform-box"], |
| methods_to_diff: [ |
| { |
| // It's possible for the old and new style transform data to be equivalent |
| // while hasTransform() differs, as it checks a number of conditions aside |
| // from just the matrix, including but not limited to animation state. |
| method: "HasTransform()", |
| field_dependencies: ["transform", "offset-position", |
| "HasCurrentTransformAnimation", "translate", "rotate", |
| "scale"] |
| }, |
| ] |
| }, |
| { |
| name: "UpdatePropertySpecificDifferencesOpacity", |
| fields_to_diff: ["opacity"], |
| }, |
| { |
| name: "UpdatePropertySpecificDifferencesFilter", |
| predicates_to_test: [ |
| { |
| predicate: "a.ReflectionDataEquivalent(b)", |
| field_dependencies: ["-webkit-box-reflect"] |
| }, |
| { |
| predicate: "a.FilterDataEquivalent(b)", |
| field_dependencies: ["filter"] |
| }, |
| ] |
| }, |
| { |
| name: "UpdatePropertySpecificDifferencesMask", |
| fields_to_diff: ["Mask", "MaskBoxImage", "mask"], |
| }, |
| { |
| name: "UpdatePropertySpecificDifferencesNeedsRecomputeVisualOverflow", |
| predicates_to_test: [ |
| { |
| predicate: "a.BoxShadowDataEquivalent(b)", |
| field_dependencies: ["box-shadow"] |
| }, |
| { |
| predicate: "a.OutlineVisuallyEqual(b)", |
| field_dependencies: ["outline-width", "outline-color", "outline-offset", "outline-style", "OutlineStyleIsAuto"] |
| }, |
| { |
| predicate: "a.BorderVisualOverflowEqual(b)", |
| field_dependencies: ["border-image"] |
| }, |
| { |
| predicate: "a.TextDecorationVisualOverflowEqual(b)", |
| field_dependencies: ["text-decoration-thickness", "text-decoration-style", |
| "text-decoration-line", "text-underline-offset", "text-underline-position", |
| "AppliedTextDecorations"] |
| }, |
| ] |
| }, |
| { |
| name: "UpdatePropertySpecificDifferencesTextDecorationOrColor", |
| fields_to_diff: ["color", "-internal-visited-color", "text-decoration-line", |
| "text-decoration-style", "text-decoration-color", |
| "text-decoration-thickness", "text-underline-offset", |
| "-internal-visited-text-decoration-color", "TextEmphasisFill", |
| "text-underline-position", "text-decoration-skip-ink", "AppliedTextDecorations"], |
| methods_to_diff: [ |
| { |
| method: "HasSimpleUnderlineInternal()", |
| field_dependencies: ["HasSimpleUnderline"] |
| }, |
| { |
| method: "TextFillColor()", |
| field_dependencies: ["-webkit-text-fill-color"] |
| }, |
| { |
| method: "TextStrokeColor()", |
| field_dependencies: ["-webkit-text-stroke-color"] |
| }, |
| { |
| method: "TextEmphasisColor()", |
| field_dependencies: ["-webkit-text-emphasis-color"] |
| }, |
| { |
| method: "InternalVisitedTextFillColor()", |
| field_dependencies: ["-internal-visited-text-fill-color"] |
| }, |
| { |
| method: "InternalVisitedTextStrokeColor()", |
| field_dependencies: ["-internal-visited-text-stroke-color"] |
| }, |
| { |
| method: "InternalVisitedTextEmphasisColor()", |
| field_dependencies: ["-internal-visited-text-emphasis-color"] |
| }, |
| { |
| method: "CaretColor()", |
| field_dependencies: ["caret-color"] |
| }, |
| { |
| method: "InternalVisitedCaretColor()", |
| field_dependencies: ["-internal-visited-caret-color"] |
| }, |
| ] |
| }, |
| ], |
| } |