| 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 * 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 inlineStyle->forceInline(); | 399 inlineStyle->forceInline(); |
| 400 return inlineStyle; | 400 return inlineStyle; |
| 401 } | 401 } |
| 402 | 402 |
| 403 template<typename Strategy> | 403 template<typename Strategy> |
| 404 void StyledMarkupTraverser<Strategy>::appendStartMarkup(Node& node) | 404 void StyledMarkupTraverser<Strategy>::appendStartMarkup(Node& node) |
| 405 { | 405 { |
| 406 if (!m_accumulator) | 406 if (!m_accumulator) |
| 407 return; | 407 return; |
| 408 switch (node.getNodeType()) { | 408 switch (node.getNodeType()) { |
| 409 case Node::TEXT_NODE: { | 409 case Node::kTextNode: { |
| 410 Text& text = toText(node); | 410 Text& text = toText(node); |
| 411 if (text.parentElement() && isHTMLTextAreaElement(text.parentElement()))
{ | 411 if (text.parentElement() && isHTMLTextAreaElement(text.parentElement()))
{ |
| 412 m_accumulator->appendText(text); | 412 m_accumulator->appendText(text); |
| 413 break; | 413 break; |
| 414 } | 414 } |
| 415 EditingStyle* inlineStyle = nullptr; | 415 EditingStyle* inlineStyle = nullptr; |
| 416 if (shouldApplyWrappingStyle(text)) { | 416 if (shouldApplyWrappingStyle(text)) { |
| 417 inlineStyle = m_wrappingStyle->copy(); | 417 inlineStyle = m_wrappingStyle->copy(); |
| 418 // FIXME: <rdar://problem/5371536> Style rules that match pasted con
tent can change it's appearance | 418 // FIXME: <rdar://problem/5371536> Style rules that match pasted con
tent can change it's appearance |
| 419 // Make sure spans are inline style in paste side e.g. span { displa
y: block }. | 419 // Make sure spans are inline style in paste side e.g. span { displa
y: block }. |
| 420 inlineStyle->forceInline(); | 420 inlineStyle->forceInline(); |
| 421 // FIXME: Should this be included in forceInline? | 421 // FIXME: Should this be included in forceInline? |
| 422 inlineStyle->style()->setProperty(CSSPropertyFloat, CSSValueNone); | 422 inlineStyle->style()->setProperty(CSSPropertyFloat, CSSValueNone); |
| 423 } | 423 } |
| 424 m_accumulator->appendTextWithInlineStyle(text, inlineStyle); | 424 m_accumulator->appendTextWithInlineStyle(text, inlineStyle); |
| 425 break; | 425 break; |
| 426 } | 426 } |
| 427 case Node::ELEMENT_NODE: { | 427 case Node::kElementNode: { |
| 428 Element& element = toElement(node); | 428 Element& element = toElement(node); |
| 429 if ((element.isHTMLElement() && shouldAnnotate()) || shouldApplyWrapping
Style(element)) { | 429 if ((element.isHTMLElement() && shouldAnnotate()) || shouldApplyWrapping
Style(element)) { |
| 430 EditingStyle* inlineStyle = createInlineStyle(element); | 430 EditingStyle* inlineStyle = createInlineStyle(element); |
| 431 m_accumulator->appendElementWithInlineStyle(element, inlineStyle); | 431 m_accumulator->appendElementWithInlineStyle(element, inlineStyle); |
| 432 break; | 432 break; |
| 433 } | 433 } |
| 434 m_accumulator->appendElement(element); | 434 m_accumulator->appendElement(element); |
| 435 break; | 435 break; |
| 436 } | 436 } |
| 437 default: | 437 default: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 if (element.isHTMLElement() && shouldAnnotate()) | 474 if (element.isHTMLElement() && shouldAnnotate()) |
| 475 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)
); | 475 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)
); |
| 476 | 476 |
| 477 return inlineStyle; | 477 return inlineStyle; |
| 478 } | 478 } |
| 479 | 479 |
| 480 template class StyledMarkupSerializer<EditingStrategy>; | 480 template class StyledMarkupSerializer<EditingStrategy>; |
| 481 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; | 481 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; |
| 482 | 482 |
| 483 } // namespace blink | 483 } // namespace blink |
| OLD | NEW |