| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 | 945 |
| 946 // If we've found one corner, but not the other, | 946 // If we've found one corner, but not the other, |
| 947 // then we should just return a point at the corner that we did find. | 947 // then we should just return a point at the corner that we did find. |
| 948 if (foundUpperLeft != foundLowerRight) { | 948 if (foundUpperLeft != foundLowerRight) { |
| 949 if (foundUpperLeft) | 949 if (foundUpperLeft) |
| 950 lowerRight = upperLeft; | 950 lowerRight = upperLeft; |
| 951 else | 951 else |
| 952 upperLeft = lowerRight; | 952 upperLeft = lowerRight; |
| 953 } | 953 } |
| 954 | 954 |
| 955 return enclosingLayoutRect(FloatRect(upperLeft, lowerRight.expandedTo(upperL
eft) - upperLeft)); | 955 FloatSize size = lowerRight.expandedTo(upperLeft) - upperLeft; |
| 956 if (std::isnan(size.width()) || std::isnan(size.height())) |
| 957 return LayoutRect(); |
| 958 |
| 959 return enclosingLayoutRect(FloatRect(upperLeft, size)); |
| 956 } | 960 } |
| 957 | 961 |
| 958 // This is used by FrameSelection to denote when the active-state of the page ha
s changed | 962 // This is used by FrameSelection to denote when the active-state of the page ha
s changed |
| 959 // independent of the focused element changing. | 963 // independent of the focused element changing. |
| 960 void ContainerNode::focusStateChanged() | 964 void ContainerNode::focusStateChanged() |
| 961 { | 965 { |
| 962 // If we're just changing the window's active state and the focused node has
no | 966 // If we're just changing the window's active state and the focused node has
no |
| 963 // layoutObject we can just ignore the state change. | 967 // layoutObject we can just ignore the state change. |
| 964 if (!layoutObject()) | 968 if (!layoutObject()) |
| 965 return; | 969 return; |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 return true; | 1378 return true; |
| 1375 | 1379 |
| 1376 if (node->isElementNode() && toElement(node)->shadow()) | 1380 if (node->isElementNode() && toElement(node)->shadow()) |
| 1377 return true; | 1381 return true; |
| 1378 | 1382 |
| 1379 return false; | 1383 return false; |
| 1380 } | 1384 } |
| 1381 #endif | 1385 #endif |
| 1382 | 1386 |
| 1383 } // namespace blink | 1387 } // namespace blink |
| OLD | NEW |