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

Unified Diff: examples/graphics/life/life.css

Issue 6286025: Port the Life example to Pepper 2. (Closed) Base URL: http://naclports.googlecode.com/svn/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/graphics/life/life.cc ('k') | examples/graphics/life/life.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/graphics/life/life.css
===================================================================
--- examples/graphics/life/life.css (revision 0)
+++ examples/graphics/life/life.css (revision 0)
@@ -0,0 +1,53 @@
+/* Copyright 2011 The Native Client SDK Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the LICENSE file.
+ */
+
+/* These div ids are used together to implement a work-around for event
+ * bubbling when using a NaCl module. Using these div ids allows you to
+ * handle user events in the browser, instead of the events being passed into
+ * the NaCl <embed> element. The event layer stacks on top of the NaCl layer
+ * so that it captures the user events, like this:
+ * |--------------------|
+ * | |----------------| |
+ * | | |------------| | |
+ * | | | Event layer| | |
+ * | | |------------| | |
+ * | | NaCl layer | |
+ * | |----------------| |
+ * | Background layer |
+ * |--------------------|
+ */
+
+/* The background layer. This establishes a Z-stack for the event and NaCl
+ * layers.
+ */
+.background_layer {
+ position: relative;
+ z-index: 0;
+}
+
+/* The event layer. This layer has to completely cover the NaCl layer, and
+ * have a higher z-order. This layer captures the user events and doesn't
+ * let them get through to the NaCl layer. Note that |width| and |height|
+ * need to match the corresponding attributes of the <embed> tag that
+ * contains the NaCl module.
+ */
+.event_layer {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 400;
+ height: 400;
+ z-index: 2;
+}
+
+/* The NaCl layer. This layer contains the NaCl module. It must have a
+ * lower z-index than the event layer.
+ */
+.nacl_module_layer {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 1;
+}
Property changes on: examples/graphics/life/life.css
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « examples/graphics/life/life.cc ('k') | examples/graphics/life/life.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698