OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 element->document()->setHasNodesWithPlaceholderStyle(); | 950 element->document()->setHasNodesWithPlaceholderStyle(); |
951 return s_styleNotYetAvailable; | 951 return s_styleNotYetAvailable; |
952 } | 952 } |
953 | 953 |
954 State& state = m_state; | 954 State& state = m_state; |
955 initElement(element); | 955 initElement(element); |
956 state.initForStyleResolve(document(), element, defaultParent, regionForStyli
ng); | 956 state.initForStyleResolve(document(), element, defaultParent, regionForStyli
ng); |
957 if (sharingBehavior == AllowStyleSharing && !state.distributedToInsertionPoi
nt()) { | 957 if (sharingBehavior == AllowStyleSharing && !state.distributedToInsertionPoi
nt()) { |
958 RenderStyle* sharedStyle = locateSharedStyle(); | 958 RenderStyle* sharedStyle = locateSharedStyle(); |
959 if (sharedStyle) | 959 if (sharedStyle) |
| 960 { |
| 961 state.clear(); |
960 return sharedStyle; | 962 return sharedStyle; |
| 963 } |
961 } | 964 } |
962 | 965 |
963 if (state.parentStyle()) { | 966 if (state.parentStyle()) { |
964 state.setStyle(RenderStyle::create()); | 967 state.setStyle(RenderStyle::create()); |
965 state.style()->inheritFrom(state.parentStyle(), isAtShadowBoundary(eleme
nt) ? RenderStyle::AtShadowBoundary : RenderStyle::NotAtShadowBoundary); | 968 state.style()->inheritFrom(state.parentStyle(), isAtShadowBoundary(eleme
nt) ? RenderStyle::AtShadowBoundary : RenderStyle::NotAtShadowBoundary); |
966 } else { | 969 } else { |
967 state.setStyle(defaultStyleForElement()); | 970 state.setStyle(defaultStyleForElement()); |
968 state.setParentStyle(RenderStyle::clone(state.style())); | 971 state.setParentStyle(RenderStyle::clone(state.style())); |
969 } | 972 } |
970 // contenteditable attribute (implemented by -webkit-user-modify) should | 973 // contenteditable attribute (implemented by -webkit-user-modify) should |
(...skipping 3442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4413 info.addMember(m_state, "state"); | 4416 info.addMember(m_state, "state"); |
4414 | 4417 |
4415 // FIXME: move this to a place where it would be called only once? | 4418 // FIXME: move this to a place where it would be called only once? |
4416 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); | 4419 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); |
4417 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl
e"); | 4420 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl
e"); |
4418 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle,"defaultPrintStyle")
; | 4421 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle,"defaultPrintStyle")
; |
4419 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo
urceStyle"); | 4422 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo
urceStyle"); |
4420 } | 4423 } |
4421 | 4424 |
4422 } // namespace WebCore | 4425 } // namespace WebCore |
OLD | NEW |