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

Side by Side Diff: Source/core/html/HTMLMetaElement-in.cpp

Issue 219123002: Read the default min-width value from the UA style sheets (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
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) 2003, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 message.replace("%replacement2", replacement2); 381 message.replace("%replacement2", replacement2);
382 382
383 // FIXME: This message should be moved off the console once a solution to ht tps://bugs.webkit.org/show_bug.cgi?id=103274 exists. 383 // FIXME: This message should be moved off the console once a solution to ht tps://bugs.webkit.org/show_bug.cgi?id=103274 exists.
384 document().addConsoleMessage(RenderingMessageSource, viewportErrorMessageLev el(errorCode), message); 384 document().addConsoleMessage(RenderingMessageSource, viewportErrorMessageLev el(errorCode), message);
385 } 385 }
386 386
387 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie wportDescription::Type origin) 387 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie wportDescription::Type origin)
388 { 388 {
389 ASSERT(!content.isNull()); 389 ASSERT(!content.isNull());
390 390
391 if (!document().settings())
392 return;
393
394 if (!document().shouldOverrideLegacyDescription(origin)) 391 if (!document().shouldOverrideLegacyDescription(origin))
395 return; 392 return;
396 393
397 ViewportDescription descriptionFromLegacyTag(origin); 394 ViewportDescription descriptionFromLegacyTag(origin);
398 if (document().shouldMergeWithLegacyDescription(origin)) 395 if (document().shouldMergeWithLegacyDescription(origin))
399 descriptionFromLegacyTag = document().viewportDescription(); 396 descriptionFromLegacyTag = document().viewportDescription();
400 397
401 parseContentAttribute(content, &HTMLMetaElement::processViewportKeyValuePair , (void*)&descriptionFromLegacyTag); 398 parseContentAttribute(content, &HTMLMetaElement::processViewportKeyValuePair , (void*)&descriptionFromLegacyTag);
402 399
403 if (descriptionFromLegacyTag.minZoom == ViewportDescription::ValueAuto) 400 if (descriptionFromLegacyTag.minZoom == ViewportDescription::ValueAuto)
404 descriptionFromLegacyTag.minZoom = 0.25; 401 descriptionFromLegacyTag.minZoom = 0.25;
405 402
406 if (descriptionFromLegacyTag.maxZoom == ViewportDescription::ValueAuto) { 403 if (descriptionFromLegacyTag.maxZoom == ViewportDescription::ValueAuto) {
407 descriptionFromLegacyTag.maxZoom = 5; 404 descriptionFromLegacyTag.maxZoom = 5;
408 descriptionFromLegacyTag.minZoom = std::min(descriptionFromLegacyTag.min Zoom, float(5)); 405 descriptionFromLegacyTag.minZoom = std::min(descriptionFromLegacyTag.min Zoom, float(5));
409 } 406 }
410 407
411 const Settings* settings = document().settings();
412
413 if (descriptionFromLegacyTag.maxWidth.isAuto()) { 408 if (descriptionFromLegacyTag.maxWidth.isAuto()) {
414 if (descriptionFromLegacyTag.zoom == ViewportDescription::ValueAuto) { 409 if (descriptionFromLegacyTag.zoom == ViewportDescription::ValueAuto) {
415 descriptionFromLegacyTag.minWidth = Length(ExtendToZoom); 410 descriptionFromLegacyTag.minWidth = Length(ExtendToZoom);
416 descriptionFromLegacyTag.maxWidth = Length(settings->layoutFallbackW idth(), Fixed); 411 if (!document().viewportDefaultMinWidth().isAuto())
412 descriptionFromLegacyTag.maxWidth = document().viewportDefaultMi nWidth();
apavlov 2014/03/31 16:47:19 This is slightly confusing (foo.maxWidth = bar.min
kenneth.r.christiansen 2014/03/31 20:37:09 Done.
413 else
414 descriptionFromLegacyTag.maxWidth = Length(ExtendToZoom);
417 } else if (descriptionFromLegacyTag.maxHeight.isAuto()) { 415 } else if (descriptionFromLegacyTag.maxHeight.isAuto()) {
418 descriptionFromLegacyTag.minWidth = Length(ExtendToZoom); 416 descriptionFromLegacyTag.minWidth = Length(ExtendToZoom);
419 descriptionFromLegacyTag.maxWidth = Length(ExtendToZoom); 417 descriptionFromLegacyTag.maxWidth = Length(ExtendToZoom);
420 } 418 }
421 } 419 }
422 420
423 document().setViewportDescription(descriptionFromLegacyTag); 421 document().setViewportDescription(descriptionFromLegacyTag);
424 } 422 }
425 423
426 424
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 { 493 {
496 return getAttribute(http_equivAttr); 494 return getAttribute(http_equivAttr);
497 } 495 }
498 496
499 const AtomicString& HTMLMetaElement::name() const 497 const AtomicString& HTMLMetaElement::name() const
500 { 498 {
501 return getNameAttribute(); 499 return getNameAttribute();
502 } 500 }
503 501
504 } 502 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698