OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 if (renderer->style()->visibility() != VISIBLE) | 858 if (renderer->style()->visibility() != VISIBLE) |
859 return false; | 859 return false; |
860 | 860 |
861 if (renderer->isBR()) | 861 if (renderer->isBR()) |
862 // FIXME: The condition should be m_anchorType == PositionIsBeforeAnchor
, but for now we still need to support legacy positions. | 862 // FIXME: The condition should be m_anchorType == PositionIsBeforeAnchor
, but for now we still need to support legacy positions. |
863 return !m_offset && m_anchorType != PositionIsAfterAnchor && !nodeIsUser
SelectNone(deprecatedNode()->parentNode()); | 863 return !m_offset && m_anchorType != PositionIsAfterAnchor && !nodeIsUser
SelectNone(deprecatedNode()->parentNode()); |
864 | 864 |
865 if (renderer->isText()) | 865 if (renderer->isText()) |
866 return !nodeIsUserSelectNone(deprecatedNode()) && inRenderedText(); | 866 return !nodeIsUserSelectNone(deprecatedNode()) && inRenderedText(); |
867 | 867 |
| 868 if (renderer->isSVG()) { |
| 869 // We don't consider SVG elements are contenteditable except for |
| 870 // associated renderer returns isText() true, e.g. RenderSVGInlineText. |
| 871 return false; |
| 872 } |
| 873 |
868 if (isRenderedTableElement(deprecatedNode()) || editingIgnoresContent(deprec
atedNode())) | 874 if (isRenderedTableElement(deprecatedNode()) || editingIgnoresContent(deprec
atedNode())) |
869 return (atFirstEditingPositionForNode() || atLastEditingPositionForNode(
)) && !nodeIsUserSelectNone(deprecatedNode()->parentNode()); | 875 return (atFirstEditingPositionForNode() || atLastEditingPositionForNode(
)) && !nodeIsUserSelectNone(deprecatedNode()->parentNode()); |
870 | 876 |
871 if (isHTMLHtmlElement(*m_anchorNode)) | 877 if (isHTMLHtmlElement(*m_anchorNode)) |
872 return false; | 878 return false; |
873 | 879 |
874 if (renderer->isRenderBlockFlow()) { | 880 if (renderer->isRenderBlockFlow()) { |
875 if (toRenderBlock(renderer)->logicalHeight() || isHTMLBodyElement(*m_anc
horNode)) { | 881 if (toRenderBlock(renderer)->logicalHeight() || isHTMLBodyElement(*m_anc
horNode)) { |
876 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer
)) | 882 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer
)) |
877 return atFirstEditingPositionForNode() && !Position::nodeIsUserS
electNone(deprecatedNode()); | 883 return atFirstEditingPositionForNode() && !Position::nodeIsUserS
electNone(deprecatedNode()); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 pos.showTreeForThis(); | 1370 pos.showTreeForThis(); |
1365 } | 1371 } |
1366 | 1372 |
1367 void showTree(const WebCore::Position* pos) | 1373 void showTree(const WebCore::Position* pos) |
1368 { | 1374 { |
1369 if (pos) | 1375 if (pos) |
1370 pos->showTreeForThis(); | 1376 pos->showTreeForThis(); |
1371 } | 1377 } |
1372 | 1378 |
1373 #endif | 1379 #endif |
OLD | NEW |