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

Side by Side Diff: sky/engine/core/editing/markup.cpp

Issue 708233002: Remove many attributes. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/dom/Document.cpp ('k') | sky/engine/core/html/HTMLAttributeNames.in » ('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) 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 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2011 Igalia S.L. 4 * Copyright (C) 2011 Igalia S.L.
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 469 }
470 470
471 Node* lastClosed = accumulator.serializeNodes(startNode, pastEnd); 471 Node* lastClosed = accumulator.serializeNodes(startNode, pastEnd);
472 472
473 if (specialCommonAncestor && lastClosed) { 473 if (specialCommonAncestor && lastClosed) {
474 // Also include all of the ancestors of lastClosed up to this special an cestor. 474 // Also include all of the ancestors of lastClosed up to this special an cestor.
475 for (ContainerNode* ancestor = lastClosed->parentNode(); ancestor; ances tor = ancestor->parentNode()) { 475 for (ContainerNode* ancestor = lastClosed->parentNode(); ancestor; ances tor = ancestor->parentNode()) {
476 if (ancestor == fullySelectedRoot && !convertBlocksToInlines) { 476 if (ancestor == fullySelectedRoot && !convertBlocksToInlines) {
477 RefPtr<EditingStyle> fullySelectedRootStyle = styleFromMatchedRu lesAndInlineDecl(fullySelectedRoot); 477 RefPtr<EditingStyle> fullySelectedRootStyle = styleFromMatchedRu lesAndInlineDecl(fullySelectedRoot);
478 478
479 // Bring the background attribute over, but not as an attribute because a background attribute on a div
480 // appears to have no effect.
481 if ((!fullySelectedRootStyle || !fullySelectedRootStyle->style() || !fullySelectedRootStyle->style()->getPropertyCSSValue(CSSPropertyBackgroundI mage))
482 && fullySelectedRoot->hasAttribute(HTMLNames::backgroundAttr ))
483 fullySelectedRootStyle->style()->setProperty(CSSPropertyBack groundImage, "url('" + fullySelectedRoot->getAttribute(HTMLNames::backgroundAttr ) + "')");
484
485 if (fullySelectedRootStyle->style()) { 479 if (fullySelectedRootStyle->style()) {
486 // Reset the CSS properties to avoid an assertion error in a ddStyleMarkup(). 480 // Reset the CSS properties to avoid an assertion error in a ddStyleMarkup().
487 // This assertion is caused at least when we select all text of a <body> element whose 481 // This assertion is caused at least when we select all text of a <body> element whose
488 // 'text-decoration' property is "inherit", and copy it. 482 // 'text-decoration' property is "inherit", and copy it.
489 if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->st yle(), CSSPropertyTextDecoration)) 483 if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->st yle(), CSSPropertyTextDecoration))
490 fullySelectedRootStyle->style()->setProperty(CSSProperty TextDecoration, CSSValueNone); 484 fullySelectedRootStyle->style()->setProperty(CSSProperty TextDecoration, CSSValueNone);
491 if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->st yle(), CSSPropertyWebkitTextDecorationsInEffect)) 485 if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->st yle(), CSSPropertyWebkitTextDecorationsInEffect))
492 fullySelectedRootStyle->style()->setProperty(CSSProperty WebkitTextDecorationsInEffect, CSSValueNone); 486 fullySelectedRootStyle->style()->setProperty(CSSProperty WebkitTextDecorationsInEffect, CSSValueNone);
493 accumulator.wrapWithStyleNode(fullySelectedRootStyle->style( ), document, true); 487 accumulator.wrapWithStyleNode(fullySelectedRootStyle->style( ), document, true);
494 } 488 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 if (!next || !next->isTextNode()) 559 if (!next || !next->isTextNode())
566 return; 560 return;
567 561
568 RefPtr<Text> textNext = toText(next); 562 RefPtr<Text> textNext = toText(next);
569 textNode->appendData(textNext->data()); 563 textNode->appendData(textNext->data());
570 if (textNext->parentNode()) // Might have been removed by mutation event. 564 if (textNext->parentNode()) // Might have been removed by mutation event.
571 textNext->remove(exceptionState); 565 textNext->remove(exceptionState);
572 } 566 }
573 567
574 } 568 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Document.cpp ('k') | sky/engine/core/html/HTMLAttributeNames.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698