OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserv
ed. |
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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "Document.h" | 34 #include "Document.h" |
35 #include "Frame.h" | 35 #include "Frame.h" |
36 #include "FrameTree.h" | 36 #include "FrameTree.h" |
37 #include "FrameView.h" | 37 #include "FrameView.h" |
38 #include "HTMLMediaElement.h" | 38 #include "HTMLMediaElement.h" |
39 #include "HistoryItem.h" | 39 #include "HistoryItem.h" |
40 #include "Page.h" | 40 #include "Page.h" |
41 #include "PageCache.h" | 41 #include "PageCache.h" |
42 #include "ResourceHandle.h" | 42 #include "ResourceHandle.h" |
43 #include "StorageMap.h" | 43 #include "StorageMap.h" |
| 44 #include "TextAutosizer.h" |
44 #include <limits> | 45 #include <limits> |
45 | 46 |
46 using namespace std; | 47 using namespace std; |
47 | 48 |
48 namespace WebCore { | 49 namespace WebCore { |
49 | 50 |
50 static void setImageLoadingSettings(Page* page) | 51 static void setImageLoadingSettings(Page* page) |
51 { | 52 { |
52 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->travers
eNext()) { | 53 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->travers
eNext()) { |
53 frame->document()->cachedResourceLoader()->setImagesEnabled(page->settin
gs()->areImagesEnabled()); | 54 frame->document()->cachedResourceLoader()->setImagesEnabled(page->settin
gs()->areImagesEnabled()); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride) | 357 if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride) |
357 return; | 358 return; |
358 | 359 |
359 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride; | 360 m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride; |
360 m_page->setNeedsRecalcStyleInAllFrames(); | 361 m_page->setNeedsRecalcStyleInAllFrames(); |
361 } | 362 } |
362 | 363 |
363 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) | 364 void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor) |
364 { | 365 { |
365 m_textAutosizingFontScaleFactor = fontScaleFactor; | 366 m_textAutosizingFontScaleFactor = fontScaleFactor; |
| 367 |
| 368 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::res
ize, or whether there is only one document per Settings instance? |
| 369 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->trave
rseNext()) |
| 370 frame->document()->textAutosizer()->recalculateMultipliers(); |
| 371 |
366 m_page->setNeedsRecalcStyleInAllFrames(); | 372 m_page->setNeedsRecalcStyleInAllFrames(); |
367 } | 373 } |
368 | 374 |
369 #endif | 375 #endif |
370 | 376 |
371 void Settings::setResolutionOverride(const IntSize& densityPerInchOverride) | 377 void Settings::setResolutionOverride(const IntSize& densityPerInchOverride) |
372 { | 378 { |
373 if (m_resolutionDensityPerInchOverride == densityPerInchOverride) | 379 if (m_resolutionDensityPerInchOverride == densityPerInchOverride) |
374 return; | 380 return; |
375 | 381 |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 gShouldRespectPriorityInCSSAttributeSetters = flag; | 710 gShouldRespectPriorityInCSSAttributeSetters = flag; |
705 } | 711 } |
706 | 712 |
707 bool Settings::shouldRespectPriorityInCSSAttributeSetters() | 713 bool Settings::shouldRespectPriorityInCSSAttributeSetters() |
708 { | 714 { |
709 return gShouldRespectPriorityInCSSAttributeSetters; | 715 return gShouldRespectPriorityInCSSAttributeSetters; |
710 } | 716 } |
711 #endif | 717 #endif |
712 | 718 |
713 } // namespace WebCore | 719 } // namespace WebCore |
OLD | NEW |