| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 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 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 LayoutRect drawingRect = localCaretRectWithoutUpdate(); | 1451 LayoutRect drawingRect = localCaretRectWithoutUpdate(); |
| 1452 RenderObject* renderer = caretRenderer(node); | 1452 RenderObject* renderer = caretRenderer(node); |
| 1453 if (renderer && renderer->isBox()) | 1453 if (renderer && renderer->isBox()) |
| 1454 toRenderBox(renderer)->flipForWritingMode(drawingRect); | 1454 toRenderBox(renderer)->flipForWritingMode(drawingRect); |
| 1455 drawingRect.moveBy(roundedIntPoint(paintOffset)); | 1455 drawingRect.moveBy(roundedIntPoint(paintOffset)); |
| 1456 LayoutRect caret = intersection(drawingRect, clipRect); | 1456 LayoutRect caret = intersection(drawingRect, clipRect); |
| 1457 if (caret.isEmpty()) | 1457 if (caret.isEmpty()) |
| 1458 return; | 1458 return; |
| 1459 | 1459 |
| 1460 Color caretColor = Color::black; | 1460 Color caretColor = Color::black; |
| 1461 ColorSpace colorSpace = ColorSpaceDeviceRGB; | |
| 1462 Element* element = node->rootEditableElement(); | 1461 Element* element = node->rootEditableElement(); |
| 1463 if (element && element->renderer()) { | 1462 if (element && element->renderer()) |
| 1464 caretColor = element->renderer()->style()->visitedDependentColor(CSSProp
ertyColor); | 1463 caretColor = element->renderer()->style()->visitedDependentColor(CSSProp
ertyColor); |
| 1465 colorSpace = element->renderer()->style()->colorSpace(); | |
| 1466 } | |
| 1467 | 1464 |
| 1468 context->fillRect(caret, caretColor, colorSpace); | 1465 context->fillRect(caret, caretColor); |
| 1469 } | 1466 } |
| 1470 | 1467 |
| 1471 void FrameSelection::debugRenderer(RenderObject *r, bool selected) const | 1468 void FrameSelection::debugRenderer(RenderObject *r, bool selected) const |
| 1472 { | 1469 { |
| 1473 if (r->node()->isElementNode()) { | 1470 if (r->node()->isElementNode()) { |
| 1474 Element* element = static_cast<Element *>(r->node()); | 1471 Element* element = static_cast<Element *>(r->node()); |
| 1475 fprintf(stderr, "%s%s\n", selected ? "==> " : " ", element->localName
().string().utf8().data()); | 1472 fprintf(stderr, "%s%s\n", selected ? "==> " : " ", element->localName
().string().utf8().data()); |
| 1476 } else if (r->isText()) { | 1473 } else if (r->isText()) { |
| 1477 RenderText* textRenderer = toRenderText(r); | 1474 RenderText* textRenderer = toRenderText(r); |
| 1478 if (!textRenderer->textLength() || !textRenderer->firstTextBox()) { | 1475 if (!textRenderer->textLength() || !textRenderer->firstTextBox()) { |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2068 sel.showTreeForThis(); | 2065 sel.showTreeForThis(); |
| 2069 } | 2066 } |
| 2070 | 2067 |
| 2071 void showTree(const WebCore::FrameSelection* sel) | 2068 void showTree(const WebCore::FrameSelection* sel) |
| 2072 { | 2069 { |
| 2073 if (sel) | 2070 if (sel) |
| 2074 sel->showTreeForThis(); | 2071 sel->showTreeForThis(); |
| 2075 } | 2072 } |
| 2076 | 2073 |
| 2077 #endif | 2074 #endif |
| OLD | NEW |