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 if (oldStyle.hasPseudoStyle(PseudoIdFirstLine)) { |
| 1951 RefPtr<ComputedStyle> oldPseudoStyle = |
| 1952 oldStyle.getCachedPseudoStyle(PseudoIdFirstLine); |
| 1953 if (styleRef().hasPseudoStyle(PseudoIdFirstLine) && oldPseudoStyle) { |
| 1954 RefPtr<ComputedStyle> newPseudoStyle = |
| 1955 uncachedFirstLineStyle(mutableStyle()); |
| 1956 if (newPseudoStyle) { |
| 1957 firstLineStyleDidChange(*oldPseudoStyle, *newPseudoStyle); |
| 1958 return; |
| 1959 } |
| 1960 } |
| 1961 } |
| 1962 setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::StyleChange); |
1933 } | 1963 } |
1934 | 1964 |
1935 void LayoutObject::propagateStyleToAnonymousChildren() { | 1965 void LayoutObject::propagateStyleToAnonymousChildren() { |
1936 // FIXME: We could save this call when the change only affected non-inherited | 1966 // FIXME: We could save this call when the change only affected non-inherited |
1937 // properties. | 1967 // properties. |
1938 for (LayoutObject* child = slowFirstChild(); child; | 1968 for (LayoutObject* child = slowFirstChild(); child; |
1939 child = child->nextSibling()) { | 1969 child = child->nextSibling()) { |
1940 if (!child->isAnonymous() || child->style()->styleType() != PseudoIdNone) | 1970 if (!child->isAnonymous() || child->style()->styleType() != PseudoIdNone) |
1941 continue; | 1971 continue; |
1942 | 1972 |
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3569 const blink::LayoutObject* root = object1; | 3599 const blink::LayoutObject* root = object1; |
3570 while (root->parent()) | 3600 while (root->parent()) |
3571 root = root->parent(); | 3601 root = root->parent(); |
3572 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3602 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3573 } else { | 3603 } else { |
3574 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3604 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3575 } | 3605 } |
3576 } | 3606 } |
3577 | 3607 |
3578 #endif | 3608 #endif |
OLD | NEW |