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

Side by Side Diff: Source/core/css/MediaValues.cpp

Issue 224733011: A sizes attribute parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/MediaValues.h" 6 #include "core/css/MediaValues.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 mediaValues->m_printMediaType = calculatePrintMediaType(frame), 186 mediaValues->m_printMediaType = calculatePrintMediaType(frame),
187 mediaValues->m_strictMode = calculateStrictMode(frame); 187 mediaValues->m_strictMode = calculateStrictMode(frame);
188 188
189 mediaValues->m_style.clear(); 189 mediaValues->m_style.clear();
190 mediaValues->m_frame = 0; 190 mediaValues->m_frame = 0;
191 } 191 }
192 192
193 return mediaValues; 193 return mediaValues;
194 } 194 }
195 195
196 PassRefPtr<MediaValues> MediaValues::create(Document* document, MediaValuesMode mode) 196 PassRefPtr<MediaValues> MediaValues::create(const Document& document, MediaValue sMode mode)
197 { 197 {
198 ASSERT(document); 198 const Document* executingDocument = document.import() ? document.import()->m aster() : &document;
eseidel 2014/04/08 06:02:14 const pointers to ref-counted objects rarely make
199 Document* executingDocument = document->import() ? document->import()->maste r() : document;
200 ASSERT(executingDocument->frame()); 199 ASSERT(executingDocument->frame());
201 ASSERT(executingDocument->renderer()); 200 ASSERT(executingDocument->renderer());
202 ASSERT(executingDocument->renderer()->style()); 201 ASSERT(executingDocument->renderer()->style());
203 LocalFrame* frame = executingDocument->frame(); 202 LocalFrame* frame = executingDocument->frame();
204 RenderStyle* style = executingDocument->renderer()->style(); 203 RenderStyle* style = executingDocument->renderer()->style();
205 204
206 return MediaValues::create(frame, style, mode); 205 return MediaValues::create(frame, style, mode);
207 } 206 }
208 207
209 PassRefPtr<MediaValues> MediaValues::copy() const 208 PassRefPtr<MediaValues> MediaValues::copy() const
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 331 }
333 332
334 Document* MediaValues::document() const 333 Document* MediaValues::document() const
335 { 334 {
336 if (!m_frame) 335 if (!m_frame)
337 return 0; 336 return 0;
338 return m_frame->document(); 337 return m_frame->document();
339 } 338 }
340 339
341 } // namespace 340 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698