| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 RenderBox* block; | 148 RenderBox* block; |
| 149 if (renderer->isBox()) | 149 if (renderer->isBox()) |
| 150 block = toRenderBox(renderer); | 150 block = toRenderBox(renderer); |
| 151 else | 151 else |
| 152 block = renderer->containingBlock(); | 152 block = renderer->containingBlock(); |
| 153 LayoutUnit physicalStart = block->flipForWritingMode(logicalTop); | 153 LayoutUnit physicalStart = block->flipForWritingMode(logicalTop); |
| 154 LayoutUnit physicalEnd = block->flipForWritingMode(logicalBottom); | 154 LayoutUnit physicalEnd = block->flipForWritingMode(logicalBottom); |
| 155 LayoutUnit physicalExtent = absoluteValue(physicalEnd - physicalStart); | 155 LayoutUnit physicalExtent = absoluteValue(physicalEnd - physicalStart); |
| 156 physicalStart = std::min(physicalStart, physicalEnd); | 156 physicalStart = std::min(physicalStart, physicalEnd); |
| 157 | 157 |
| 158 if (renderer->style()->isHorizontalWritingMode()) { | 158 physicalStart += offset.y(); |
| 159 physicalStart += offset.y(); | 159 if (physicalStart >= rect.maxY() || physicalStart + physicalExtent <= rect.y
()) |
| 160 if (physicalStart >= rect.maxY() || physicalStart + physicalExtent <= re
ct.y()) | 160 return false; |
| 161 return false; | |
| 162 } else { | |
| 163 physicalStart += offset.x(); | |
| 164 if (physicalStart >= rect.maxX() || physicalStart + physicalExtent <= re
ct.x()) | |
| 165 return false; | |
| 166 } | |
| 167 | 161 |
| 168 return true; | 162 return true; |
| 169 } | 163 } |
| 170 | 164 |
| 171 bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, co
nst LayoutRect& rect, const LayoutPoint& offset) const | 165 bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, co
nst LayoutRect& rect, const LayoutPoint& offset) const |
| 172 { | 166 { |
| 173 // We can check the first box and last box and avoid painting/hit testing if
we don't | 167 // We can check the first box and last box and avoid painting/hit testing if
we don't |
| 174 // intersect. This is a quick short-circuit that we can take to avoid walki
ng any lines. | 168 // intersect. This is a quick short-circuit that we can take to avoid walki
ng any lines. |
| 175 // FIXME: This check is flawed in the following extremely obscure way: | 169 // FIXME: This check is flawed in the following extremely obscure way: |
| 176 // if some line in the middle has a huge overflow, it might actually extend
below the last line. | 170 // if some line in the middle has a huge overflow, it might actually extend
below the last line. |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 ASSERT(child->prevLineBox() == prev); | 360 ASSERT(child->prevLineBox() == prev); |
| 367 prev = child; | 361 prev = child; |
| 368 } | 362 } |
| 369 ASSERT(prev == m_lastLineBox); | 363 ASSERT(prev == m_lastLineBox); |
| 370 #endif | 364 #endif |
| 371 } | 365 } |
| 372 | 366 |
| 373 #endif | 367 #endif |
| 374 | 368 |
| 375 } | 369 } |
| OLD | NEW |