Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Side by Side Diff: Source/modules/accessibility/AXLayoutObject.cpp

Issue 1182483002: Fixed crash by checking if m_layoutObject->node() is not nullptr before calling isContentRichlyEdit… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 static bool isLinkable(const AXObject& object) 368 static bool isLinkable(const AXObject& object)
369 { 369 {
370 if (!object.layoutObject()) 370 if (!object.layoutObject())
371 return false; 371 return false;
372 372
373 // See https://wiki.mozilla.org/Accessibility/AT-Windows-API for the element s 373 // See https://wiki.mozilla.org/Accessibility/AT-Windows-API for the element s
374 // Mozilla considers linkable. 374 // Mozilla considers linkable.
375 return object.isLink() || object.isImage() || object.layoutObject()->isText( ); 375 return object.isLink() || object.isImage() || object.layoutObject()->isText( );
376 } 376 }
377 377
378 // Requires layoutObject to be present because it relies on style
379 // user-modify. Don't move this logic to AXNodeObject.
380 // TODO(nektar): Implement support in AXNodeObject for aria-hidden and canvas.
378 bool AXLayoutObject::isRichlyEditable() const 381 bool AXLayoutObject::isRichlyEditable() const
379 { 382 {
380 ASSERT(node()); 383 if (node() && node()->isContentRichlyEditable())
381 ASSERT(m_layoutObject);
382
383 // Requires m_layoutObject to be present because it relies on style
384 // user-modify. Don't move this logic to AXNodeObject.
385 // TODO(nektar): Implement support in AXNodeObject for aria-hidden and canva s.
386 if (node()->isContentRichlyEditable())
387 return true; 384 return true;
388 385
389 if (isWebArea()) { 386 if (isWebArea()) {
390 Document& document = m_layoutObject->document(); 387 Document& document = m_layoutObject->document();
391 HTMLElement* body = document.body(); 388 HTMLElement* body = document.body();
392 if (body && body->isContentRichlyEditable()) 389 if (body && body->isContentRichlyEditable())
393 return true; 390 return true;
394 391
395 return document.isContentRichlyEditable(); 392 return document.isContentRichlyEditable();
396 } 393 }
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 if (label && label->layoutObject()) { 2507 if (label && label->layoutObject()) {
2511 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2508 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2512 result.unite(labelRect); 2509 result.unite(labelRect);
2513 } 2510 }
2514 } 2511 }
2515 2512
2516 return result; 2513 return result;
2517 } 2514 }
2518 2515
2519 } // namespace blink 2516 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698