OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2009 Igalia S.L. | 4 * Copyright (C) 2009 Igalia S.L. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "bindings/core/v8/ExceptionState.h" | 31 #include "bindings/core/v8/ExceptionState.h" |
32 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 32 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
33 #include "core/CSSPropertyNames.h" | 33 #include "core/CSSPropertyNames.h" |
34 #include "core/CSSValueKeywords.h" | 34 #include "core/CSSValueKeywords.h" |
35 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
36 #include "core/clipboard/Pasteboard.h" | 36 #include "core/clipboard/Pasteboard.h" |
37 #include "core/css/CSSValueList.h" | 37 #include "core/css/CSSValueList.h" |
38 #include "core/css/StylePropertySet.h" | 38 #include "core/css/StylePropertySet.h" |
39 #include "core/dom/DocumentFragment.h" | 39 #include "core/dom/DocumentFragment.h" |
40 #include "core/editing/CreateLinkCommand.h" | |
41 #include "core/editing/EditingUtilities.h" | 40 #include "core/editing/EditingUtilities.h" |
42 #include "core/editing/FormatBlockCommand.h" | |
43 #include "core/editing/FrameSelection.h" | 41 #include "core/editing/FrameSelection.h" |
44 #include "core/editing/IndentOutdentCommand.h" | 42 #include "core/editing/commands/CreateLinkCommand.h" |
45 #include "core/editing/InsertListCommand.h" | 43 #include "core/editing/commands/FormatBlockCommand.h" |
46 #include "core/editing/ReplaceSelectionCommand.h" | 44 #include "core/editing/commands/IndentOutdentCommand.h" |
47 #include "core/editing/TypingCommand.h" | 45 #include "core/editing/commands/InsertListCommand.h" |
48 #include "core/editing/UnlinkCommand.h" | 46 #include "core/editing/commands/ReplaceSelectionCommand.h" |
| 47 #include "core/editing/commands/TypingCommand.h" |
| 48 #include "core/editing/commands/UnlinkCommand.h" |
49 #include "core/editing/serializers/Serialization.h" | 49 #include "core/editing/serializers/Serialization.h" |
50 #include "core/editing/spellcheck/SpellChecker.h" | 50 #include "core/editing/spellcheck/SpellChecker.h" |
51 #include "core/events/Event.h" | 51 #include "core/events/Event.h" |
52 #include "core/frame/FrameHost.h" | 52 #include "core/frame/FrameHost.h" |
53 #include "core/frame/FrameView.h" | 53 #include "core/frame/FrameView.h" |
54 #include "core/frame/LocalFrame.h" | 54 #include "core/frame/LocalFrame.h" |
55 #include "core/frame/Settings.h" | 55 #include "core/frame/Settings.h" |
56 #include "core/html/HTMLFontElement.h" | 56 #include "core/html/HTMLFontElement.h" |
57 #include "core/html/HTMLHRElement.h" | 57 #include "core/html/HTMLHRElement.h" |
58 #include "core/html/HTMLImageElement.h" | 58 #include "core/html/HTMLImageElement.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 RefPtrWillBeRawPtr<CSSValue> selectedCSSValue = selectionStyle->style()->get
PropertyCSSValue(propertyID); | 144 RefPtrWillBeRawPtr<CSSValue> selectedCSSValue = selectionStyle->style()->get
PropertyCSSValue(propertyID); |
145 String newStyle("none"); | 145 String newStyle("none"); |
146 if (selectedCSSValue->isValueList()) { | 146 if (selectedCSSValue->isValueList()) { |
147 RefPtrWillBeRawPtr<CSSValueList> selectedCSSValueList = toCSSValueList(s
electedCSSValue.get()); | 147 RefPtrWillBeRawPtr<CSSValueList> selectedCSSValueList = toCSSValueList(s
electedCSSValue.get()); |
148 if (!selectedCSSValueList->removeAll(value)) | 148 if (!selectedCSSValueList->removeAll(value)) |
149 selectedCSSValueList->append(value); | 149 selectedCSSValueList->append(value); |
150 if (selectedCSSValueList->length()) | 150 if (selectedCSSValueList->length()) |
151 newStyle = selectedCSSValueList->cssText(); | 151 newStyle = selectedCSSValueList->cssText(); |
152 | 152 |
153 } else if (selectedCSSValue->cssText() == "none") | 153 } else if (selectedCSSValue->cssText() == "none") { |
154 newStyle = value->cssText(); | 154 newStyle = value->cssText(); |
| 155 } |
155 | 156 |
156 // FIXME: We shouldn't be having to convert new style into text. We should
have setPropertyCSSValue. | 157 // FIXME: We shouldn't be having to convert new style into text. We should
have setPropertyCSSValue. |
157 RefPtrWillBeRawPtr<MutableStylePropertySet> newMutableStyle = MutableStylePr
opertySet::create(); | 158 RefPtrWillBeRawPtr<MutableStylePropertySet> newMutableStyle = MutableStylePr
opertySet::create(); |
158 newMutableStyle->setProperty(propertyID, newStyle); | 159 newMutableStyle->setProperty(propertyID, newStyle); |
159 return applyCommandToFrame(frame, source, action, newMutableStyle.get()); | 160 return applyCommandToFrame(frame, source, action, newMutableStyle.get()); |
160 } | 161 } |
161 | 162 |
162 static bool executeToggleStyle(LocalFrame& frame, EditorCommandSource source, Ed
itAction action, CSSPropertyID propertyID, const char* offValue, const char* onV
alue) | 163 static bool executeToggleStyle(LocalFrame& frame, EditorCommandSource source, Ed
itAction action, CSSPropertyID propertyID, const char* offValue, const char* onV
alue) |
163 { | 164 { |
164 // Style is considered present when | 165 // Style is considered present when |
(...skipping 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 { | 1791 { |
1791 return m_command && m_command->isTextInsertion; | 1792 return m_command && m_command->isTextInsertion; |
1792 } | 1793 } |
1793 | 1794 |
1794 int Editor::Command::idForHistogram() const | 1795 int Editor::Command::idForHistogram() const |
1795 { | 1796 { |
1796 return isSupported() ? m_command->idForUserMetrics : 0; | 1797 return isSupported() ? m_command->idForUserMetrics : 0; |
1797 } | 1798 } |
1798 | 1799 |
1799 } // namespace blink | 1800 } // namespace blink |
OLD | NEW |