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

Side by Side Diff: Source/core/html/HTMLFormControlElement.cpp

Issue 389343002: Custom validation message to take into account text direction (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Compilation and Levi's firstStrong changes Created 6 years, 5 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) 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 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 return; 412 return;
413 String message; 413 String message;
414 if (renderer() && willValidate()) 414 if (renderer() && willValidate())
415 message = validationMessage().stripWhiteSpace(); 415 message = validationMessage().stripWhiteSpace();
416 416
417 m_hasValidationMessage = true; 417 m_hasValidationMessage = true;
418 ValidationMessageClient* client = &page->validationMessageClient(); 418 ValidationMessageClient* client = &page->validationMessageClient();
419 if (message.isEmpty()) 419 if (message.isEmpty())
420 client->hideValidationMessage(*this); 420 client->hideValidationMessage(*this);
421 else 421 else
422 client->showValidationMessage(*this, message); 422 client->showValidationMessage(*this, message, customError());
423
423 } 424 }
424 425
425 void HTMLFormControlElement::hideVisibleValidationMessage() 426 void HTMLFormControlElement::hideVisibleValidationMessage()
426 { 427 {
427 if (!m_hasValidationMessage) 428 if (!m_hasValidationMessage)
428 return; 429 return;
429 430
430 if (ValidationMessageClient* client = validationMessageClient()) 431 if (ValidationMessageClient* client = validationMessageClient())
431 client->hideValidationMessage(*this); 432 client->hideValidationMessage(*this);
432 } 433 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 533
533 void HTMLFormControlElement::setFocus(bool flag) 534 void HTMLFormControlElement::setFocus(bool flag)
534 { 535 {
535 LabelableElement::setFocus(flag); 536 LabelableElement::setFocus(flag);
536 537
537 if (!flag && wasChangedSinceLastFormControlChangeEvent()) 538 if (!flag && wasChangedSinceLastFormControlChangeEvent())
538 dispatchFormControlChangeEvent(); 539 dispatchFormControlChangeEvent();
539 } 540 }
540 541
541 } // namespace Webcore 542 } // namespace Webcore
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/ValidationMessageClient.h » ('j') | Source/core/page/ValidationMessageClient.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698