| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 bool TreeScope::isInclusiveAncestorOf(const TreeScope& scope) const | 362 bool TreeScope::isInclusiveAncestorOf(const TreeScope& scope) const |
| 363 { | 363 { |
| 364 for (const TreeScope* current = &scope; current; current = current->parentTr
eeScope()) { | 364 for (const TreeScope* current = &scope; current; current = current->parentTr
eeScope()) { |
| 365 if (current == this) | 365 if (current == this) |
| 366 return true; | 366 return true; |
| 367 } | 367 } |
| 368 return false; | 368 return false; |
| 369 } | 369 } |
| 370 | 370 |
| 371 Element* TreeScope::getElementByAccessKey(const String& key) const | |
| 372 { | |
| 373 if (key.isEmpty()) | |
| 374 return 0; | |
| 375 Element* result = 0; | |
| 376 Node& root = rootNode(); | |
| 377 for (Element* element = ElementTraversal::firstWithin(root); element; elemen
t = ElementTraversal::next(*element, &root)) { | |
| 378 if (equalIgnoringCase(element->getAttribute(HTMLNames::accesskeyAttr), k
ey)) | |
| 379 result = element; | |
| 380 if (ShadowRoot* shadowRoot = element->shadowRoot()) { | |
| 381 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) | |
| 382 result = shadowResult; | |
| 383 } | |
| 384 } | |
| 385 return result; | |
| 386 } | |
| 387 | |
| 388 void TreeScope::setNeedsStyleRecalcForViewportUnits() | 371 void TreeScope::setNeedsStyleRecalcForViewportUnits() |
| 389 { | 372 { |
| 390 for (Element* element = ElementTraversal::firstWithin(rootNode()); element;
element = ElementTraversal::next(*element)) { | 373 for (Element* element = ElementTraversal::firstWithin(rootNode()); element;
element = ElementTraversal::next(*element)) { |
| 391 if (ShadowRoot* root = element->shadowRoot()) | 374 if (ShadowRoot* root = element->shadowRoot()) |
| 392 root->setNeedsStyleRecalcForViewportUnits(); | 375 root->setNeedsStyleRecalcForViewportUnits(); |
| 393 RenderStyle* style = element->renderStyle(); | 376 RenderStyle* style = element->renderStyle(); |
| 394 if (style && style->hasViewportUnits()) | 377 if (style && style->hasViewportUnits()) |
| 395 element->setNeedsStyleRecalc(LocalStyleChange); | 378 element->setNeedsStyleRecalc(LocalStyleChange); |
| 396 } | 379 } |
| 397 } | 380 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 408 | 391 |
| 409 for (size_t i = 0; i < list.size(); i++) { | 392 for (size_t i = 0; i < list.size(); i++) { |
| 410 if (list[i]->contents() != otherList[i]->contents()) | 393 if (list[i]->contents() != otherList[i]->contents()) |
| 411 return false; | 394 return false; |
| 412 } | 395 } |
| 413 | 396 |
| 414 return true; | 397 return true; |
| 415 } | 398 } |
| 416 | 399 |
| 417 } // namespace blink | 400 } // namespace blink |
| OLD | NEW |