Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: Source/core/editing/ApplyStyleCommand.cpp

Issue 119533003: Clear mutable inline style when it is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed typo. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/editing/RemoveCSSPropertyCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 return style->conflictsWithInlineStyleOfElement(element); 950 return style->conflictsWithInlineStyleOfElement(element);
951 951
952 Vector<CSSPropertyID> properties; 952 Vector<CSSPropertyID> properties;
953 if (!style->conflictsWithInlineStyleOfElement(element, extractedStyle, prope rties)) 953 if (!style->conflictsWithInlineStyleOfElement(element, extractedStyle, prope rties))
954 return false; 954 return false;
955 955
956 // FIXME: We should use a mass-removal function here but we don't have an un doable one yet. 956 // FIXME: We should use a mass-removal function here but we don't have an un doable one yet.
957 for (size_t i = 0; i < properties.size(); i++) 957 for (size_t i = 0; i < properties.size(); i++)
958 removeCSSProperty(element, properties[i]); 958 removeCSSProperty(element, properties[i]);
959 959
960 // No need to serialize <foo style=""> if we just removed the last css prope rty
961 if (element->inlineStyle()->isEmpty())
962 removeNodeAttribute(element, styleAttr);
963
964 if (isSpanWithoutAttributesOrUnstyledStyleSpan(element)) 960 if (isSpanWithoutAttributesOrUnstyledStyleSpan(element))
965 removeNodePreservingChildren(element); 961 removeNodePreservingChildren(element);
966 962
967 return true; 963 return true;
968 } 964 }
969 965
970 HTMLElement* ApplyStyleCommand::highestAncestorWithConflictingInlineStyle(Editin gStyle* style, Node* node) 966 HTMLElement* ApplyStyleCommand::highestAncestorWithConflictingInlineStyle(Editin gStyle* style, Node* node)
971 { 967 {
972 if (!node) 968 if (!node)
973 return 0; 969 return 0;
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 String textToMove = nextText->data(); 1543 String textToMove = nextText->data();
1548 insertTextIntoNode(childText, childText->length(), textToMove); 1544 insertTextIntoNode(childText, childText->length(), textToMove);
1549 removeNode(next); 1545 removeNode(next);
1550 // don't move child node pointer. it may want to merge with more text no des. 1546 // don't move child node pointer. it may want to merge with more text no des.
1551 } 1547 }
1552 1548
1553 updateStartEnd(newStart, newEnd); 1549 updateStartEnd(newStart, newEnd);
1554 } 1550 }
1555 1551
1556 } 1552 }
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/editing/RemoveCSSPropertyCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698