| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 458 } |
| 459 | 459 |
| 460 static bool isElementPresentational(const Node* node) | 460 static bool isElementPresentational(const Node* node) |
| 461 { | 461 { |
| 462 if (node->hasTagName(uTag) || node->hasTagName(sTag) || node->hasTagName(str
ikeTag) | 462 if (node->hasTagName(uTag) || node->hasTagName(sTag) || node->hasTagName(str
ikeTag) |
| 463 || node->hasTagName(iTag) || node->hasTagName(emTag) || node->hasTagName
(bTag) || node->hasTagName(strongTag)) | 463 || node->hasTagName(iTag) || node->hasTagName(emTag) || node->hasTagName
(bTag) || node->hasTagName(strongTag)) |
| 464 return true; | 464 return true; |
| 465 RefPtr<CSSMutableStyleDeclaration> style = styleFromMatchedRulesAndInlineDec
l(node); | 465 RefPtr<CSSMutableStyleDeclaration> style = styleFromMatchedRulesAndInlineDec
l(node); |
| 466 if (!style) | 466 if (!style) |
| 467 return false; | 467 return false; |
| 468 return !propertyMissingOrEqualToNone(style.get(), CSSPropertyTextDecoration)
|| (!node->isBlockFlow() && !Editor::hasTransparentBackgroundColor(style.get())
); | 468 return !propertyMissingOrEqualToNone(style.get(), CSSPropertyTextDecoration)
|| !Editor::hasTransparentBackgroundColor(style.get()); |
| 469 } | 469 } |
| 470 | 470 |
| 471 static bool shouldIncludeWrapperForFullySelectedRoot(Node* fullySelectedRoot, CS
SMutableStyleDeclaration* style) | 471 static bool shouldIncludeWrapperForFullySelectedRoot(Node* fullySelectedRoot, CS
SMutableStyleDeclaration* style) |
| 472 { | 472 { |
| 473 if (fullySelectedRoot->isElementNode() && static_cast<Element*>(fullySelecte
dRoot)->hasAttribute(backgroundAttr)) | 473 if (fullySelectedRoot->isElementNode() && static_cast<Element*>(fullySelecte
dRoot)->hasAttribute(backgroundAttr)) |
| 474 return true; | 474 return true; |
| 475 | 475 |
| 476 return style->getPropertyCSSValue(CSSPropertyBackgroundImage) || style->getP
ropertyCSSValue(CSSPropertyBackgroundColor); | 476 return style->getPropertyCSSValue(CSSPropertyBackgroundImage) || style->getP
ropertyCSSValue(CSSPropertyBackgroundColor); |
| 477 } | 477 } |
| 478 | 478 |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 Vector<UChar> markup; | 908 Vector<UChar> markup; |
| 909 append(markup, "<a href=\""); | 909 append(markup, "<a href=\""); |
| 910 append(markup, url.string()); | 910 append(markup, url.string()); |
| 911 append(markup, "\">"); | 911 append(markup, "\">"); |
| 912 appendCharactersReplacingEntities(markup, title.characters(), title.length()
, EntityMaskInPCDATA); | 912 appendCharactersReplacingEntities(markup, title.characters(), title.length()
, EntityMaskInPCDATA); |
| 913 append(markup, "</a>"); | 913 append(markup, "</a>"); |
| 914 return String::adopt(markup); | 914 return String::adopt(markup); |
| 915 } | 915 } |
| 916 | 916 |
| 917 } | 917 } |
| OLD | NEW |