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

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

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 1318
1319 return !ariaOwns.isEmpty(); 1319 return !ariaOwns.isEmpty();
1320 } 1320 }
1321 1321
1322 // 1322 //
1323 // ARIA live-region features. 1323 // ARIA live-region features.
1324 // 1324 //
1325 1325
1326 const AtomicString& AXLayoutObject::liveRegionStatus() const 1326 const AtomicString& AXLayoutObject::liveRegionStatus() const
1327 { 1327 {
1328 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusAssertive, ("asserti ve", AtomicString::ConstructFromLiteral)); 1328 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusAssertive, ("asserti ve"));
1329 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusPolite, ("polite", A tomicString::ConstructFromLiteral)); 1329 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusPolite, ("polite"));
1330 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusOff, ("off", AtomicS tring::ConstructFromLiteral)); 1330 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusOff, ("off"));
1331 1331
1332 const AtomicString& liveRegionStatus = getAttribute(aria_liveAttr); 1332 const AtomicString& liveRegionStatus = getAttribute(aria_liveAttr);
1333 // These roles have implicit live region status. 1333 // These roles have implicit live region status.
1334 if (liveRegionStatus.isEmpty()) { 1334 if (liveRegionStatus.isEmpty()) {
1335 switch (roleValue()) { 1335 switch (roleValue()) {
1336 case AlertDialogRole: 1336 case AlertDialogRole:
1337 case AlertRole: 1337 case AlertRole:
1338 return liveRegionStatusAssertive; 1338 return liveRegionStatusAssertive;
1339 case LogRole: 1339 case LogRole:
1340 case StatusRole: 1340 case StatusRole:
1341 return liveRegionStatusPolite; 1341 return liveRegionStatusPolite;
1342 case TimerRole: 1342 case TimerRole:
1343 case MarqueeRole: 1343 case MarqueeRole:
1344 return liveRegionStatusOff; 1344 return liveRegionStatusOff;
1345 default: 1345 default:
1346 break; 1346 break;
1347 } 1347 }
1348 } 1348 }
1349 1349
1350 return liveRegionStatus; 1350 return liveRegionStatus;
1351 } 1351 }
1352 1352
1353 const AtomicString& AXLayoutObject::liveRegionRelevant() const 1353 const AtomicString& AXLayoutObject::liveRegionRelevant() const
1354 { 1354 {
1355 DEFINE_STATIC_LOCAL(const AtomicString, defaultLiveRegionRelevant, ("additio ns text", AtomicString::ConstructFromLiteral)); 1355 DEFINE_STATIC_LOCAL(const AtomicString, defaultLiveRegionRelevant, ("additio ns text"));
1356 const AtomicString& relevant = getAttribute(aria_relevantAttr); 1356 const AtomicString& relevant = getAttribute(aria_relevantAttr);
1357 1357
1358 // Default aria-relevant = "additions text". 1358 // Default aria-relevant = "additions text".
1359 if (relevant.isEmpty()) 1359 if (relevant.isEmpty())
1360 return defaultLiveRegionRelevant; 1360 return defaultLiveRegionRelevant;
1361 1361
1362 return relevant; 1362 return relevant;
1363 } 1363 }
1364 1364
1365 bool AXLayoutObject::liveRegionAtomic() const 1365 bool AXLayoutObject::liveRegionAtomic() const
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2523 if (label && label->layoutObject()) { 2523 if (label && label->layoutObject()) {
2524 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct(); 2524 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct();
2525 result.unite(labelRect); 2525 result.unite(labelRect);
2526 } 2526 }
2527 } 2527 }
2528 2528
2529 return result; 2529 return result;
2530 } 2530 }
2531 2531
2532 } // namespace blink 2532 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698