OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
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 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 *errorString = "Internal error: could not set attribute value."; | 582 *errorString = "Internal error: could not set attribute value."; |
583 return; | 583 return; |
584 } | 584 } |
585 | 585 |
586 toHTMLElement(parsedElement.get())->setInnerHTML("<span " + value + "></span
>", ec); | 586 toHTMLElement(parsedElement.get())->setInnerHTML("<span " + value + "></span
>", ec); |
587 if (ec) { | 587 if (ec) { |
588 *errorString = "Could not parse value as attributes."; | 588 *errorString = "Could not parse value as attributes."; |
589 return; | 589 return; |
590 } | 590 } |
591 | 591 |
592 const NamedNodeMap* attrMap = toHTMLElement(parsedElement->firstChild())->at
tributes(true); | 592 Node* child = parsedElement->firstChild(); |
| 593 if (!child) { |
| 594 *errorString = "Could not parse value as attributes."; |
| 595 return; |
| 596 } |
| 597 |
| 598 const NamedNodeMap* attrMap = toHTMLElement(child)->attributes(true); |
593 if (!attrMap) { | 599 if (!attrMap) { |
594 element->removeAttribute(name, ec); | 600 element->removeAttribute(name, ec); |
595 if (ec) | 601 if (ec) |
596 *errorString = "Could not remove attribute."; | 602 *errorString = "Could not remove attribute."; |
597 return; | 603 return; |
598 } | 604 } |
599 | 605 |
600 bool foundOriginalAttribute = false; | 606 bool foundOriginalAttribute = false; |
601 unsigned numAttrs = attrMap->length(); | 607 unsigned numAttrs = attrMap->length(); |
602 for (unsigned i = 0; i < numAttrs; ++i) { | 608 for (unsigned i = 0; i < numAttrs; ++i) { |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 else if (m_highlightMode == "border") | 1442 else if (m_highlightMode == "border") |
1437 mode = DOMNodeHighlighter::HighlightBorder; | 1443 mode = DOMNodeHighlighter::HighlightBorder; |
1438 else if (m_highlightMode == "margin") | 1444 else if (m_highlightMode == "margin") |
1439 mode = DOMNodeHighlighter::HighlightMargin; | 1445 mode = DOMNodeHighlighter::HighlightMargin; |
1440 DOMNodeHighlighter::DrawNodeHighlight(context, m_highlightedNode.get(), mode
); | 1446 DOMNodeHighlighter::DrawNodeHighlight(context, m_highlightedNode.get(), mode
); |
1441 } | 1447 } |
1442 | 1448 |
1443 } // namespace WebCore | 1449 } // namespace WebCore |
1444 | 1450 |
1445 #endif // ENABLE(INSPECTOR) | 1451 #endif // ENABLE(INSPECTOR) |
OLD | NEW |