| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 { | 193 { |
| 194 if (isDetached()) | 194 if (isDetached()) |
| 195 return WebAXObject(); | 195 return WebAXObject(); |
| 196 | 196 |
| 197 return WebAXObject(m_private->parentObject()); | 197 return WebAXObject(m_private->parentObject()); |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool WebAXObject::canSetSelectedAttribute() const | 200 bool WebAXObject::canSetSelectedAttribute() const |
| 201 { | 201 { |
| 202 if (isDetached()) | 202 if (isDetached()) |
| 203 return 0; | 203 return false; |
| 204 | 204 |
| 205 return m_private->canSetSelectedAttribute(); | 205 return m_private->canSetSelectedAttribute(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool WebAXObject::isAnchor() const | 208 bool WebAXObject::isAnchor() const |
| 209 { | 209 { |
| 210 if (isDetached()) | 210 if (isDetached()) |
| 211 return 0; | 211 return false; |
| 212 | 212 |
| 213 return m_private->isAnchor(); | 213 return m_private->isAnchor(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 WebAXOptionalBool WebAXObject::isAriaGrabbed() const | 216 WebAXOptionalBool WebAXObject::isAriaGrabbed() const |
| 217 { | 217 { |
| 218 if (isDetached()) | 218 if (isDetached()) |
| 219 return WebAXOptionalBoolUndefined; | 219 return WebAXOptionalBoolUndefined; |
| 220 | 220 |
| 221 return static_cast<WebAXOptionalBool>(m_private->isAriaGrabbed()); | 221 return static_cast<WebAXOptionalBool>(m_private->isAriaGrabbed()); |
| 222 } | 222 } |
| 223 | 223 |
| 224 bool WebAXObject::isAriaReadOnly() const | 224 bool WebAXObject::isAriaReadOnly() const |
| 225 { | 225 { |
| 226 if (isDetached()) | 226 if (isDetached()) |
| 227 return 0; | 227 return false; |
| 228 | 228 |
| 229 return equalIgnoringCase(m_private->getAttribute(HTMLNames::aria_readonlyAtt
r), "true"); | 229 return equalIgnoringCase(m_private->getAttribute(HTMLNames::aria_readonlyAtt
r), "true"); |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool WebAXObject::isButtonStateMixed() const | 232 bool WebAXObject::isButtonStateMixed() const |
| 233 { | 233 { |
| 234 if (isDetached()) | 234 if (isDetached()) |
| 235 return 0; | 235 return false; |
| 236 | 236 |
| 237 return m_private->checkboxOrRadioValue() == ButtonStateMixed; | 237 return m_private->checkboxOrRadioValue() == ButtonStateMixed; |
| 238 } | 238 } |
| 239 | 239 |
| 240 bool WebAXObject::isChecked() const | 240 bool WebAXObject::isChecked() const |
| 241 { | 241 { |
| 242 if (isDetached()) | 242 if (isDetached()) |
| 243 return 0; | 243 return false; |
| 244 | 244 |
| 245 return m_private->isChecked(); | 245 return m_private->isChecked(); |
| 246 } | 246 } |
| 247 | 247 |
| 248 bool WebAXObject::isClickable() const | 248 bool WebAXObject::isClickable() const |
| 249 { | 249 { |
| 250 if (isDetached()) | 250 if (isDetached()) |
| 251 return 0; | 251 return false; |
| 252 | 252 |
| 253 return m_private->isClickable(); | 253 return m_private->isClickable(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 bool WebAXObject::isCollapsed() const | 256 bool WebAXObject::isCollapsed() const |
| 257 { | 257 { |
| 258 if (isDetached()) | 258 if (isDetached()) |
| 259 return 0; | 259 return false; |
| 260 | 260 |
| 261 return m_private->isCollapsed(); | 261 return m_private->isCollapsed(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 bool WebAXObject::isControl() const | 264 bool WebAXObject::isControl() const |
| 265 { | 265 { |
| 266 if (isDetached()) | 266 if (isDetached()) |
| 267 return 0; | 267 return false; |
| 268 | 268 |
| 269 return m_private->isControl(); | 269 return m_private->isControl(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 bool WebAXObject::isEnabled() const | 272 bool WebAXObject::isEnabled() const |
| 273 { | 273 { |
| 274 if (isDetached()) | 274 if (isDetached()) |
| 275 return 0; | 275 return false; |
| 276 | 276 |
| 277 return m_private->isEnabled(); | 277 return m_private->isEnabled(); |
| 278 } | 278 } |
| 279 | 279 |
| 280 WebAXExpanded WebAXObject::isExpanded() const | 280 WebAXExpanded WebAXObject::isExpanded() const |
| 281 { | 281 { |
| 282 if (isDetached()) | 282 if (isDetached()) |
| 283 return WebAXExpandedUndefined; | 283 return WebAXExpandedUndefined; |
| 284 | 284 |
| 285 return static_cast<WebAXExpanded>(m_private->isExpanded()); | 285 return static_cast<WebAXExpanded>(m_private->isExpanded()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 bool WebAXObject::isFocused() const | 288 bool WebAXObject::isFocused() const |
| 289 { | 289 { |
| 290 if (isDetached()) | 290 if (isDetached()) |
| 291 return 0; | 291 return false; |
| 292 | 292 |
| 293 return m_private->isFocused(); | 293 return m_private->isFocused(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 bool WebAXObject::isHovered() const | 296 bool WebAXObject::isHovered() const |
| 297 { | 297 { |
| 298 if (isDetached()) | 298 if (isDetached()) |
| 299 return 0; | 299 return false; |
| 300 | 300 |
| 301 return m_private->isHovered(); | 301 return m_private->isHovered(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 bool WebAXObject::isIndeterminate() const | 304 bool WebAXObject::isIndeterminate() const |
| 305 { | 305 { |
| 306 if (isDetached()) | 306 if (isDetached()) |
| 307 return 0; | 307 return false; |
| 308 | 308 |
| 309 return m_private->isIndeterminate(); | 309 return m_private->isIndeterminate(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 bool WebAXObject::isLinked() const | 312 bool WebAXObject::isLinked() const |
| 313 { | 313 { |
| 314 if (isDetached()) | 314 if (isDetached()) |
| 315 return 0; | 315 return false; |
| 316 | 316 |
| 317 return m_private->isLinked(); | 317 return m_private->isLinked(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 bool WebAXObject::isLoaded() const | 320 bool WebAXObject::isLoaded() const |
| 321 { | 321 { |
| 322 if (isDetached()) | 322 if (isDetached()) |
| 323 return 0; | 323 return false; |
| 324 | 324 |
| 325 return m_private->isLoaded(); | 325 return m_private->isLoaded(); |
| 326 } | 326 } |
| 327 | 327 |
| 328 bool WebAXObject::isMultiSelectable() const | 328 bool WebAXObject::isMultiSelectable() const |
| 329 { | 329 { |
| 330 if (isDetached()) | 330 if (isDetached()) |
| 331 return 0; | 331 return false; |
| 332 | 332 |
| 333 return m_private->isMultiSelectable(); | 333 return m_private->isMultiSelectable(); |
| 334 } | 334 } |
| 335 | 335 |
| 336 bool WebAXObject::isOffScreen() const | 336 bool WebAXObject::isOffScreen() const |
| 337 { | 337 { |
| 338 if (isDetached()) | 338 if (isDetached()) |
| 339 return 0; | 339 return false; |
| 340 | 340 |
| 341 return m_private->isOffScreen(); | 341 return m_private->isOffScreen(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 bool WebAXObject::isPasswordField() const | 344 bool WebAXObject::isPasswordField() const |
| 345 { | 345 { |
| 346 if (isDetached()) | 346 if (isDetached()) |
| 347 return 0; | 347 return false; |
| 348 | 348 |
| 349 return m_private->isPasswordField(); | 349 return m_private->isPasswordField(); |
| 350 } | 350 } |
| 351 | 351 |
| 352 bool WebAXObject::isPressed() const | 352 bool WebAXObject::isPressed() const |
| 353 { | 353 { |
| 354 if (isDetached()) | 354 if (isDetached()) |
| 355 return 0; | 355 return false; |
| 356 | 356 |
| 357 return m_private->isPressed(); | 357 return m_private->isPressed(); |
| 358 } | 358 } |
| 359 | 359 |
| 360 bool WebAXObject::isReadOnly() const | 360 bool WebAXObject::isReadOnly() const |
| 361 { | 361 { |
| 362 if (isDetached()) | 362 if (isDetached()) |
| 363 return 0; | 363 return false; |
| 364 | 364 |
| 365 return m_private->isReadOnly(); | 365 return m_private->isReadOnly(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 bool WebAXObject::isRequired() const | 368 bool WebAXObject::isRequired() const |
| 369 { | 369 { |
| 370 if (isDetached()) | 370 if (isDetached()) |
| 371 return 0; | 371 return false; |
| 372 | 372 |
| 373 return m_private->isRequired(); | 373 return m_private->isRequired(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 bool WebAXObject::isSelected() const | 376 bool WebAXObject::isSelected() const |
| 377 { | 377 { |
| 378 if (isDetached()) | 378 if (isDetached()) |
| 379 return 0; | 379 return false; |
| 380 | 380 |
| 381 return m_private->isSelected(); | 381 return m_private->isSelected(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 bool WebAXObject::isSelectedOptionActive() const | 384 bool WebAXObject::isSelectedOptionActive() const |
| 385 { | 385 { |
| 386 if (isDetached()) | 386 if (isDetached()) |
| 387 return false; | 387 return false; |
| 388 | 388 |
| 389 return m_private->isSelectedOptionActive(); | 389 return m_private->isSelectedOptionActive(); |
| 390 } | 390 } |
| 391 | 391 |
| 392 WebAXOrientation WebAXObject::orientation() const | 392 WebAXOrientation WebAXObject::orientation() const |
| 393 { | 393 { |
| 394 if (isDetached()) | 394 if (isDetached()) |
| 395 return WebAXOrientationUndefined; | 395 return WebAXOrientationUndefined; |
| 396 | 396 |
| 397 return static_cast<WebAXOrientation>(m_private->orientation()); | 397 return static_cast<WebAXOrientation>(m_private->orientation()); |
| 398 } | 398 } |
| 399 | 399 |
| 400 bool WebAXObject::isVisible() const | 400 bool WebAXObject::isVisible() const |
| 401 { | 401 { |
| 402 if (isDetached()) | 402 if (isDetached()) |
| 403 return 0; | 403 return false; |
| 404 | 404 |
| 405 return m_private->isVisible(); | 405 return m_private->isVisible(); |
| 406 } | 406 } |
| 407 | 407 |
| 408 bool WebAXObject::isVisited() const | 408 bool WebAXObject::isVisited() const |
| 409 { | 409 { |
| 410 if (isDetached()) | 410 if (isDetached()) |
| 411 return 0; | 411 return false; |
| 412 | 412 |
| 413 return m_private->isVisited(); | 413 return m_private->isVisited(); |
| 414 } | 414 } |
| 415 | 415 |
| 416 WebString WebAXObject::accessKey() const | 416 WebString WebAXObject::accessKey() const |
| 417 { | 417 { |
| 418 if (isDetached()) | 418 if (isDetached()) |
| 419 return WebString(); | 419 return WebString(); |
| 420 | 420 |
| 421 return WebString(m_private->accessKey()); | 421 return WebString(m_private->accessKey()); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 for (size_t i = 0; i < describedby.size(); i++) | 457 for (size_t i = 0; i < describedby.size(); i++) |
| 458 result[i] = WebAXObject(describedby[i]); | 458 result[i] = WebAXObject(describedby[i]); |
| 459 describedbyElements.swap(result); | 459 describedbyElements.swap(result); |
| 460 | 460 |
| 461 return true; | 461 return true; |
| 462 } | 462 } |
| 463 | 463 |
| 464 bool WebAXObject::ariaHasPopup() const | 464 bool WebAXObject::ariaHasPopup() const |
| 465 { | 465 { |
| 466 if (isDetached()) | 466 if (isDetached()) |
| 467 return 0; | 467 return false; |
| 468 | 468 |
| 469 return m_private->ariaHasPopup(); | 469 return m_private->ariaHasPopup(); |
| 470 } | 470 } |
| 471 | 471 |
| 472 bool WebAXObject::ariaFlowTo(WebVector<WebAXObject>& flowToElements) const | 472 bool WebAXObject::ariaFlowTo(WebVector<WebAXObject>& flowToElements) const |
| 473 { | 473 { |
| 474 if (isDetached()) | 474 if (isDetached()) |
| 475 return false; | 475 return false; |
| 476 | 476 |
| 477 AXObject::AccessibilityChildrenVector flowTo; | 477 AXObject::AccessibilityChildrenVector flowTo; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 505 { | 505 { |
| 506 if (isDetached()) | 506 if (isDetached()) |
| 507 return false; | 507 return false; |
| 508 | 508 |
| 509 return 0 != m_private->liveRegionRoot(); | 509 return 0 != m_private->liveRegionRoot(); |
| 510 } | 510 } |
| 511 | 511 |
| 512 bool WebAXObject::liveRegionAtomic() const | 512 bool WebAXObject::liveRegionAtomic() const |
| 513 { | 513 { |
| 514 if (isDetached()) | 514 if (isDetached()) |
| 515 return 0; | 515 return false; |
| 516 | 516 |
| 517 return m_private->liveRegionAtomic(); | 517 return m_private->liveRegionAtomic(); |
| 518 } | 518 } |
| 519 | 519 |
| 520 bool WebAXObject::liveRegionBusy() const | 520 bool WebAXObject::liveRegionBusy() const |
| 521 { | 521 { |
| 522 if (isDetached()) | 522 if (isDetached()) |
| 523 return 0; | 523 return false; |
| 524 | 524 |
| 525 return m_private->liveRegionBusy(); | 525 return m_private->liveRegionBusy(); |
| 526 } | 526 } |
| 527 | 527 |
| 528 WebString WebAXObject::liveRegionRelevant() const | 528 WebString WebAXObject::liveRegionRelevant() const |
| 529 { | 529 { |
| 530 if (isDetached()) | 530 if (isDetached()) |
| 531 return WebString(); | 531 return WebString(); |
| 532 | 532 |
| 533 return m_private->liveRegionRelevant(); | 533 return m_private->liveRegionRelevant(); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 m_private = object; | 1238 m_private = object; |
| 1239 return *this; | 1239 return *this; |
| 1240 } | 1240 } |
| 1241 | 1241 |
| 1242 WebAXObject::operator WTF::PassRefPtr<AXObject>() const | 1242 WebAXObject::operator WTF::PassRefPtr<AXObject>() const |
| 1243 { | 1243 { |
| 1244 return m_private.get(); | 1244 return m_private.get(); |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 } // namespace blink | 1247 } // namespace blink |
| OLD | NEW |