OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1923 frame->localFrameRoot()->eventHandler().scheduleCursorUpdate(); | 1923 frame->localFrameRoot()->eventHandler().scheduleCursorUpdate(); |
1924 } | 1924 } |
1925 } | 1925 } |
1926 | 1926 |
1927 if (diff.needsFullPaintInvalidation() && oldStyle) { | 1927 if (diff.needsFullPaintInvalidation() && oldStyle) { |
1928 if (resolveColor(*oldStyle, CSSPropertyBackgroundColor) != | 1928 if (resolveColor(*oldStyle, CSSPropertyBackgroundColor) != |
1929 resolveColor(CSSPropertyBackgroundColor) || | 1929 resolveColor(CSSPropertyBackgroundColor) || |
1930 oldStyle->backgroundLayers() != styleRef().backgroundLayers()) | 1930 oldStyle->backgroundLayers() != styleRef().backgroundLayers()) |
1931 setBackgroundChangedSinceLastPaintInvalidation(); | 1931 setBackgroundChangedSinceLastPaintInvalidation(); |
1932 } | 1932 } |
1933 | |
1934 if (oldStyle && oldStyle->styleType() == PseudoIdNone) | |
1935 applyPseudoStyleChanges(*oldStyle); | |
1936 } | |
1937 | |
1938 void LayoutObject::applyPseudoStyleChanges(const ComputedStyle& oldStyle) { | |
1939 if (oldStyle.hasPseudoStyle(PseudoIdFirstLine) || | |
1940 styleRef().hasPseudoStyle(PseudoIdFirstLine)) | |
1941 applyFirstLineChanges(oldStyle); | |
1942 | |
1943 // TODO(rune@opera.com): Move the invalidation for ::selection here. | |
1944 // Instead of having a PaintInvalidationSelectionOnly PaintInvalidationType | |
1945 // used for the element diff, we should use PaintInvalidationObject diff on | |
1946 // the pseudo element style here instead. | |
1947 } | |
1948 | |
1949 void LayoutObject::applyFirstLineChanges(const ComputedStyle& oldStyle) { | |
1950 RefPtr<ComputedStyle> oldPseudoStyle; | |
1951 RefPtr<ComputedStyle> newPseudoStyle; | |
1952 if (oldStyle.hasPseudoStyle(PseudoIdFirstLine)) | |
1953 oldPseudoStyle = oldStyle.getCachedPseudoStyle(PseudoIdFirstLine); | |
1954 if (styleRef().hasPseudoStyle(PseudoIdFirstLine) && oldPseudoStyle) | |
mstensho (USE GERRIT)
2017/03/07 10:04:26
This will never be true if oldStyle.hasPseudoStyle
rune
2017/03/07 10:42:54
Done.
| |
1955 newPseudoStyle = uncachedFirstLineStyle(mutableStyle()); | |
1956 if (oldPseudoStyle && newPseudoStyle) | |
mstensho (USE GERRIT)
2017/03/07 10:04:26
Ditto - if you just return after the firstLineStyl
rune
2017/03/07 10:42:54
Done.
| |
1957 firstLineStyleDidChange(*oldPseudoStyle, *newPseudoStyle); | |
1958 else | |
1959 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); | |
1933 } | 1960 } |
1934 | 1961 |
1935 void LayoutObject::propagateStyleToAnonymousChildren() { | 1962 void LayoutObject::propagateStyleToAnonymousChildren() { |
1936 // FIXME: We could save this call when the change only affected non-inherited | 1963 // FIXME: We could save this call when the change only affected non-inherited |
1937 // properties. | 1964 // properties. |
1938 for (LayoutObject* child = slowFirstChild(); child; | 1965 for (LayoutObject* child = slowFirstChild(); child; |
1939 child = child->nextSibling()) { | 1966 child = child->nextSibling()) { |
1940 if (!child->isAnonymous() || child->style()->styleType() != PseudoIdNone) | 1967 if (!child->isAnonymous() || child->style()->styleType() != PseudoIdNone) |
1941 continue; | 1968 continue; |
1942 | 1969 |
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3569 const blink::LayoutObject* root = object1; | 3596 const blink::LayoutObject* root = object1; |
3570 while (root->parent()) | 3597 while (root->parent()) |
3571 root = root->parent(); | 3598 root = root->parent(); |
3572 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3599 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3573 } else { | 3600 } else { |
3574 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3601 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3575 } | 3602 } |
3576 } | 3603 } |
3577 | 3604 |
3578 #endif | 3605 #endif |
OLD | NEW |