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

Side by Side Diff: Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp

Issue 419053005: Fix crash in HTMLInputElement::setupDateTimeChooserParameters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 4 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 319 }
320 320
321 PassRefPtr<RenderStyle> BaseMultipleFieldsDateAndTimeInputType::customStyleForRe nderer(PassRefPtr<RenderStyle> originalStyle) 321 PassRefPtr<RenderStyle> BaseMultipleFieldsDateAndTimeInputType::customStyleForRe nderer(PassRefPtr<RenderStyle> originalStyle)
322 { 322 {
323 EDisplay originalDisplay = originalStyle->display(); 323 EDisplay originalDisplay = originalStyle->display();
324 EDisplay newDisplay = originalDisplay; 324 EDisplay newDisplay = originalDisplay;
325 if (originalDisplay == INLINE || originalDisplay == INLINE_BLOCK) 325 if (originalDisplay == INLINE || originalDisplay == INLINE_BLOCK)
326 newDisplay = INLINE_FLEX; 326 newDisplay = INLINE_FLEX;
327 else if (originalDisplay == BLOCK) 327 else if (originalDisplay == BLOCK)
328 newDisplay = FLEX; 328 newDisplay = FLEX;
329 TextDirection contentDirection = element().locale().isRTL() ? RTL : LTR; 329 TextDirection contentDirection = computedTextDirection();
330 if (originalStyle->direction() == contentDirection && originalDisplay == new Display) 330 if (originalStyle->direction() == contentDirection && originalDisplay == new Display)
331 return originalStyle; 331 return originalStyle;
332 332
333 RefPtr<RenderStyle> style = RenderStyle::clone(originalStyle.get()); 333 RefPtr<RenderStyle> style = RenderStyle::clone(originalStyle.get());
334 style->setDirection(contentDirection); 334 style->setDirection(contentDirection);
335 style->setDisplay(newDisplay); 335 style->setDisplay(newDisplay);
336 style->setUnique(); 336 style->setUnique();
337 return style.release(); 337 return style.release();
338 } 338 }
339 339
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 608
609 if (element().isRequired() || !dateTimeEditElement()->anyEditableFieldsHaveV alues()) { 609 if (element().isRequired() || !dateTimeEditElement()->anyEditableFieldsHaveV alues()) {
610 clearButton->setInlineStyleProperty(CSSPropertyOpacity, 0.0, CSSPrimitiv eValue::CSS_NUMBER); 610 clearButton->setInlineStyleProperty(CSSPropertyOpacity, 0.0, CSSPrimitiv eValue::CSS_NUMBER);
611 clearButton->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNo ne); 611 clearButton->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNo ne);
612 } else { 612 } else {
613 clearButton->removeInlineStyleProperty(CSSPropertyOpacity); 613 clearButton->removeInlineStyleProperty(CSSPropertyOpacity);
614 clearButton->removeInlineStyleProperty(CSSPropertyPointerEvents); 614 clearButton->removeInlineStyleProperty(CSSPropertyPointerEvents);
615 } 615 }
616 } 616 }
617 617
618 TextDirection BaseMultipleFieldsDateAndTimeInputType::computedTextDirection()
619 {
620 return element().locale().isRTL() ? RTL : LTR;
621 }
622
618 } // namespace blink 623 } // namespace blink
619 624
620 #endif 625 #endif
OLDNEW
« no previous file with comments | « Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h ('k') | Source/core/html/forms/InputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698